ocm

package
v1.5.13 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: Apache-2.0 Imports: 9 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

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