Storage Hosts
- class Storage_Hosts(session_kwargs, client, return_type='raw')
Methods
delete_shares_groups
(id, group_id)Revoke the permissions a group has on this object
delete_shares_users
(id, user_id)Revoke the permissions a user has on this object
get
(id)Get a storage host
list
()List the storage hosts
list_dependencies
(id, *[, user_id])List dependent objects for this object
list_shares
(id)List users and groups permissioned on this object
patch
(id, *[, name, provider, bucket, ...])Update some attributes of this storage host
post
(provider, bucket, name, *[, s3_options])Create a new storage host
put
(id, name, provider, bucket, *[, s3_options])Replace all attributes of this storage host
put_shares_groups
(id, group_ids, ...[, ...])Set the permissions groups has on this object
put_shares_users
(id, user_ids, ...[, ...])Set the permissions users have on this object
put_transfer
(id, user_id, ...[, email_body, ...])Transfer ownership of this object to another user
Examples
>>> import civis >>> client = civis.APIClient() >>> client.storage_hosts.list(...)
Revoke the permissions a group has on this object
- Parameters:
- idint
The ID of the resource that is shared.
- group_idint
The ID of the group.
- Returns:
- None
Response code 204: success
Revoke the permissions a user has on this object
- Parameters:
- idint
The ID of the resource that is shared.
- user_idint
The ID of the user.
- Returns:
- None
Response code 204: success
- get(id: int) Response
Get a storage host
- Parameters:
- idint
The ID of the storage host.
- Returns:
civis.Response
- idint
The ID of the storage host.
- owner
civis.Response
- idint
The ID of this user.
- namestr
This user’s name.
- usernamestr
This user’s username.
- initialsstr
This user’s initials.
- onlinebool
Whether this user is online.
- owner
- namestr
The human readable name for the storage host.
- providerstr
The storage provider.One of: s3.
- bucketstr
The bucket for this storage host.
- s3_options
civis.Response
- regionstr
The region for this storage host (ex. “us-east-1”)
- s3_options
- list() Response
List the storage hosts
- Returns:
civis.Response
- idint
The ID of the storage host.
- owner
civis.Response
- idint
The ID of this user.
- namestr
This user’s name.
- usernamestr
This user’s username.
- initialsstr
This user’s initials.
- onlinebool
Whether this user is online.
- owner
- namestr
The human readable name for the storage host.
- providerstr
The storage provider.One of: s3.
- bucketstr
The bucket for this storage host.
- s3_options
civis.Response
- regionstr
The region for this storage host (ex. “us-east-1”)
- s3_options
- list_dependencies(id: int, *, user_id: int = None) Response
List dependent objects for this object
- Parameters:
- idint
The ID of the resource that is shared.
- user_idint, optional
ID of target user
- Returns:
civis.Response
- object_typestr
Dependent object type
- fco_typestr
Human readable dependent object type
- idint
Dependent object ID
- namestr
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstr
Permission level of target user (not user’s groups) for dependent object. Null if no target user or not shareable (e.g. a database table).
- descriptionstr
Additional information about the dependency, if relevant
- shareablebool
Whether or not the requesting user can share this object.
List users and groups permissioned on this object
- Parameters:
- idint
The ID of the resource that is shared.
- Returns:
civis.Response
- readers
civis.Response
- usersList[
civis.Response
] id : int
name : str
- usersList[
- groupsList[
civis.Response
] id : int
name : str
- groupsList[
- readers
- writers
civis.Response
- usersList[
civis.Response
] id : int
name : str
- usersList[
- groupsList[
civis.Response
] id : int
name : str
- groupsList[
- writers
- owners
civis.Response
- usersList[
civis.Response
] id : int
name : str
- usersList[
- groupsList[
civis.Response
] id : int
name : str
- groupsList[
- owners
- total_user_sharesint
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesint
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- patch(id: int, *, name: str = None, provider: str = None, bucket: str = None, s3_options: dict = None) Response
Update some attributes of this storage host
- Parameters:
- idint
The ID of the storage host.
- namestr, optional
The human readable name for the storage host.
- providerstr, optional
The storage provider.One of: s3.
- bucketstr, optional
The bucket for this storage host.
- s3_optionsdict, optional
- regionstr
The region for this storage host (ex. “us-east-1”)
- Returns:
civis.Response
- idint
The ID of the storage host.
- owner
civis.Response
- idint
The ID of this user.
- namestr
This user’s name.
- usernamestr
This user’s username.
- initialsstr
This user’s initials.
- onlinebool
Whether this user is online.
- owner
- namestr
The human readable name for the storage host.
- providerstr
The storage provider.One of: s3.
- bucketstr
The bucket for this storage host.
- s3_options
civis.Response
- regionstr
The region for this storage host (ex. “us-east-1”)
- s3_options
- post(provider: str, bucket: str, name: str, *, s3_options: dict = None) Response
Create a new storage host
- Parameters:
- providerstr
The storage provider.One of: s3.
- bucketstr
The bucket for this storage host.
- namestr
The human readable name for the storage host.
- s3_optionsdict, optional
- regionstr
The region for this storage host (ex. “us-east-1”)
- Returns:
civis.Response
- idint
The ID of the storage host.
- owner
civis.Response
- idint
The ID of this user.
- namestr
This user’s name.
- usernamestr
This user’s username.
- initialsstr
This user’s initials.
- onlinebool
Whether this user is online.
- owner
- namestr
The human readable name for the storage host.
- providerstr
The storage provider.One of: s3.
- bucketstr
The bucket for this storage host.
- s3_options
civis.Response
- regionstr
The region for this storage host (ex. “us-east-1”)
- s3_options
- put(id: int, name: str, provider: str, bucket: str, *, s3_options: dict = None) Response
Replace all attributes of this storage host
- Parameters:
- idint
The ID of the storage host.
- namestr
The human readable name for the storage host.
- providerstr
The storage provider.One of: s3.
- bucketstr
The bucket for this storage host.
- s3_optionsdict, optional
- regionstr
The region for this storage host (ex. “us-east-1”)
- Returns:
civis.Response
- idint
The ID of the storage host.
- owner
civis.Response
- idint
The ID of this user.
- namestr
This user’s name.
- usernamestr
This user’s username.
- initialsstr
This user’s initials.
- onlinebool
Whether this user is online.
- owner
- namestr
The human readable name for the storage host.
- providerstr
The storage provider.One of: s3.
- bucketstr
The bucket for this storage host.
- s3_options
civis.Response
- regionstr
The region for this storage host (ex. “us-east-1”)
- s3_options
Set the permissions groups has on this object
- Parameters:
- idint
The ID of the resource that is shared.
- group_idsList[int]
An array of one or more group IDs.
- permission_levelstr
Options are: “read”, “write”, or “manage”.
- share_email_bodystr, optional
Custom body text for e-mail sent on a share.
- send_shared_emailbool, optional
Send email to the recipients of a share.
- Returns:
civis.Response
- readers
civis.Response
- usersList[
civis.Response
] id : int
name : str
- usersList[
- groupsList[
civis.Response
] id : int
name : str
- groupsList[
- readers
- writers
civis.Response
- usersList[
civis.Response
] id : int
name : str
- usersList[
- groupsList[
civis.Response
] id : int
name : str
- groupsList[
- writers
- owners
civis.Response
- usersList[
civis.Response
] id : int
name : str
- usersList[
- groupsList[
civis.Response
] id : int
name : str
- groupsList[
- owners
- total_user_sharesint
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesint
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
Set the permissions users have on this object
- Parameters:
- idint
The ID of the resource that is shared.
- user_idsList[int]
An array of one or more user IDs.
- permission_levelstr
Options are: “read”, “write”, or “manage”.
- share_email_bodystr, optional
Custom body text for e-mail sent on a share.
- send_shared_emailbool, optional
Send email to the recipients of a share.
- Returns:
civis.Response
- readers
civis.Response
- usersList[
civis.Response
] id : int
name : str
- usersList[
- groupsList[
civis.Response
] id : int
name : str
- groupsList[
- readers
- writers
civis.Response
- usersList[
civis.Response
] id : int
name : str
- usersList[
- groupsList[
civis.Response
] id : int
name : str
- groupsList[
- writers
- owners
civis.Response
- usersList[
civis.Response
] id : int
name : str
- usersList[
- groupsList[
civis.Response
] id : int
name : str
- groupsList[
- owners
- total_user_sharesint
For owners, the number of total users shared. For writers and readers, the number of visible users shared.
- total_group_sharesint
For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.
- put_transfer(id: int, user_id: int, include_dependencies: bool, *, email_body: str = None, send_email: bool = None) Response
Transfer ownership of this object to another user
- Parameters:
- idint
The ID of the resource that is shared.
- user_idint
ID of target user
- include_dependenciesbool
Whether or not to give manage permissions on all dependencies
- email_bodystr, optional
Custom body text for e-mail sent on transfer.
- send_emailbool, optional
Send email to the target user of the transfer?
- Returns:
civis.Response
- dependenciesList[
civis.Response
] Dependent objects for this object
- object_typestr
Dependent object type
- fco_typestr
Human readable dependent object type
- idint
Dependent object ID
- namestr
Dependent object name, or nil if the requesting user cannot read this object
- permission_levelstr
Permission level of target user (not user’s groups) for dependent object. Null if no target user or not shareable (e.g. a database table).
- descriptionstr
Additional information about the dependency, if relevant
- sharedbool
Whether dependent object was successfully shared with target user
- dependenciesList[