Skip to content

Latest commit

 

History

History
273 lines (166 loc) · 7.76 KB

File metadata and controls

273 lines (166 loc) · 7.76 KB

\ConfigurationTemplatesAPI

All URIs are relative to https://api.opal.dev/v1

Method HTTP request Description
CreateConfigurationTemplate Post /configuration-templates
DeleteConfigurationTemplate Delete /configuration-templates/{configuration_template_id}
GetConfigurationTemplates Get /configuration-templates
UpdateConfigurationTemplate Put /configuration-templates

CreateConfigurationTemplate

ConfigurationTemplate CreateConfigurationTemplate(ctx).CreateConfigurationTemplateInfo(createConfigurationTemplateInfo).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/opalsecurity/opal-go"
)

func main() {
	createConfigurationTemplateInfo := *openapiclient.NewCreateConfigurationTemplateInfo("7c86c85d-0651-43e2-a748-d69d658418e8", *openapiclient.NewVisibilityInfo(openapiclient.VisibilityTypeEnum("GLOBAL")), false, false, "Prod AWS Template") // CreateConfigurationTemplateInfo | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.ConfigurationTemplatesAPI.CreateConfigurationTemplate(context.Background()).CreateConfigurationTemplateInfo(createConfigurationTemplateInfo).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ConfigurationTemplatesAPI.CreateConfigurationTemplate``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `CreateConfigurationTemplate`: ConfigurationTemplate
	fmt.Fprintf(os.Stdout, "Response from `ConfigurationTemplatesAPI.CreateConfigurationTemplate`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiCreateConfigurationTemplateRequest struct via the builder pattern

Name Type Description Notes
createConfigurationTemplateInfo CreateConfigurationTemplateInfo

Return type

ConfigurationTemplate

Authorization

BearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeleteConfigurationTemplate

DeleteConfigurationTemplate(ctx, configurationTemplateId).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/opalsecurity/opal-go"
)

func main() {
	configurationTemplateId := "4baf8423-db0a-4037-a4cf-f79c60cb67a5" // string | The ID of the configuration template.

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.ConfigurationTemplatesAPI.DeleteConfigurationTemplate(context.Background(), configurationTemplateId).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ConfigurationTemplatesAPI.DeleteConfigurationTemplate``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
configurationTemplateId string The ID of the configuration template.

Other Parameters

Other parameters are passed through a pointer to a apiDeleteConfigurationTemplateRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetConfigurationTemplates

PaginatedConfigurationTemplateList GetConfigurationTemplates(ctx).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/opalsecurity/opal-go"
)

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.ConfigurationTemplatesAPI.GetConfigurationTemplates(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ConfigurationTemplatesAPI.GetConfigurationTemplates``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetConfigurationTemplates`: PaginatedConfigurationTemplateList
	fmt.Fprintf(os.Stdout, "Response from `ConfigurationTemplatesAPI.GetConfigurationTemplates`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiGetConfigurationTemplatesRequest struct via the builder pattern

Return type

PaginatedConfigurationTemplateList

Authorization

BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UpdateConfigurationTemplate

ConfigurationTemplate UpdateConfigurationTemplate(ctx).UpdateConfigurationTemplateInfo(updateConfigurationTemplateInfo).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/opalsecurity/opal-go"
)

func main() {
	updateConfigurationTemplateInfo := *openapiclient.NewUpdateConfigurationTemplateInfo("7c86c85d-0651-43e2-a748-d69d658418e8") // UpdateConfigurationTemplateInfo | Configuration template to be updated

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.ConfigurationTemplatesAPI.UpdateConfigurationTemplate(context.Background()).UpdateConfigurationTemplateInfo(updateConfigurationTemplateInfo).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ConfigurationTemplatesAPI.UpdateConfigurationTemplate``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `UpdateConfigurationTemplate`: ConfigurationTemplate
	fmt.Fprintf(os.Stdout, "Response from `ConfigurationTemplatesAPI.UpdateConfigurationTemplate`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiUpdateConfigurationTemplateRequest struct via the builder pattern

Name Type Description Notes
updateConfigurationTemplateInfo UpdateConfigurationTemplateInfo Configuration template to be updated

Return type

ConfigurationTemplate

Authorization

BearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]