B2 Application key
- class b2sdk.v2.ApplicationKey[source]
Dataclass for storing info about an application key returned by delete-key or list-keys.
- classmethod from_api_response(response: dict) b2sdk.application_key.ApplicationKey [source]
Create an ApplicationKey object from a delete-key or list-key response (a parsed json object).
- __init__(key_name: str, application_key_id: str, capabilities: List[str], account_id: str, expiration_timestamp_millis: Optional[int] = None, bucket_id: Optional[str] = None, name_prefix: Optional[str] = None, options: Optional[List[str]] = None)
- Parameters
key_name – name of the key, assigned by user
application_key_id – key id, used to authenticate
capabilities – list of capabilities assigned to this key
account_id – account’s id
expiration_timestamp_millis – expiration time of the key
bucket_id – if restricted to a bucket, this is the bucket’s id
name_prefix – if restricted to some files, this is their prefix
options – reserved for future use
- as_dict()
Represent the key as a dict, like the one returned by B2 cloud
- class b2sdk.v2.FullApplicationKey[source]
Dataclass for storing info about an application key, including the actual key, as returned by create-key.
- __init__(key_name: str, application_key_id: str, application_key: str, capabilities: List[str], account_id: str, expiration_timestamp_millis: Optional[int] = None, bucket_id: Optional[str] = None, name_prefix: Optional[str] = None, options: Optional[List[str]] = None)[source]
- Parameters
key_name – name of the key, assigned by user
application_key_id – key id, used to authenticate
application_key – the actual secret key
capabilities – list of capabilities assigned to this key
account_id – account’s id
expiration_timestamp_millis – expiration time of the key
bucket_id – if restricted to a bucket, this is the bucket’s id
name_prefix – if restricted to some files, this is their prefix
options – reserved for future use
- classmethod from_create_response(response: dict) b2sdk.application_key.FullApplicationKey [source]
Create a FullApplicationKey object from a create-key response (a parsed json object).