Policy
A Policy is a resource managing page access permissions. This resource can be used in all domains if it is defined in the `repository` microservice.
Package : spaceone.api.repository.v1
Policy
create
POST /repository/v1/policies
Creates a new Policy. The parameter
policy_id, an identifier of Policy resources, can only include lowercase alphabets, numbers, and hyphens(-). The parameterpermissionsis a list type data describing page access permissions.
Request
Response
{
"policy_id": "policy-custom-full-acess",
"name": "Full Access",
"permissions": [
"*"
],
"labels": [],
"tags": {},
"domain_id": "domain-123456789012"
}{
"policy_id": "policy-custom-full-acess",
"name": "Full Access",
"state": "ENABLED",
"permissions": [
"*"
],
"labels": [],
"tags": {},
"repository_info": {
"repository_id": "repo-123456789012",
"name": "Local",
"repository_type": "local"
},
"domain_id": "domain-123456789012",
"created_at": "2022-01-01T06:45:04.582Z",
"updated_at": "2022-01-01T06:45:04.582Z"
}update
PUT /repository/v1/policy/{policy}
Updates a specific Policy. You can make changes in Policy settings, including
name,labels,tags, andpermissions. The parameterpolicy_idcannot be updated.
Request
Response
{
"policy_id": "policy-custom-full-acess",
"name": "Full Access",
"permissions": [
"*"
],
"labels": [],
"tags": {},
"domain_id": "domain-123456789012"
}{
"policy_id": "policy-custom-full-acess",
"name": "Full Access",
"state": "ENABLED",
"permissions": [
"*"
],
"labels": [],
"tags": {},
"repository_info": {
"repository_id": "repo-123456789012",
"name": "Local",
"repository_type": "local"
},
"domain_id": "domain-123456789012",
"created_at": "2022-01-01T06:45:04.582Z",
"updated_at": "2022-01-01T06:45:04.582Z"
}delete
DELETE /repository/v1/policy/{policy}
Deletes a specific Policy. You must specify the
policy_idof the Policy to delete, as thepolicy_idis an identifier of Policy resources.
Request
Response
{
"policy_id": "policy-123456789012"
}get
GET /repository/v1/policies/{policy}
Gets a specific Policy. You must specify the
policy_idof the Policy to get, as thepolicy_idis an identifier of Policy resources. You can use the parameterrepository_idto limit the scope of the method to a specific Repository.
Request
Response
{
"policy_id": "policy-123456789012",
"repository_id": "repo-123456789012"
}{
"policy_id": "policy-123456789012",
"name": "Full Access",
"state": "ENABLED",
"permissions": [
"*"
],
"labels": [],
"tags": {},
"repository_info": {
"repository_id": "repo-123456789012",
"name": "Local",
"repository_type": "local"
},
"domain_id": "domain-123456789012",
"created_at": "2022-01-01T15:42:50.943Z",
"updated_at": "2022-01-01T15:42:50.943Z"
}list
GET /repository/v1/policies
POST /repository/v1/policies/search
Gets a list of all Policies in a specific Repository. The parameter
repository_idis used as an identifier of a Repository to get its list of Policies. You can use a query to get a filtered list of Policies.
Request
Response
{
"query": {},
"repository_id": "repo-123456789012"
}{
"results": [
{
"policy_id": "policy-123456789012",
"name": "Full Access",
"state": "ENABLED",
"permissions": [
"*"
],
"labels": [],
"tags": {},
"repository_info": {
"repository_id": "repo-123456789012",
"name": "Local",
"repository_type": "local"
},
"domain_id": "domain-123456789012",
"created_at": "2022-01-01T15:42:50.943Z",
"updated_at": "2022-01-01T15:42:50.943Z"
},
{
"policy_id": "policy-987654321098",
"name": "Identity Admin",
"state": "ENABLED",
"permissions": [
"identity.*"
],
"labels": [],
"tags": {},
"repository_info": {
"repository_id": "repo-123456789012",
"name": "Local",
"repository_type": "local"
},
"domain_id": "domain-123456789012",
"created_at": "2022-01-01T08:08:14.756Z",
"updated_at": "2022-01-01T08:08:14.756Z"
}
],
"total_count": 2
}stat
POST /repository/v1/policies/stat
Request
Response
Message
CreatePolicyRequest
name
string
✔
permissions
list of string
✔
policy_id
string
✔
project_id
string
✘
domain_id
string
✔
GetRepositoryPolicyRequest
policy_id
string
✔
domain_id
string
✔
repository_id
string
✘
only
list of string
✘
PoliciesInfo
PolicyInfo
policy_id
string
name
string
state
NONE
ENABLED
DISABLED
permissions
list of string
list of permissions
project_id
string
domain_id
string
created_at
string
updated_at
string
PolicyQuery
policy_id
string
✘
name
string
✘
project_id
string
✘
repository_id
string
✔
domain_id
string
✔
state
NONE
ENABLED
DISABLED
✘
PolicyRequest
policy_id
string
✔
domain_id
string
✔
PolicyStatQuery
UpdatePolicyRequest
policy_id
string
✔
name
string
✘
permissions
list of string
✘
domain_id
string
✔
Last updated
Was this helpful?