Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page
Help Center/ ModelArts/ API Reference/ Use Cases/ Managing ModelArts Authorization

Managing ModelArts Authorization

Updated on 2024-05-30 GMT+08:00

This section describes how to manage agency authorization by calling ModelArts APIs.

Overview

The process of managing ModelArts authorization is as follows:

  1. Call the API for authentication to obtain a user token, which will be added in a request header for authentication.
  2. Call the API for creating a ModelArts agency to create an agency for ModelArts-dependent services, such as OBS and SWR.
  3. Call the API for configuring authorization to configure ModelArts authorization. The administrator can use this API to set an agency for IAM users and set the access key of the current user.
    NOTE:

    ModelArts functions, such as data management, training management, development environment, and real-time services, can be used only after being authorized.

  4. Call the API for obtaining the authorization list to view the authorization.
  5. Call the API for deleting authorization to delete the authorization of a specified user or all users.

Prerequisites

Procedure

  1. Call the API for authentication to obtain a user token.
    1. Request body:

      URI: POST https://{iam_endpoint}/v3/auth/tokens

      Request header: Content-Type →application/json

      Request body:
      {
        "auth": {
          "identity": {
            "methods": ["password"],
            "password": {
              "user": {
                "name": "user_name", 
                "password": "user_password",
                "domain": {
                  "name": "domain_name"  
                }
              }
            }
          },
          "scope": {
            "project": {
              "name": "ap-southeast-1"  
            }
          }
        }
      }
      Set the italic parameters based on site requirements.
      • iam_endpoint: IAM endpoint
      • user_name: IAM username
      • user_password: Login password of the user
      • domain_name: Account to which the user belongs
      • ap-southeast-1: Project name, which is the region where ModelArts is deployed
    2. Status code 201 Created is returned. The X-Subject-Token value in the response header is the token.
      x-subject-token → MIIZmgYJKoZIhvcNAQcCoIIZizCCGYcCAQExDTALBglghkgBZQMEAgEwgXXXXXX...
  2. Call the API for creating a ModelArts agency to create an agency for ModelArts-dependent services, such as OBS, SWR, and IEF.
    1. Request body:

      URI: POST https://{endpoint}/v2/{project_id}/agency

      Request header:
      • X-auth-Token →MIIZmgYJKoZIhvcNAQcCoIIZizCCGYcCAQExDTALBglghkgBZQMEAgEwgXXXXXX...
      • Content-Type →application/json

      Request body:

      {
        "agency_name_suffix" : "iam-user01"
      }
      Set the italic parameters based on site requirements.
      • endpoint: ModelArts endpoint
      • project_id: Your project ID
      • X-auth-Token: Token obtained in the previous step
      • agency_name_suffix: Customized suffix of the agency name
    2. Response body with status code 200 OK returned (indicating that ma_agency_iam-user01 has been created):
      {
          "agency_name": "ma_agency_iam-user01"
      }
  3. Call the API for configuring authorization to configure ModelArts authorization. The administrator can use this API to set an agency for IAM users and set the access key of the current user.
    1. Request body:

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

      Request header:
      • X-auth-Token →MIIZmgYJKoZIhvcNAQcCoIIZizCCGYcCAQExDTALBglghkgBZQMEAgEwgXXXXXX...
      • Content-Type →application/json
      Request body:
      {
        "user_id": "****af917080f5d21f55c018ba19****",
        "type": "agency",
        "content": "ma_agency_iam-user01"
      }

      Set the italic parameters based on site requirements. Set user_id to the IAM user ID and content to the ModelArts agency created in the previous step.

    2. Response body with status code 200 OK returned (indicating that the authorization configuration is complete):
      {
          "result": true
      }
  4. Call the API for obtaining the authorization list to view the authorization.
    1. Request body:

      URI: GET https://{endpoint}/v2/{project_id}/authorizations

      Request header: X-auth-Token →MIIZmgYJKoZIhvcNAQcCoIIZizCCGYcCAQExDTALBglghkgBZQMEAgEwgXXXXXX...

      Set the italic parameters based on site requirements.

    2. Response body with status code 200 OK returned:
      {
        "auth": [
          {
            "create_time": 1622804433221,
            "user_id": "all-users",
            "user_name": "all-users",
            "type": "agency",
            "content": "modelarts_agency"
          },
          {
            "create_time": 1625457065365,
            "user_id": "****af917080f5d21f55c018ba19****",
            "user_name": null,
            "type": "agency",
            "content": "ma_agency_iam-user01"
          }
        ],
        "total_count": 2
      }

      Obtain the authorization information based on the response.

  5. Call the API for deleting authorization to delete the authorization of a specified user or all users.
    1. Request body:

      URI: DELETE https://{endpoint}/v2/{project_id}/authorizations?user_id=****d80fb058844ae8b82aa66d9fe****

      Request header: X-auth-Token →MIIZmgYJKoZIhvcNAQcCoIIZizCCGYcCAQExDTALBglghkgBZQMEAgEwgXXXXXX...

      Set the italic parameters based on site requirements. Set ****d80fb058844ae8b82aa66d9fe**** to the IAM user ID of the specified user.

    2. Response body with status code 200 OK returned (indicating that the authorization has been deleted):
      {
          "result": true
      }
    3. If **user_id** is set to **all-users**, the authorization of all IAM users will be deleted. Response body with status code 200 OK returned (indicating that the authorization has been deleted):
      {
          "result": true,
          "success_message": "Delete all-users auth info successfully!"
      }

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback