All URIs are relative to https://api.aptible.com
Method | HTTP request | Description |
---|---|---|
CreatePermission | Post /accounts/{account_id}/permissions | create permission |
DeletePermission | Delete /permissions/{id} | delete permission |
GetPermission | Get /permissions/{id} | show permission |
ListPermissions | Get /permissions | list permissions |
ListPermissionsForAccount | Get /accounts/{account_id}/permissions | list permissions |
Permission CreatePermission(ctx, accountId).CreatePermissionRequest(createPermissionRequest).Execute()
create permission
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/aptible/aptible-api-go/aptibleapi"
)
func main() {
accountId := int32(56) // int32 | account_id
createPermissionRequest := *openapiclient.NewCreatePermissionRequest("Role_example", "Scope_example") // CreatePermissionRequest | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.PermissionsAPI.CreatePermission(context.Background(), accountId).CreatePermissionRequest(createPermissionRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `PermissionsAPI.CreatePermission``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreatePermission`: Permission
fmt.Fprintf(os.Stdout, "Response from `PermissionsAPI.CreatePermission`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
accountId | int32 | account_id |
Other parameters are passed through a pointer to a apiCreatePermissionRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
createPermissionRequest | CreatePermissionRequest | |
- Content-Type: application/json
- Accept: application/hal+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeletePermission(ctx, id).Execute()
delete permission
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/aptible/aptible-api-go/aptibleapi"
)
func main() {
id := int32(56) // int32 | id
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.PermissionsAPI.DeletePermission(context.Background(), id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `PermissionsAPI.DeletePermission``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | int32 | id |
Other parameters are passed through a pointer to a apiDeletePermissionRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
(empty response body)
- Content-Type: Not defined
- Accept: application/hal+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Permission GetPermission(ctx, id).Execute()
show permission
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/aptible/aptible-api-go/aptibleapi"
)
func main() {
id := int32(56) // int32 | id
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.PermissionsAPI.GetPermission(context.Background(), id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `PermissionsAPI.GetPermission``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetPermission`: Permission
fmt.Fprintf(os.Stdout, "Response from `PermissionsAPI.GetPermission`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | int32 | id |
Other parameters are passed through a pointer to a apiGetPermissionRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/hal+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListPermissionsForAccount200Response ListPermissions(ctx).Page(page).Execute()
list permissions
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/aptible/aptible-api-go/aptibleapi"
)
func main() {
page := int32(56) // int32 | current page of results for pagination (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.PermissionsAPI.ListPermissions(context.Background()).Page(page).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `PermissionsAPI.ListPermissions``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListPermissions`: ListPermissionsForAccount200Response
fmt.Fprintf(os.Stdout, "Response from `PermissionsAPI.ListPermissions`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiListPermissionsRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
page | int32 | current page of results for pagination |
ListPermissionsForAccount200Response
- Content-Type: Not defined
- Accept: application/hal+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListPermissionsForAccount200Response ListPermissionsForAccount(ctx, accountId).Page(page).Execute()
list permissions
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/aptible/aptible-api-go/aptibleapi"
)
func main() {
accountId := int32(56) // int32 | account_id
page := int32(56) // int32 | current page of results for pagination (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.PermissionsAPI.ListPermissionsForAccount(context.Background(), accountId).Page(page).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `PermissionsAPI.ListPermissionsForAccount``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListPermissionsForAccount`: ListPermissionsForAccount200Response
fmt.Fprintf(os.Stdout, "Response from `PermissionsAPI.ListPermissionsForAccount`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
accountId | int32 | account_id |
Other parameters are passed through a pointer to a apiListPermissionsForAccountRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
page | int32 | current page of results for pagination |
ListPermissionsForAccount200Response
- Content-Type: Not defined
- Accept: application/hal+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]