CreateResourceMember - Add a resource member
Add a resource member using OpenAPI.
|
Applicable editions |
Central edition, Region edition |
Endpoint and authorization information
- Obtain an endpoint to replace the {domain} placeholder in the request syntax.
- Obtain a personal access token.
- Obtain the organizationId from the Basic Information page in the Organization Management console. Required only for the Central edition.
|
Product |
Resource |
Required permission |
|
Pipeline |
Resource member |
Read and write |
Request syntax
Central edition
POST https://{domain}/oapi/v1/flow/organizations/{organizationId}/resourceMembers/resourceTypes/{resourceType}/resourceIds/{resourceId}
Region edition
POST https://{domain}/oapi/v1/flow/resourceMembers/resourceTypes/{resourceType}/resourceIds/{resourceId}
Request headers
|
Parameter |
Type |
Required |
Description |
Example |
|
x-yunxiao-token |
string |
Yes |
Personal access token. |
pt-0fh3****0fbG_35af****0484 |
Request parameters
|
Parameter |
Type |
Location |
Required |
Description |
Example |
|
organizationId |
string |
path |
|
The organization ID. |
5ebbc0228123212b59xxxxx |
|
resourceType |
string |
path |
Yes |
The type of resource. Valid values: `pipeline` and `hostGroup`. |
pipeline |
|
resourceId |
string |
path |
Yes |
The resource ID. |
123 |
|
roleName |
string |
query |
Yes |
The role to assign. For a hostGroup: `user` (use), `admin` (use and edit), or `owner` (all permissions). For a pipeline: `owner` (all permissions), `admin` (view, run, and edit), `member` (run), or `viewer` (view). |
admin |
|
userId |
string |
query |
Yes |
The user ID. |
2211221 |
Request examples
Central edition
curl -X 'POST' \
'https://{domain}/oapi/v1/flow/organizations/5ebbc0228123212b59xxxxx/resourceMembers/resourceTypes/pipeline/resourceIds/123?roleName=admin&userId=2211221' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'
Region edition
curl -X 'POST' \
'https://{domain}/oapi/v1/flow/resourceMembers/resourceTypes/pipeline/resourceIds/123?roleName=admin&userId=2211221' \
-H 'Content-Type: application/json' \
-H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'
Response parameters
|
Parameter |
Type |
Description |
Example |
|
- |
boolean |
Whether the request was successful. |
true |
Response example
true
Error codes
For API error codes, see Error Code Center.