sss methods¶
-
class
ecl.sss.v1._proxy.
Proxy
(session)[source]¶ Bases:
ecl.proxy2.BaseProxy
-
assign_iam_role
(iam_group_id, iam_role_id)[source]¶ Assignment of the IAM Role to the IAM Group.
Parameters: - iam_group_id – IAM Group ID that assign to the Role.
- iam_role_id – IAM Role ID that assign to the Group.
Returns:
-
assign_user
(iam_group_id, user_id)[source]¶ Assignment of the IAM User to the IAM Group.
Parameters: - iam_group_id – IAM Group ID that assign to the User.
- user_id – User ID that assign to the Group.
Returns:
-
channels
(get_contracts, **query)[source]¶ Getting lists of information about the own channel and end user channel that own contract belongs. Only partner user allowed.
Parameters: get_contracts – The flag of whether getting contracts (true or false(default)). Returns: A generator of channels instances. Return type: Channel
-
contracts
(channel_id, include_deleted='false')[source]¶ List Contracts in the designated channel. Only partner user allowed.
Parameters: - channel_id – Target channel_id under own contract.
- include_deleted – Setting true or false(default is false)
(true : Include deleted contract/ false: Not include deleted contract. :return: A generator of contracts instances. :rtype:
Contract
-
create_contract
(login_id, mail_address, channel_id, password=None, external_reference_id=None, notify_password=None)[source]¶ Create contract in designated channel. Only partner user allowed.
Parameters: - login_id – Login ID of new user.
- mail_address – E-mail address of the user.
- channel_id – The channel means the group to manage contracts. The partner user will be given 2 channels. One is the channel that contains own contract. The other is the channel that contains all end user contracts which the partner user has. By executing the List Channel API(For partner user only), the user can get your (and enduser’s) channel ID.
- password – Password of the user. If the API user set this item as blank, the system set initial random password automatically.
- external_reference_id – By using this item, the partner API user can associate optional string to the constract(e.g. The end user management ID in the partner user’s system). Note that this ID will be NOT used to control the contract in ECL2.0 internal system. If the item is set as blank, ECL 2.0 system set the end user’s contract ID automatically(e.g. econXXXXXXXX).
- notify_password – Setting true or false(default is false). This item designate whether the system should send to the login_ID and Password with e-mail.
Returns:
-
create_iam_group
(iam_group_name, contract_id=None, description=None)[source]¶ Create iam group.
Parameters: - iam_group_name – New IAM Group name. Alphanumeric characters and @, -, ., _ can be used.
- contract_id – Contract ID ( Default is the Contract ID of API executing user ) .
- description – Description of the IAM Group.
Returns:
-
create_iam_role
(iam_role_name, resources, contract_id=None, description=None)[source]¶ Create IAM Role in the designated contract. Only supser user (contract owner user) can use this API.
Parameters: - iam_role_name – New IAM Role name. Alphanumeric characters and @, -, ., _ can be used.
- resources – Whitelist rules of API execution. ( resources item is mandatory, but a user can define any rule by using follow parameters. )
- contract_id – Contract ID ( Default is the Contract ID of API executing user ).
- description – Description of the IAM Role.
Returns:
-
create_role
(user_id, tenant_id)[source]¶ Create role between a user and a tenant. With role, users can access to the tenants.
Parameters: - user_id – User which have new role.
- tenant_id – Tenant which the user have role.
Returns:
-
create_tenant
(**attrs)[source]¶ Create new tenant in the designated contract. Only supser user (contract owner user) allowed.
Parameters: attrs – Keyword arguments which will be used to create a Tenant
, comprised of the properties on the Tenant class.Returns: The results of tenant creation Return type: Tenant
-
create_user
(login_id, mail_address, notify_password, password=None)[source]¶ Create user in the designated contract. Only supser user (contract owner user) allowed.
Parameters: - login_id – Login id of new user.
- mail_address – Mail address of new user.
- notify_password – If this flag is set ‘true’, notification email will be sent to new users email
- password – Initial password of new user. If this parameter is not designated, random initial password is generated and applied to new user.
Returns: The results of user creation
Return type:
-
delete_assign_iam_role
(iam_group_id, iam_role_id)[source]¶ Delete Assignment of the IAM Role to the IAM Group.
Parameters: - iam_group_id – IAM Group ID.
- iam_role_id – IAM Role ID.
Returns: None
-
delete_assign_user
(iam_group_id, user_id)[source]¶ Delete Assignment of the User to the IAM Group.
Parameters: - iam_group_id – IAM Group ID.
- user_id – User ID.
Returns: None
-
delete_contract
(contract_id, ignore_missing=True)[source]¶ Delete contract in designated channel. Only partner user allowed.
Parameters: - contract_id – Contract ID of Delete target
- ignore_missing – When set to
False
ResourceNotFound
will be raised when the user does not exist. When set toTrue
, no exception will be set when attempting to delete a nonexistent server
Returns: None
-
delete_iam_group
(iam_group_id, ignore_missing=True)[source]¶ Delete iam group.
Parameters: - iam_group_id – Group ID that you want to delete.
- ignore_missing – When set to
False
ResourceNotFound
will be raised when the user does not exist. When set toTrue
, no exception will be set when attempting to delete a nonexistent server
Returns: None
-
delete_iam_role
(iam_role_id, ignore_missing=True)[source]¶ Delete designated IAM Role. Only supser user (contract owner user) can use this API.
Parameters: iam_role_id – IAM Role ID that you want to delete. Returns: None
-
delete_role
(tenant_id, user_id)[source]¶ Delete role between user and tenant. Contract owner user always have role to all tenants in the contract. Only supser user (contract owner user) allowed.
Parameters: - tenant_id – Delete target tenant’s tenant id.
- user_id – User’s id of the role
Returns: None
-
delete_tenant
(tenant, ignore_missing=True)[source]¶ Delete tenant. Only supser user (contract owner user) allowed.
Parameters: - tenant – Delete target tenant’s tenant id.
- ignore_missing – When set to
False
ResourceNotFound
will be raised when the user does not exist. When set toTrue
, no exception will be set when attempting to delete a nonexistent server
Returns: None
-
delete_user
(user, ignore_missing=True)[source]¶ Delete user. Only supser user (contract owner user) allowed. Contract owner user itself cannot be deleted
Parameters: - user – Delete target user’s user id.
- ignore_missing – When set to
False
ResourceNotFound
will be raised when the user does not exist. When set toTrue
, no exception will be set when attempting to delete a nonexistent server
Returns: None
-
find_tenant
(tenant_id, ignore_missing=True)[source]¶ Find a tenant. Get tenant information such as tenant name, etc.
Parameters: - tenant_id – ID of a tenant
- ignore_missing – When set to
True
, None will be returned when attempting to find a nonexistent resource.
Returns: One
Tenant
or None
-
find_user
(user_id, ignore_missing=True)[source]¶ Find a user. Get user information such as login id, email, apikey, etc.
Parameters: - user_id – ID of a user
- ignore_missing – When set to
True
, None will be returned when attempting to find a nonexistent resource.
Returns: One
User
or None
-
get_billing_info
(channel_id, target_month)[source]¶ Get billing statement of designated month.
Parameters: - channel_id – Billing statement owner contract.
- target_month – Target billing month with YYYY-MM format
Returns: One
Contract
-
get_contract
(contract_id)[source]¶ Get the information of the designated contract.
Parameters: contract_id – The contract ID getting more information. Returns: One Contract
-
get_iam_role
(iam_role_id)[source]¶ - Show a IAM Role’s information. You can check a IAM Role’s
- name, ID and resources by executing this API.
Parameters: iam_role_id – IAM Role ID that you want to check information. Returns: IAMRole
-
get_monthly_billing_of_each_contract
(contract_id, target_month, target_contract_id)[source]¶ Get montly billing for each contract. Only partner user allowed.
Parameters: - contract_id – Contract ID of this request.
- target_month – Target billing month with YYYY-MM format
- target_contract_id – Target contract ID
Returns:
-
get_user
(user)[source]¶ Get user information such as login id, email, apikey, etc.
Parameters: user – ID of a user or a User
instance.Returns: One User
or :class:`~ecl.exceptions.ResourceNotFound`when no resource can be found.
-
iam_groups
(contract_id)[source]¶ List iam groups by contract id.
Parameters: contract_id – Contract ID ( Default is the Contract ID of API executing user ) . Returns: A list of iam groups. Return type: IAMGroup
-
iam_roles
(contract_id)[source]¶ List IAM Role list in the designated contract.
Parameters: contract_id – Contract ID ( Default is the Contract ID of API executing user ) . Returns: A list of iam groups. Return type: IAMRole
-
tenants
(**query)[source]¶ List tenants in the designated contract.
Parameters: **query (kwargs) – Optional query parameters to be sent to limit the resources being returned. Returns: A generator of tenant instances. Return type: Tenant
-
update_api_key
(user_id)[source]¶ Update API key pair of target user.
Parameters: user_id – Change target user’s user id. Returns: The attributes to update on the api_key represented by Api_key
.
-
update_user
(user_id, login_id=None, mail_address=None, new_password=None)[source]¶ Update user’s informain.
Parameters: - user_id – Specified user_id.
- login_id – Login id of new user.
- mail_address – Mail address of new user.
- new_password – New password of the user.
Returns: None
-
api_key¶
-
class
ecl.sss.v1.api_key.
Api_key
(synchronized=False, **attrs)[source]¶ Bases:
ecl.resource2.Resource
-
allow_update
= True¶
-
base_path
= '/keys'¶
-
keystone_name
= None¶ New API key(keystone username)
-
keystone_password
= None¶ New API secret(keystone password)
-
resource_key
= None¶
-
resources_key
= None¶
-
service
= {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'sss', 'requires_project_id': False, 'api_version': None}¶
-
status
= None¶ Update status. ‘Success’ for successful update
-
user_id
= None¶ User’s id whose API key updated.
-
channel¶
-
class
ecl.sss.v1.channel.
Channel
(synchronized=False, **attrs)[source]¶ Bases:
ecl.resource2.Resource
-
allow_list
= True¶
-
base_path
= '/channels?get_contracts=%(get_contracts)s'¶
-
channel_id
= None¶ Channel ID.
-
channel_name
= None¶ Channel name.
-
contracts
= None¶ List of contracts has two parameters: contract_id: Contract ID. status: The status of the contract(enable or deleted).
-
language
= None¶ This item setting will relate to language setting of E-mail that will send by ECL2.0. Please note that NOT related to user’s display language setting(That setting is rely on the user browser’s language setting.)
-
management_channel
= None¶ Whether this channel_id is the partner management channel(true), or not(false).
-
parent_channel_id
= None¶ The parent channel ID means partner’s channel ID that belongs the end user.
-
resource_key
= None¶
-
resources_key
= 'channels'¶
-
service
= {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'sss', 'requires_project_id': False, 'api_version': None}¶
-
contract¶
-
class
ecl.sss.v1.contract.
Contract
(synchronized=False, **attrs)[source]¶ Bases:
ecl.resource2.Resource
-
allow_create
= True¶
-
allow_delete
= True¶
-
allow_get
= True¶
-
allow_list
= True¶
-
base_path
= '/contracts'¶
-
channel_id
= None¶ Channel ID of this contract.
-
channel_name
= None¶ Channel name.
-
charge_data
= None¶ The detail of billing information
-
charge_status
= None¶ The status of the acquired charge information (estimated: undetermined / fixed: Committed)
-
company_code
= None¶ Internal use
-
contract_id
= None¶ Contract ID.
-
contract_owner_user_id
= None¶ The owner user ID in the Contract
-
customer_name
= None¶ customer_name
-
customer_number
= None¶ This ID is equal to external_reference_id.
-
cycle_end_time
= None¶ Period of the acquired charge information(End time)
-
cycle_start_time
= None¶ Period of the acquired charge information(Start time)
-
end_time
= None¶ End time of the contract
-
external_reference_id
= None¶ By using this item, the partner API user can associate optional string to the constract(e.g. The end user management ID in the partner user’s system). Note that this ID will be NOT used to control the contract in ECL2.0 internal system. If the item is set as blank, ECL 2.0 system set the end user’s contract ID automatically
-
get_billing_info
(session, channel_id, target_month)[source]¶ Get billing information by channel id and target month
-
get_monthly_billing_of_each_contract
(session, contract_id, target_month, target_contract_id)[source]¶ Get montly billing for each contract.
-
glass_customer_id
= None¶ Internal use
-
glass_user_id
= None¶ Internal use
-
keystone_endpoint
= None¶ keystone_endpoint
-
keystone_name
= None¶ This user’s API key for keystone authentication.
-
keystone_password
= None¶ This user’s API secret for keystone authentication.
-
login_id
= None¶ Login ID of user.
-
login_integration
= None¶ Internal use(Login type)
-
mail_address
= None¶ E-mail address of the user.
-
management_channel
= None¶ Whether this channel_id is the partner management channel(true), or not(false).
-
notify_password
= None¶ Setting true or false(default is false). This item designate whether the system should send to the login_ID and Password with e-mail.
-
owner_contract_id
= None¶ The designated contract ID by request’s target_contract_id.
-
password
= None¶ Password of the user. If user set this item as blank, the system set initial random password automatically.
-
put_create
= False¶
-
resource_key
= None¶
-
resources_key
= None¶
-
service
= {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'sss', 'requires_project_id': False, 'api_version': None}¶
-
sss_endpoint
= None¶ Access point to use APIs in the decided region
-
start_time
= None¶ Start time of the contract
-
status
= None¶ status
-
user_id
= None¶ User id. format is ecid[0-9]{10}.
-
iam_group¶
-
class
ecl.sss.v1.iam_group.
IAMGroup
(synchronized=False, **attrs)[source]¶ Bases:
ecl.resource2.Resource
-
allow_create
= True¶
-
allow_delete
= True¶
-
allow_list
= True¶
-
allow_update
= True¶
-
assign_iam_role
(session, iam_group_id, iam_role_id)[source]¶ Assignment of the IAM Role to the IAM Group.
-
base_path
= '/iam/groups'¶
-
contract_id
= None¶ The contact ID that the IAM Group belongs.
-
delete_assign_iam_role
(session, iam_group_id, iam_role_id)[source]¶ Delete Assignment of the IAM Role to the IAM Group.
-
delete_assign_user
(session, iam_group_id, user_id)[source]¶ Delete Assignment of the IAM User to the IAM Group.
-
description
= None¶ Description of the IAM group.
-
iam_group_id
= None¶ The IAM Group ID.
-
iam_group_name
= None¶ The IAM Group name.
-
iam_role_id
= None¶ The IAM Role ID.
-
iam_role_name
= None¶ The IAM Role name.
-
iam_roles
= None¶ IAM Role Object. * iam_role_id: The IAM Role ID. * iam_role_name: The IAM Role name.
-
resource_key
= None¶
-
resources_key
= 'iam_groups'¶
-
user_id
= None¶ The User ID.
-
users
= None¶ User ID that belongs in the designated IAM Group ID.
-
iam_role¶
-
class
ecl.sss.v1.iam_role.
IAMRole
(synchronized=False, **attrs)[source]¶ Bases:
ecl.resource2.Resource
-
allow_create
= True¶
-
allow_delete
= True¶
-
allow_get
= True¶
-
allow_list
= True¶
-
base_path
= '/iam/roles'¶
-
contract_id
= None¶ The contact ID that the IAM Role belongs.
-
description
= None¶ Description of the IAM Role.
-
iam_role_id
= None¶ The IAM Role’s ID.
-
iam_role_name
= None¶ The IAM Role’s name.
-
resource_key
= None¶
-
resources
= None¶ Whitelist rules of API exectution.
-
resources_key
= 'iam_roles'¶
-
role¶
-
class
ecl.sss.v1.role.
Role
(synchronized=False, **attrs)[source]¶ Bases:
ecl.resource2.Resource
-
allow_create
= True¶
-
allow_delete
= True¶
-
base_path
= '/roles'¶
-
put_create
= False¶
-
region_id
= None¶ Region id which the tenant belongs to.
-
region_name
= None¶ Region name which the tenant belongs to.
-
resource_key
= None¶
-
resources_key
= None¶
-
role_name
= None¶ Attached role’s name.
-
service
= {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'sss', 'requires_project_id': False, 'api_version': None}¶
-
tenant_id
= None¶ Tenant’s id which is attached with the role.
-
tenant_name
= None¶ Tenant’s name which is attached with the role.
-
user_id
= None¶ User’s id who was attached with the role.
-
tenant¶
-
class
ecl.sss.v1.tenant.
Tenant
(synchronized=False, **attrs)[source]¶ Bases:
ecl.resource2.Resource
-
allow_create
= True¶
-
allow_delete
= True¶
-
allow_list
= True¶
-
base_path
= '/tenants'¶
-
contract_id
= None¶ Contract which the tenant belongs to.
-
description
= None¶ Tenant’s description.
-
classmethod
find
(session, name_or_id, ignore_missing=True, **params)[source]¶ Find a resource by its name or id.
Parameters: - session (
Session
) – The session to use for making this request. - name_or_id – This resource’s identifier, if needed by
the request. The default is
None
. - ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the resource does not exist. When set toTrue
, None will be returned when attempting to find a nonexistent resource. - params (dict) – Any additional parameters to be passed into
underlying methods, such as to
existing()
in order to pass on URI parameters.
Returns: The
Resource
object matching the given name or id or None if nothing matches.Raises: ecl.exceptions.DuplicateResource
if more than one resource is found for this request.Raises: ecl.exceptions.ResourceNotFound
if nothing is found and ignore_missing isFalse
.- session (
-
put_create
= False¶
-
region
= None¶ Region which the tenant belongs to.
-
resource_key
= None¶
-
resources_key
= 'tenants'¶
-
service
= {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'sss', 'requires_project_id': False, 'api_version': None}¶
-
tenant_id
= None¶ Tenant’s id.
-
tenant_name
= None¶ Tenant name.
-
user¶
-
class
ecl.sss.v1.user.
User
(synchronized=False, **attrs)[source]¶ Bases:
ecl.resource2.Resource
-
allow_create
= True¶
-
allow_delete
= True¶
-
allow_get
= True¶
-
allow_list
= True¶
-
allow_update
= True¶
-
base_path
= '/users'¶
-
contract_id
= None¶ Contract ID which this user belongs. contract id format is econ[0-9]{10}.
-
contract_owner
= None¶ If this user is the Super user in this contract, 1. If not, 0.
-
external_reference_id
= None¶ External system oriented contract id. If this user’s contract is NTT Communications, customer number with 15 numbers will be shown.
-
classmethod
find
(session, name_or_id, ignore_missing=True, **params)[source]¶ Find a resource by its name or id.
Parameters: - session (
Session
) – The session to use for making this request. - name_or_id – This resource’s identifier, if needed by
the request. The default is
None
. - ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the resource does not exist. When set toTrue
, None will be returned when attempting to find a nonexistent resource. - params (dict) – Any additional parameters to be passed into
underlying methods, such as to
existing()
in order to pass on URI parameters.
Returns: The
Resource
object matching the given name or id or None if nothing matches.Raises: ecl.exceptions.DuplicateResource
if more than one resource is found for this request.Raises: ecl.exceptions.ResourceNotFound
if nothing is found and ignore_missing isFalse
.- session (
-
keystone_endpoint
= None¶ Keystone address this user can use to get token for SSS API request.
-
keystone_name
= None¶ This user’s API key for keystone authentication.
-
keystone_password
= None¶ This user’s API secret for keystone authentication.
-
login_id
= None¶ login id of the user. When this contract is tied with icp, this parameter is fixed {email}_{user_id}.
-
login_integration
= None¶ If this user’s contract is tied with NTT Communications business portal, ‘icp’ is shown.
-
mail_address
= None¶ Mail address of the user.
-
new_password
= None¶ New password of the user
-
notify_password
= None¶ If this flag is set ‘true’, notification eamil will be sent to new user’s email.
-
password
= None¶ Password of the user
-
put_create
= False¶
-
resource_key
= None¶
-
resources_key
= 'users'¶
-
service
= {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'sss', 'requires_project_id': False, 'api_version': None}¶
-
sss_endpoint
= None¶ SSS endpoint recommended for this user
-
user_id
= None¶ User id. format is ecid[0-9]{10}.
-
users
= None¶ User list.
-