api

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InstanceStatusCreating      string = "creating"
	InstanceStatusDestroying    string = "destroying"
	InstanceStatusRunning       string = "running"
	InstanceStatusPausing       string = "pausing"
	InstanceStatusPaused        string = "paused"
	InstanceStatusSuspending    string = "suspending"
	InstanceStatusSuspended     string = "suspended"
	InstanceStatusResuming      string = "resuming"
	InstanceStatusLoading       string = "loading"
	InstanceStatusLoadingFailed string = "loading failed"
	InstanceStatusRestoring     string = "restoring"
	InstanceStatusUpdating      string = "updating"
	InstanceStatusOverwriting   string = "overwriting"
)
View Source
const (
	SnapshotStatusPending    string = "Pending"
	SnapshotStatusCompleted  string = "Completed"
	SnapshotStatusInProgress string = "InProgress"
	SnapshotStatusFailed     string = "Failed"
)
View Source
const (
	CMKStatusReady   = "ready"
	CMKStatusPending = "pending"
)
View Source
const (
	GraphQLDataApiStatusReady    = "ready"
	GraphQLDataApiStatusCreating = "creating"
	GraphQLDataApiStatusUpdating = "updating"
	GraphQLDataApiStatusDeleting = "deleting"
	GraphQLDataApiStatusPausing  = "pausing"
	GraphQLDataApiStatusResuming = "resuming"
	GraphQLDataApiStatusPaused   = "paused"
	GraphQLDataApiStatusError    = "error"
)
View Source
const (
	GraphQLDataApiAuthProviderTypeJwks   = "jwks"
	GraphQLDataApiAuthProviderTypeApiKey = "api-key"
)

Variables

This section is empty.

Functions

func MakeRequest

func MakeRequest(cfg *clicfg.Config, path string, config *RequestConfig) (responseBody []byte, statusCode int, err error)

Types

type CreateCMKResponse

type CreateCMKResponse struct {
	Data struct {
		Id     string
		Status string
	}
}

Response Body of Create and Get Instance for successful requests

type CreateGraphQLDataApiResponse

type CreateGraphQLDataApiResponse struct {
	Data struct {
		Id                      string
		Name                    string
		Status                  string
		Url                     string
		AuthenticationProviders []struct {
			Id      string
			Name    string
			Type    string
			Enabled bool
			Key     string `json:"key,omitempty"`
			Url     string `json:"url,omitempty"`
		} `json:"authentication_providers"`
	}
}

Response Body of Create GraphQL Data API for successful requests

type CreateInstanceResponse

type CreateInstanceResponse struct {
	Data struct {
		Id            string
		ConnectionUrl string `json:"connection_url"`
		Username      string
		Password      string
		TenantId      string `json:"tenant_id"`
		CloudProvider string `json:"cloud_provider"`
		Region        string
		Type          string
		Name          string
	}
}

Response Body of Create and Get Instance for successful requests

type CreateSnapshotResponse

type CreateSnapshotResponse struct {
	Data struct {
		SnapshotId string `json:"snapshot_id"`
	}
}

Response Body of Create and Get Instance for successful requests

type Error

type Error struct {
	Message string `json:"message"`
	Reason  string `json:"reason"`
	Field   string `json:"field"`
}

type ErrorResponse

type ErrorResponse struct {
	Errors []Error `json:"errors"`
}

type Grant

type Grant struct {
	AccessToken string `json:"access_token"`
	ExpiresIn   int64  `json:"expires_in"`
}

type ListResponseData

type ListResponseData struct {
	Data []map[string]any `json:"data"`
}

func (ListResponseData) AsArray

func (d ListResponseData) AsArray() []map[string]any

func (ListResponseData) GetSingleOrError

func (d ListResponseData) GetSingleOrError() (map[string]any, error)

type PollResponse

type PollResponse struct {
	Data struct {
		Id     string
		Status string
	}
}

func Poll

func Poll(cfg *clicfg.Config, url string, cond func(status string) bool) (*PollResponse, error)

func PollCMK

func PollCMK(cfg *clicfg.Config, cmkId string) (*PollResponse, error)

func PollGraphQLDataApi

func PollGraphQLDataApi(cfg *clicfg.Config, instanceId string, graphQLDataApiId string, waitingStatus string) (*PollResponse, error)

func PollInstance

func PollInstance(cfg *clicfg.Config, instanceId string, waitingStatus string) (*PollResponse, error)

func PollSnapshot

func PollSnapshot(cfg *clicfg.Config, instanceId string, snapshotId string) (*PollResponse, error)

type RequestConfig

type RequestConfig struct {
	Method      string
	PostBody    map[string]any
	QueryParams map[string]string
}

type ResponseData

type ResponseData interface {
	AsArray() []map[string]any
	GetSingleOrError() (map[string]any, error)
}

func NewResponseData

func NewResponseData(data []map[string]any) ResponseData

func NewSingleValueResponseData

func NewSingleValueResponseData(data map[string]any) ResponseData

func ParseBody

func ParseBody(body []byte) ResponseData

type ServerError

type ServerError struct {
	Error string `json:"error"`
}

type SingleValueResponseData

type SingleValueResponseData struct {
	Data   map[string]any   `json:"data"`
	Errors []map[string]any `json:"errors,omitempty"`
}

func (SingleValueResponseData) AsArray

func (d SingleValueResponseData) AsArray() []map[string]any

func (SingleValueResponseData) GetSingleOrError

func (d SingleValueResponseData) GetSingleOrError() (map[string]any, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL