api

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: Apache-2.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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"
)
View Source
const (
	GraphAnalyticsSessionInitial  = ""
	GraphAnalyticsSessionCreating = "Creating"
	GraphAnalyticsSessionReady    = "Ready"
	GraphAnalyticsSessionExpired  = "Expired"
	GraphAnalyticsSessionFailed   = "Failed"
)

Variables

View Source
var GraphAnalyticsSessionWaitingStatus = []string{
	GraphAnalyticsSessionCreating,
	GraphAnalyticsSessionInitial,
}

Functions

func IsSuccessful added in v1.5.0

func IsSuccessful(statusCode int) bool

Checks status code is 2xx

func MakeRequest

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

Types

type AuraApiVersion added in v1.3.1

type AuraApiVersion string
const (
	AuraApiVersion1 AuraApiVersion = "1"
	AuraApiVersion2 AuraApiVersion = "2"
)

type CreateCMKResponse

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

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"`
	}
}

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
	}
}

type CreateSnapshotResponse

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

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 PollGraphAnalyticsSessionReady added in v1.3.0

func PollGraphAnalyticsSessionReady(cfg *clicfg.Config, sessionId string, waitingStatus []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 {
	Version     AuraApiVersion
	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 NewListResponseData added in v1.4.0

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

func NewSingleValueResponseData

func NewSingleValueResponseData(data map[string]any) ResponseData

func ParseBody

func ParseBody(body []byte) ResponseData

func ParseRawBody added in v1.8.0

func ParseRawBody(body []byte) ResponseData

ParseRawBody parses a bare JSON array or object (no {"data":...} envelope).

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