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(...)
delete_shares_groups(id: int, group_id: int) Response

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

delete_shares_users(id: int, user_id: int) Response

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.

  • ownercivis.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.

  • namestr

    The human readable name for the storage host.

  • providerstr

    The storage provider.One of: s3.

  • bucketstr

    The bucket for this storage host.

  • s3_optionscivis.Response
    • regionstr

      The region for this storage host (ex. “us-east-1”)

list() Response

List the storage hosts

Returns:
civis.Response
  • idint

    The ID of the storage host.

  • ownercivis.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.

  • namestr

    The human readable name for the storage host.

  • providerstr

    The storage provider.One of: s3.

  • bucketstr

    The bucket for this storage host.

  • s3_optionscivis.Response
    • regionstr

      The region for this storage host (ex. “us-east-1”)

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_shares(id: int) Response

List users and groups permissioned on this object

Parameters:
idint

The ID of the resource that is shared.

Returns:
civis.Response
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.

  • ownercivis.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.

  • namestr

    The human readable name for the storage host.

  • providerstr

    The storage provider.One of: s3.

  • bucketstr

    The bucket for this storage host.

  • s3_optionscivis.Response
    • regionstr

      The region for this storage host (ex. “us-east-1”)

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.

  • ownercivis.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.

  • namestr

    The human readable name for the storage host.

  • providerstr

    The storage provider.One of: s3.

  • bucketstr

    The bucket for this storage host.

  • s3_optionscivis.Response
    • regionstr

      The region for this storage host (ex. “us-east-1”)

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.

  • ownercivis.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.

  • namestr

    The human readable name for the storage host.

  • providerstr

    The storage provider.One of: s3.

  • bucketstr

    The bucket for this storage host.

  • s3_optionscivis.Response
    • regionstr

      The region for this storage host (ex. “us-east-1”)

put_shares_groups(id: int, group_ids: List[int], permission_level: str, *, share_email_body: str = None, send_shared_email: bool = None) Response

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
put_shares_users(id: int, user_ids: List[int], permission_level: str, *, share_email_body: str = None, send_shared_email: bool = None) Response

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
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