modelarts-umn/api-ref/source/authorization_management/configuring_authorization.rst
otcbot[bot] 4317c860a8
Update content (#31)
Changes to ma_api from doc-exports#1


This is an automatically created Pull Request for changes to ma_api in opentelekomcloud-docs/doc-exports#1.
Please do not edit it manually, since update to the original PR will overwrite local changes.
Original patch file, as well as complete rst archive,  can be found in the artifacts of the opentelekomcloud-docs/doc-exports#1

Reviewed-by: Vineet Pruthi <None>
2022-05-02 14:51:57 +00:00

7.6 KiB

original_name

CreateAuthorization.html

Configuring Authorization

Function

This API is used to configure ModelArts authorization. ModelArts functions such as training management, development environment, data management, and real-time services can be properly used only after required permissions are assigned. The administrator can use this API to set an agency for IAM users and set the access key of the current user.

URI

POST /v2/{project_id}/authorizations

Table 1 Path parameters
Parameter Mandatory Type Description
project_id Yes String Project ID. For details about how to obtain a project ID, see Obtaining a Project ID <modelarts_03_0147>.

Request Parameters

Table 2 Request body parameters
Parameter Mandatory Type Description
user_id No String

User ID. For details about how to obtain a user ID, see Obtaining a User ID <modelarts_03_0006>.

If user_id is set to all, all IAM users are authorized. If some IAM users have been authorized, the authorization setting will be updated.

This parameter is mandatory only if the authorization type is set to agency.

type No String

Authorization type. Agency is recommended.

Options:

  • agency: authorization through an agency
  • credential: authorization through an access Key (AK/SK)

Default: agency

content Yes String

Authorization content.

  • If Authorization Type is set to Agency, this field indicates the agency name.
  • If Authorization Type is set to AK/SK, this field indicates the access key ID (AK).
secret_key No String Secret Access Key (SK). This field is required only when Authorization Method is set to AK/SK.

Response Parameters

None

Example Requests

Upload authorization.

POST https://{endpoint}/v2/{project_id}/authorizations

{
  "user_id" : "****d80fb058844ae8b82aa66d9fe****",
  "type" : "agency",
  "content" : "modelarts_agency"
}

Example Responses

Status code: 200

OK

{
  "result" : "true"
}

Status Codes

Status Code Description
200 OK
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found

Error Codes

See Error Codes <modelarts_03_0095>.