Gets a policy
GEThttps://apis.<domain>/iam/policies/:id
Returns the details for a policy.
Authorization Action:
iam:policies:get
Request
Path Parameters
id stringrequired
ID of the policy.
Responses
- 200
- default
A successful response.
- application/json
- Schema
- Example (auto)
Schema
policy object
{
"name": "My Viewer Policy",
"id": "custom-viewer-policy",
"members": [
"team:local:*"
],
"statements": [
{
"role": "viewer",
"tenants": [
"tenant1",
"tenant2"
],
"effect": "ALLOW"
},
{
"role": "myRole",
"tenants": [
"exampleTenant"
],
"effect": "ALLOW"
}
],
"tenants": []
}
An unexpected error response.
- application/json
- Schema
- Example (auto)
Schema
codeinteger<int32>
messagestring
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://apis.<domain>/iam/policies/:id");
request.Headers.Add("Accept", "application/json");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());