client_id and client_secret are keyword arguments that contain your CrowdStrike API credentials. Please note that all examples below do not hard code these values. (These values are ingested as strings.)
CrowdStrike does not recommend hard coding API credentials or customer identifiers within source code.
from falconpy import CustomStorage
# Do not hardcode API credentials!
falcon = CustomStorage(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
with open("some_file.ext", "wb", encoding="utf-8") as save_file:
save_file.write(falcon.get(collection_name="string", object_key="string"))
from falconpy import CustomStorage
# Do not hardcode API credentials!
falcon = CustomStorage(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
with open("some_file.ext", "wb", encoding="utf-8") as save_file:
save_file.write(falcon.GetObject(collection_name="string", object_key="string"))
from falconpy import APIHarnessV2
# Do not hardcode API credentials!
falcon = APIHarnessV2(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
with open("some_file.ext", "wb", encoding="utf-8") as save_file:
save_file.write(falcon.command("GetObject", collection_name="string", object_key="string"))
from falconpy import CustomStorage
# Do not hardcode API credentials!
falcon = CustomStorage(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
with open("some_file.ext", "rb") as upload_file:
response = falcon.upload(body=upload_file.read(),
collection_name="string",
dry_run=boolean,
object_key="string",
schema_version="string"
)
print(response)
from falconpy import CustomStorage
# Do not hardcode API credentials!
falcon = CustomStorage(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
with open("some_file.ext", "rb") as upload_file:
response = falcon.PutObject(body=upload_file.read(),
collection_name="string",
dry_run=boolean,
object_key="string",
schema_version="string"
)
print(response)
from falconpy import APIHarnessV2
# Do not hardcode API credentials!
falcon = APIHarnessV2(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
with open("some_file.ext", "rb") as upload_file:
response = falcon.command("PutObject",
body=upload_file.read(),
collection_name="string",
dry_run=boolean,
object_key="string",
schema_version="string"
)
print(response)
from falconpy import CustomStorage
# Do not hardcode API credentials!
falcon = CustomStorage(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
response = falcon.metadata(collection_name="string", object_key="string")
print(response)
from falconpy import CustomStorage
# Do not hardcode API credentials!
falcon = CustomStorage(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
response = falcon.GetObjectMetadata(collection_name="string", object_key="string")
print(response)
from falconpy import CustomStorage
# Do not hardcode API credentials!
falcon = CustomStorage(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
with open("some_file.ext", "wb", encoding="utf-8") as save_file:
save_file.write(falcon.get(collection_name="string",
collection_version="string",
object_key="string"
))
from falconpy import CustomStorage
# Do not hardcode API credentials!
falcon = CustomStorage(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
with open("some_file.ext", "wb", encoding="utf-8") as save_file:
save_file.write(falcon.GetObject(collection_name="string",
collection_version="string",
object_key="string"
))
from falconpy import APIHarnessV2
# Do not hardcode API credentials!
falcon = APIHarnessV2(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
with open("some_file.ext", "wb", encoding="utf-8") as save_file:
save_file.write(falcon.command("GetObject",
collection_name="string",
collection_version="string",
object_key="string"
))
from falconpy import CustomStorage
# Do not hardcode API credentials!
falcon = CustomStorage(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
with open("some_file.ext", "rb") as upload_file:
response = falcon.upload(body=upload_file.read(),
collection_name="string",
collection_version="string",
dry_run=boolean,
object_key="string",
schema_version="string"
)
print(response)
from falconpy import CustomStorage
# Do not hardcode API credentials!
falcon = CustomStorage(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
with open("some_file.ext", "rb") as upload_file:
response = falcon.PutObject(body=upload_file.read(),
collection_name="string",
collection_version="string",
dry_run=boolean,
object_key="string",
schema_version="string"
)
print(response)