All URIs are relative to https://api.opal.dev/v1
| Method | HTTP request | Description |
|---|---|---|
| AddGroupTag | Post /tags/{tag_id}/groups/{group_id} | |
| AddResourceTag | Post /tags/{tag_id}/resources/{resource_id} | |
| AddUserTag | Post /tags/{tag_id}/users/{user_id} | |
| CreateTag | Post /tag | |
| DeleteTagByID | Delete /tag/{tag_id} | |
| GetTag | Get /tag | |
| GetTagByID | Get /tag/{tag_id} | Get tag by ID |
| GetTags | Get /tags | Get tags |
| RemoveGroupTag | Delete /tags/{tag_id}/groups/{group_id} | |
| RemoveResourceTag | Delete /tags/{tag_id}/resources/{resource_id} | |
| RemoveUserTag | Delete /tags/{tag_id}/users/{user_id} |
AddGroupTag(ctx, tagId, groupId).Execute()
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/opalsecurity/opal-go"
)
func main() {
tagId := "1b978423-db0a-4037-a4cf-f79c60cb67b3" // string | The ID of the tag to apply.
groupId := "1b978423-db0a-4037-a4cf-f79c60cb67b3" // string | The ID of the group to apply the tag to.
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.TagsAPI.AddGroupTag(context.Background(), tagId, groupId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TagsAPI.AddGroupTag``: %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. | |
| tagId | string | The ID of the tag to apply. | |
| groupId | string | The ID of the group to apply the tag to. |
Other parameters are passed through a pointer to a apiAddGroupTagRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
(empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
AddResourceTag(ctx, tagId, resourceId).Execute()
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/opalsecurity/opal-go"
)
func main() {
tagId := "1b978423-db0a-4037-a4cf-f79c60cb67b3" // string | The ID of the tag to apply.
resourceId := "1b978423-db0a-4037-a4cf-f79c60cb67b3" // string | The ID of the resource to apply the tag to.
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.TagsAPI.AddResourceTag(context.Background(), tagId, resourceId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TagsAPI.AddResourceTag``: %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. | |
| tagId | string | The ID of the tag to apply. | |
| resourceId | string | The ID of the resource to apply the tag to. |
Other parameters are passed through a pointer to a apiAddResourceTagRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
(empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
AddUserTag(ctx, tagId, userId).Body(body).Execute()
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/opalsecurity/opal-go"
)
func main() {
tagId := "1b978423-db0a-4037-a4cf-f79c60cb67b3" // string | The ID of the tag to apply.
userId := "1b978423-db0a-4037-a4cf-f79c60cb67b3" // string | The ID of the user to apply the tag to.
body := map[string]interface{}{ ... } // map[string]interface{} | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.TagsAPI.AddUserTag(context.Background(), tagId, userId).Body(body).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TagsAPI.AddUserTag``: %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. | |
| tagId | string | The ID of the tag to apply. | |
| userId | string | The ID of the user to apply the tag to. |
Other parameters are passed through a pointer to a apiAddUserTagRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
body | map[string]interface{} | |
(empty response body)
- Content-Type: application/json
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Tag CreateTag(ctx).TagKey(tagKey).TagValue(tagValue).AdminOwnerId(adminOwnerId).CreateTagInfo(createTagInfo).Execute()
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/opalsecurity/opal-go"
)
func main() {
tagKey := "api-scope" // string | The key of the tag to create. (optional)
tagValue := "production" // string | The value of the tag to create. (optional)
adminOwnerId := "f92aa855-cea9-4814-b9d8-f2a60d3e4a06" // string | The ID of the owner that manages the tag. (optional)
createTagInfo := *openapiclient.NewCreateTagInfo("api-scope") // CreateTagInfo | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.TagsAPI.CreateTag(context.Background()).TagKey(tagKey).TagValue(tagValue).AdminOwnerId(adminOwnerId).CreateTagInfo(createTagInfo).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TagsAPI.CreateTag``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateTag`: Tag
fmt.Fprintf(os.Stdout, "Response from `TagsAPI.CreateTag`: %v\n", resp)
}Other parameters are passed through a pointer to a apiCreateTagRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| tagKey | string | The key of the tag to create. | |
| tagValue | string | The value of the tag to create. | |
| adminOwnerId | string | The ID of the owner that manages the tag. | |
| createTagInfo | CreateTagInfo |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteTagByID(ctx, tagId).Execute()
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/opalsecurity/opal-go"
)
func main() {
tagId := "1b978423-db0a-4037-a4cf-f79c60cb67b3" // string | The tag ID
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.TagsAPI.DeleteTagByID(context.Background(), tagId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TagsAPI.DeleteTagByID``: %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. | |
| tagId | string | The tag ID |
Other parameters are passed through a pointer to a apiDeleteTagByIDRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
(empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Tag GetTag(ctx).TagKey(tagKey).TagValue(tagValue).Execute()
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/opalsecurity/opal-go"
)
func main() {
tagKey := "api-scope" // string | The key of the tag to get.
tagValue := "production" // string | The value of the tag to get. (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.TagsAPI.GetTag(context.Background()).TagKey(tagKey).TagValue(tagValue).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TagsAPI.GetTag``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetTag`: Tag
fmt.Fprintf(os.Stdout, "Response from `TagsAPI.GetTag`: %v\n", resp)
}Other parameters are passed through a pointer to a apiGetTagRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| tagKey | string | The key of the tag to get. | |
| tagValue | string | The value of the tag to get. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Tag GetTagByID(ctx, tagId).Execute()
Get tag by ID
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/opalsecurity/opal-go"
)
func main() {
tagId := "1b978423-db0a-4037-a4cf-f79c60cb67b3" // string | The tag ID
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.TagsAPI.GetTagByID(context.Background(), tagId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TagsAPI.GetTagByID``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetTagByID`: Tag
fmt.Fprintf(os.Stdout, "Response from `TagsAPI.GetTagByID`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| tagId | string | The tag ID |
Other parameters are passed through a pointer to a apiGetTagByIDRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PaginatedTagsList GetTags(ctx).Cursor(cursor).PageSize(pageSize).Execute()
Get tags
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/opalsecurity/opal-go"
)
func main() {
cursor := "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw" // string | The pagination cursor value. (optional)
pageSize := int32(200) // int32 | Number of results to return per page. Default is 200. (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.TagsAPI.GetTags(context.Background()).Cursor(cursor).PageSize(pageSize).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TagsAPI.GetTags``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetTags`: PaginatedTagsList
fmt.Fprintf(os.Stdout, "Response from `TagsAPI.GetTags`: %v\n", resp)
}Other parameters are passed through a pointer to a apiGetTagsRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| cursor | string | The pagination cursor value. | |
| pageSize | int32 | Number of results to return per page. Default is 200. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RemoveGroupTag(ctx, tagId, groupId).Execute()
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/opalsecurity/opal-go"
)
func main() {
tagId := "1b978423-db0a-4037-a4cf-f79c60cb67b3" // string | The ID of the tag to remove.
groupId := "1b978423-db0a-4037-a4cf-f79c60cb67b3" // string | The ID of the group to remove the tag from.
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.TagsAPI.RemoveGroupTag(context.Background(), tagId, groupId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TagsAPI.RemoveGroupTag``: %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. | |
| tagId | string | The ID of the tag to remove. | |
| groupId | string | The ID of the group to remove the tag from. |
Other parameters are passed through a pointer to a apiRemoveGroupTagRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
(empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RemoveResourceTag(ctx, tagId, resourceId).Execute()
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/opalsecurity/opal-go"
)
func main() {
tagId := "1b978423-db0a-4037-a4cf-f79c60cb67b3" // string | The ID of the tag to remove.
resourceId := "1b978423-db0a-4037-a4cf-f79c60cb67b3" // string | The ID of the resource to remove the tag from.
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.TagsAPI.RemoveResourceTag(context.Background(), tagId, resourceId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TagsAPI.RemoveResourceTag``: %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. | |
| tagId | string | The ID of the tag to remove. | |
| resourceId | string | The ID of the resource to remove the tag from. |
Other parameters are passed through a pointer to a apiRemoveResourceTagRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
(empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RemoveUserTag(ctx, tagId, userId).Execute()
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/opalsecurity/opal-go"
)
func main() {
tagId := "1b978423-db0a-4037-a4cf-f79c60cb67b3" // string | The ID of the tag to remove.
userId := "1b978423-db0a-4037-a4cf-f79c60cb67b3" // string | The ID of the user to remove the tag from.
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.TagsAPI.RemoveUserTag(context.Background(), tagId, userId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TagsAPI.RemoveUserTag``: %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. | |
| tagId | string | The ID of the tag to remove. | |
| userId | string | The ID of the user to remove the tag from. |
Other parameters are passed through a pointer to a apiRemoveUserTagRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
(empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]