ocm

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddOnStatusGetRequest added in v1.7.0

type AddOnStatusGetRequest struct{}

type AddOnStatusPatchRequest added in v1.7.0

type AddOnStatusPatchRequest struct {
	// Correlation ID for co-relating current AddonCR revision and reported status.
	CorrelationID string `json:"correlation_id"`
	// Reported addon status conditions
	StatusConditions []addonsv1alpha1.AddOnStatusCondition `json:"status_conditions"`
}

type AddOnStatusPostRequest added in v1.7.0

type AddOnStatusPostRequest struct {
	AddonID string `json:"addon_id"`
	// Correlation ID for co-relating current AddonCR revision and reported status.
	CorrelationID string `json:"correlation_id"`
	// Reported addon status conditions
	StatusConditions []addonsv1alpha1.AddOnStatusCondition `json:"status_conditions"`
}

type AddOnStatusResponse added in v1.7.0

type AddOnStatusResponse struct {
	Kind    string `json:"kind"`
	AddonID string `json:"addon_id"`
	// Correlation ID for co-relating current AddonCR revision and reported status.
	CorrelationID string `json:"correlation_id"`
	// Reported addon status conditions
	StatusConditions []addonsv1alpha1.AddOnStatusCondition `json:"status_conditions"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(ctx context.Context, opts ...Option) (*Client, error)

Creates a new OCM client with the given options.

func (*Client) GetAddOnStatus added in v1.7.0

func (c *Client) GetAddOnStatus(ctx context.Context, addonID string) (AddOnStatusResponse, error)

func (*Client) GetCluster

func (c *Client) GetCluster(
	ctx context.Context,
	req ClusterGetRequest,
) (res ClusterGetResponse, err error)

func (*Client) GetClusterIDAndName added in v1.12.0

func (c *Client) GetClusterIDAndName() (string, string)

func (*Client) GetUpgradePolicy

func (c *Client) GetUpgradePolicy(
	ctx context.Context,
	req UpgradePolicyGetRequest,
) (res UpgradePolicyGetResponse, err error)

func (*Client) PatchAddOnStatus added in v1.7.0

func (c *Client) PatchAddOnStatus(ctx context.Context, addonID string, payload AddOnStatusPatchRequest) (AddOnStatusResponse, error)

func (*Client) PatchUpgradePolicy

func (c *Client) PatchUpgradePolicy(
	ctx context.Context,
	req UpgradePolicyPatchRequest,
) (res UpgradePolicyPatchResponse, err error)

func (*Client) PostAddOnStatus added in v1.7.0

func (c *Client) PostAddOnStatus(ctx context.Context, payload AddOnStatusPostRequest) (AddOnStatusResponse, error)

type ClientOptions

type ClientOptions struct {
	Endpoint          string
	ClusterExternalID string
	ClusterID         string
	ClusterName       string
	AccessToken       string
}

type Cluster

type Cluster struct {
	Id         string `json:"id"`
	Name       string `json:"name"`
	ExternalId string `json:"external_id"`
}

type ClusterGetRequest

type ClusterGetRequest struct{}

type ClusterGetResponse

type ClusterGetResponse struct {
	Items []Cluster `json:"items"`
}

type OCMError

type OCMError struct {
	StatusCode int    `json:"-"`
	Code       string `json:"code"`
	Reason     string `json:"reason"`
}

func (OCMError) Error

func (e OCMError) Error() string

type Option

type Option func(o *ClientOptions)

func WithAccessToken

func WithAccessToken(accessToken string) Option

func WithClusterExternalID

func WithClusterExternalID(clusterExternalID string) Option

func WithEndpoint

func WithEndpoint(endpoint string) Option

type UpgradePolicyGetRequest

type UpgradePolicyGetRequest struct {
	ID string `json:"id"`
}

type UpgradePolicyGetResponse

type UpgradePolicyGetResponse struct {
	Value       UpgradePolicyValue `json:"value"`
	Description string             `json:"description"`
}

type UpgradePolicyPatchRequest

type UpgradePolicyPatchRequest struct {
	ID          string             `json:"id"`
	Value       UpgradePolicyValue `json:"value"`
	Description string             `json:"description"`
}

type UpgradePolicyPatchResponse

type UpgradePolicyPatchResponse struct{}

type UpgradePolicyValue

type UpgradePolicyValue string
const (
	UpgradePolicyValueNone      UpgradePolicyValue = ""
	UpgradePolicyValuePending   UpgradePolicyValue = "pending"
	UpgradePolicyValueScheduled UpgradePolicyValue = "scheduled"
	UpgradePolicyValueStarted   UpgradePolicyValue = "started"
	UpgradePolicyValueCompleted UpgradePolicyValue = "completed"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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