# ibmcloud_python_sdk.iam package

## Submodules

## ibmcloud_python_sdk.iam.policy module

class ibmcloud_python_sdk.iam.policy.Policy

  Bases: `object`

  create_policy(**kwargs)

    Create policy

    Parameters

      - type (str) – The policy type; either ‘access’ or ‘authorization’

      - subjects – The subject attribute values that must match in order for this policy to apply in a permission decision

      - roles (dict) – A set of role cloud resource names (CRNs) granted by the policy

      - resources (dict) – The attributes of the resource. Note that only one resource is allowed in a policy

    Typr subjects

      dict

    Returns

      Policy response

    Return type

      dict

  delete_policy(policy)

    Delete policy

    Parameters

      policy (str) – Policy ID

    Returns

      Deletion status

    Return type

      dict

  get_access(account, policy)

    Retrieve specific access policy list per account

    Parameters

      - account (str) – Account ID

      - policy (str) – Policy ID

    Returns

      Access policy information

    Return type

      dict

  get_accesses(account)

    Retrieve access policy list per account

    Parameters

      account (str) – Account ID

    Returns

      List of accesses

    Return type

      list

  get_authorization(account, policy)

    Retrieve specific authorization policy per account

    Parameters

      - account (str) – Account ID

      - policy (str) – Policy ID

    Returns

      Authorization policy information

    Return type

      dict

  get_authorizations(account)

    Retrieve authorization policy list per account

    Parameters

      account (str) – Account ID

    Returns

      List of authorizations

    Return type

      list

  get_policies(account)

    Retrieve policy list per account

    Parameters

      account (str) – Account ID

    Returns

      List of policies

    Return type

      list

  get_policy(policy)

    Retrieve specific policy

    Parameters

      - account (str) – Account ID

      - policy (str) – Policy ID

    Returns

      Policy information

    Return type

      dict

## ibmcloud_python_sdk.iam.role module

class ibmcloud_python_sdk.iam.role.Role

  Bases: `object`

  create_role(**kwargs)

    Create role

    Parameters

      - name (str) – The name of the role

      - account_id (str) – The account GUID

      - service_name (str) – The service name

      - display_name (str) – The display name of the role

      - actions (list) – The actions of the role

      - description (str) – The description of the role

    Returns

      Rolle creation response

    Return type

      dict

  delete_role(role)

    Delete role

    Parameters

      role (str) – Role name or ID

    Returns

      Deletion status

    Return type

      dict

  get_service_role(account, service, role)

    Retrieve specific system role by name or by ID

    Parameters

      - account (str) – Account ID

      - service (str) – Service name

      - role (str) – Role name or ID

    Returns

      Service role information

    Return type

      dict

  get_service_role_by_id(account, service, id)

    Retrieve specific service role by ID

    Parameters

      - account (str) – Account ID

      - service (str) – Service name

      - id (str) – Role ID

    Returns

      Service role information

    Return type

      dict

  get_service_role_by_name(account, service, name)

    Retrieve specific service role by name

    Parameters

      - account (str) – Account ID

      - service (str) – Service name

      - name (str) – Role name

    Returns

      Service role information

    Return type

      dict

  get_service_roles(account, service)

    Retrieve service role list per account

    Parameters

      - account (str) – Account ID

      - service (str) – Service name

    Returns

      List of service roles

    Return type

      list

  get_system_role(account, role)

    Retrieve specific system role by name or by ID

    Parameters

      - account (str) – Account ID

      - role (str) – Role name or ID

    Returns

      System role information

    Return type

      dict

  get_system_role_by_id(account, id)

    Retrieve specific system role by ID

    Parameters

      - account (str) – Account ID

      - id (str) – Role ID

    Returns

      System role information

    Return type

      dict

  get_system_role_by_name(account, name)

    Retrieve specific system role by name

    Parameters

      - account (str) – Account ID

      - name (str) – Role name

    Returns

      System role information

    Return type

      dict

  get_system_roles(account)

    Retrieve system role list per account

    Parameters

      account (str) – Account ID

    Returns

      List of system roles

    Return type

      list

## Module contents