ocm

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2022 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 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) GetCluster

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

func (*Client) GetUpgradePolicy

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

func (*Client) PatchUpgradePolicy

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

type ClientOptions

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

type Cluster

type Cluster struct {
	Id         string `json:"id"`
	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
	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 (
	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