SpaceONE APIs
Latest Version
Latest Version
  • README
  • Board
    • V1
      • Board
      • Post
  • Config
    • V1
      • Domain Config
      • User Config
  • Core
    • V1
      • Handler
      • Query
      • Server Info
  • Cost Analysis
    • Plugin
      • Cost
      • Data Source
      • Job
    • V1
      • Budget
      • Budget Usage
      • Cost
      • Cost Query Set
      • Custom Widget
      • Data Source
      • Data Source Rule
      • Exchange Rate
      • Job
      • Job Task
      • Public Dashboard
      • Schedule
      • User Dashboard
  • Identity
    • Plugin
      • Auth
    • V1
      • Api Key
      • Authorization
      • Domain
      • Domain Owner
      • Endpoint
      • Policy
      • Project
      • Project Group
      • Provider
      • Role
      • Role Binding
      • Service Account
      • Token
      • User
  • Inventory
    • Plugin
      • Collector
    • V1
      • Change History
      • Cloud Service
      • Cloud Service Type
      • Collector
      • Job
      • Job Task
      • Note
      • Region
      • Resource Group
      • Server
  • Monitoring
    • Plugin
      • Data Source
      • Event
      • Log
      • Metric
      • Webhook
    • V1
      • Alert
      • Data Source
      • Escalation Policy
      • Event
      • Event Rule
      • Log
      • Maintenance Window
      • Metric
      • Note
      • Project Alert Config
      • Webhook
  • Notification
    • Plugin
      • Notification
      • Protocol
    • V1
      • Notification
      • Notification Usage
      • Project Channel
      • Protocol
      • Quota
      • User Channel
  • Plugin
    • V1
      • Plugin
      • Supervisor
  • Repository
    • V1
      • Plugin
      • Policy
      • Repository
      • Schema
  • Sample
    • V1
      • Helloworld
  • Secret
    • V1
      • Secret
      • Secret Group
  • Statistics
    • Plugin
      • Storage
    • V1
      • History
      • Resource
      • Schedule
      • Storage
Powered by GitBook
On this page
  • Policy
  • create
  • update
  • delete
  • get
  • list
  • stat
  • Message
  • CreatePolicyRequest
  • GetRepositoryPolicyRequest
  • PoliciesInfo
  • PolicyInfo
  • PolicyQuery
  • PolicyRequest
  • PolicyStatQuery
  • UpdatePolicyRequest

Was this helpful?

  1. Repository
  2. V1

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

Policy Methods:

Method
Request
Response

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 parameter permissions is a list type data describing page access permissions.

Type
Message

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, and permissions. The parameter policy_id cannot be updated.

Type
Message

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_id of the Policy to delete, as the policy_id is an identifier of Policy resources.

Type
Message

Request

Response

{
    "policy_id": "policy-123456789012"
}

get

GET /repository/v1/policies/{policy}

Gets a specific Policy. You must specify the policy_id of the Policy to get, as the policy_id is an identifier of Policy resources. You can use the parameter repository_id to limit the scope of the method to a specific Repository.

Type
Message

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_id is 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.

Type
Message

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

Type
Message

Request

Response

Message

CreatePolicyRequest

Field
Type
Required
Description

name

string

✔

permissions

list of string

✔

policy_id

string

✔

labels

✘

tags

✘

project_id

string

✘

domain_id

string

✔

GetRepositoryPolicyRequest

Field
Type
Required
Description

policy_id

string

✔

domain_id

string

✔

repository_id

string

✘

only

list of string

✘

PoliciesInfo

Field
Type
Description

results

list of PolicyInfo

total_count

PolicyInfo

Field
Type
Description

policy_id

string

name

string

state

  • NONE

  • ENABLED

  • DISABLED

permissions

list of string

list of permissions

labels

list of labels

tags

repository_info

project_id

string

domain_id

string

created_at

string

updated_at

string

PolicyQuery

Field
Type
Required
Description

query

✘

policy_id

string

✘

name

string

✘

project_id

string

✘

repository_id

string

✔

domain_id

string

✔

state

  • NONE

  • ENABLED

  • DISABLED

✘

PolicyRequest

Field
Type
Required
Description

policy_id

string

✔

domain_id

string

✔

PolicyStatQuery

Field
Type
Required
Description

query

✔

repository_id

string

✔

domain_id

string

✔

UpdatePolicyRequest

Field
Type
Required
Description

policy_id

string

✔

name

string

✘

permissions

list of string

✘

labels

✘

tags

✘

domain_id

string

✔

PreviousPluginNextRepository

Last updated 2 years ago

Was this helpful?

google.protobuf.Empty
google.protobuf.Struct
google.protobuf.Empty
google.protobuf.Struct
google.protobuf.ListValue
google.protobuf.Struct
int32
google.protobuf.ListValue
google.protobuf.Struct
spaceone.api.core.v1.Query
spaceone.api.core.v1.StatisticsQuery
google.protobuf.ListValue
google.protobuf.Struct
create
CreatePolicyRequest
PolicyInfo
update
UpdatePolicyRequest
PolicyInfo
delete
PolicyRequest
get
GetRepositoryPolicyRequest
PolicyInfo
list
PolicyQuery
PoliciesInfo
stat
PolicyStatQuery
CreatePolicyRequest
PolicyInfo
UpdatePolicyRequest
PolicyInfo
PolicyRequest
GetRepositoryPolicyRequest
PolicyInfo
PolicyQuery
PoliciesInfo
PolicyStatQuery
list of PolicyInfo
RepositoryInfo