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

Creating an Agency

Updated on 2024-11-18 GMT+08:00

Function

This API is provided for the administrator to create an agency.

The API can be called using both the global endpoint and region-specific endpoints. For IAM endpoints, see Regions and Endpoints.

Debugging

You can debug this API in API Explorer.

URI

POST /v3.0/OS-AGENCY/agencies

Request Parameters

Table 1 Parameters in the request header

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Fill application/json;charset=utf8 in this field.

X-Auth-Token

Yes

String

Access token issued to a user to bear its identity and permissions.

For details about the permissions required by the token, see Actions.

Table 2 Parameters in the request body

Parameter

Mandatory

Type

Description

agency

Yes

object

Agency information.

Table 3 agency

Parameter

Mandatory

Type

Description

name

Yes

String

Agency name, which must contain less than or equal to 64 characters.

domain_id

Yes

String

ID of the delegating account.

trust_domain_id

No

String

ID of the delegated account. Either trust_domain_id or trust_domain_name must be specified. If both of them are specified, trust_domain_name takes precedence.

trust_domain_name

No

String

Name of the delegated account. Either trust_domain_id or trust_domain_name must be specified. If both of them are specified, trust_domain_name takes precedence.

description

No

String

Description of the agency, which must contain less than or equal to 255 characters.

duration

No

String

Validity period of the agency. Unit: day. Default value: FOREVER.

Options:

  • FOREVER: The agency has unlimited validity.
  • ONEDAY: The agency is valid for one day.
  • Specific days: The agency has limited validity of, for example, 20 days.

Response Parameters

Table 4 Parameters in the response body

Parameter

Type

Description

agency

object

Agency information.

Table 5 agency

Parameter

Type

Description

create_time

String

Time when the agency was created.

NOTE:

The value is a UTC time in the YYYY-MM-DDTHH:mm:ss.ssssss format, for example, 2023-06-28T08:56:33.710000.

description

String

Description of the agency.

domain_id

String

ID of the delegating account.

duration

String

Validity period of the agency. Unit: hour.

  • FOREVER/null: The agency has unlimited validity.
  • 24: The agency is valid for 24 hours.
  • XXX: The agency has limited validity of, for example, 480 hours.

expire_time

String

Agency expiration time. null indicates that the agency has unlimited validity.

NOTE:

The value is a UTC time in the YYYY-MM-DDTHH:mm:ss.ssssss format, for example, 2023-06-28T08:56:33.710000.

id

String

Agency ID.

name

String

Agency name.

trust_domain_id

String

ID of the delegated account.

Example Request

Request for creating an agency named IAMAgency with an unlimited validity period for the delegated account whose ID is c2cd82a33fb043dc9304bf72a... and whose name is IAMDomainB

POST https://iam.myhuaweicloud.com/v3.0/OS-AGENCY/agencies
{
    "agency": {
        "name": "IAMAgency",
        "domain_id": "d78cbac186b744899480f25bd...",
        "trust_domain_id": "c2cd82a33fb043dc9304bf72a...",
        "trust_domain_name": "IAMDomainB",
        "duration": "FOREVER",
        "description": "IAMDescription"
    }
}

Example Response

Status code: 201

The agency is created successfully.

{
    "agency": {
        "description": "IAMDescription",
        "trust_domain_id": "a2cd82a33fb043dc9304bf72a0f...",
        "id": "078ade0fc20010004f8fc0034fad529d",
        "duration": "FOREVER",
        "create_time": "2020-01-20T12:59:20.811642",
        "expire_time": null,
        "domain_id": "d78cbac186b744899480f25bd02...",
        "name": "IAMAgency"
    }
}

Status Codes

Status Code

Description

201

The agency is created successfully.

400

Invalid parameters.

401

Authentication failed.

403

Access denied.

404

The requested resource cannot be found.

409

A resource conflict occurs.

500

Internal server error.

Error Codes

None

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