Skip to content
Niu DocsNiu 牛元文档
Dashboard控制台

Grant, change or disable a Provider membership

Generated from the checked-in source. Do not edit this reference by hand.

PUT /api/v1/providers/{provider}/members/{operator}

Requires platform administration. Grants viewer or manager membership to a non-revoked operator. Provider membership grants no platform configuration authority. Membership state and immutable audit are recorded atomically, including the authorized actor, Provider and affected-member names, and active roles before and after the change. Repeated accepted writes can add audit events. Individual transaction lock waits are bounded to 250 ms and statements to 2 seconds; pool acquisition and whole HTTP duration are not bounded by these settings.

Operation: setProviderMembership.

Use the credential and permission scope described above. Each object below is an alternative; schemes within one object are required together.

JSON
[
{
"bearerAuth": []
}
]

Set NIU_ORIGIN to your installation origin (without /v1). Replace path, query and header placeholders with the required values. Query examples use curl 7.87 or newer to encode values with --url-query. Use the credential scope described above; a bearer token must have the authority required by this operation.

Shell
curl --fail-with-body -X PUT "$NIU_ORIGIN/api/v1/providers/{provider}/members/{operator}" \
-H "Authorization: Bearer $NIU_BEARER_TOKEN" \
-H 'Content-Type: application/json' \
--data @request.json

Location: path. Required.

JSON
{
"type": "string",
"format": "uuid"
}

Location: path. Required.

JSON
{
"type": "string",
"format": "uuid"
}

Required.

JSON
{
"type": "object",
"additionalProperties": false,
"required": [
"role",
"active"
],
"properties": {
"role": {
"type": "string",
"enum": [
"manager",
"viewer"
]
},
"active": {
"type": "boolean"
}
}
}

Membership saved and audited

Content type: application/json.

JSON
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"type": "object",
"required": [
"active"
],
"properties": {
"active": {
"type": "boolean"
}
}
}
}
}

Invalid membership role

Missing, expired or revoked administrative credential

Platform administration required

Missing/deleted Provider or missing/revoked operator

Malformed membership input

Storage unavailable or transaction lock/statement timeout

Requires platform administration. Grants viewer or manager membership to a non-revoked operator. Provider membership grants no platform configuration authority. Membership state and immutable audit are recorded atomically, including the authorized actor, Provider and affected-member names, and active roles before and after the change. Repeated accepted writes can add audit events. Individual transaction lock waits are bounded to 250 ms and statements to 2 seconds; pool acquisition and whole HTTP duration are not bounded by these settings.

Supported scope: implemented