client

package
v0.0.0-...-a17ed59 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const HostURL string = "http://localhost:8000"

HostURL - Default ADCM URL

View Source
const MaxPostSize = 10 * 1024 * 1024

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthResponse

type AuthResponse struct {
	UserID   int    `json:"user_id"`
	Username string `json:"username"`
	Token    string `json:"token"`
}

AuthResponse -

type AuthStruct

type AuthStruct struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

AuthStruct -

type Bundle

type Bundle struct {
	BundleSearch
}

type BundleSearch

type BundleSearch struct {
	Identifier
	Name        string `json:"name"`
	DisplayName string `json:"display_name"`
	Description string `json:"description"`
	Edition     string `json:"edition"`
	License     string `json:"license"`
	Version     string `json:"version"`
}

type Client

type Client struct {
	HostURL    string
	HTTPClient *http.Client
	Token      string
	Auth       AuthStruct
}

Client -

func NewClient

func NewClient(url, username, password *string) (*Client, error)

NewClient -

func (*Client) ClusterAction

func (c *Client) ClusterAction(cluster ClusterSearch, actionName string, wait bool) error

ClusterAction - run action on cluster

func (*Client) CreateCluster

func (c *Client) CreateCluster(cluster Cluster) (*Cluster, error)

CreateCluster - create cluster

func (*Client) CreateHost

func (c *Client) CreateHost(host Host) (*Host, error)

CreateHost - create host

func (*Client) CreateProvider

func (c *Client) CreateProvider(provider Provider) (*Provider, error)

CreateProvider - create provider

func (*Client) DeleteBundle

func (c *Client) DeleteBundle(searchOpts BundleSearch) error

DeleteBundle - Delete bundle

func (*Client) DeleteCluster

func (c *Client) DeleteCluster(cluster ClusterSearch) error

DeleteCluster - delete cluster

func (*Client) DeleteHost

func (c *Client) DeleteHost(host HostSearch) error

DeleteHost - create host

func (*Client) DeleteProvider

func (c *Client) DeleteProvider(provider ProviderSearch) error

DeleteProvider - create host

func (*Client) GetBundle

func (c *Client) GetBundle(searchOpts BundleSearch) (*Bundle, error)

GetBundle - Returns bundle

func (*Client) GetBundles

func (c *Client) GetBundles() ([]Bundle, error)

GetBundles - Returns list of bundles

func (*Client) GetCluster

func (c *Client) GetCluster(searchOpts ClusterSearch) (*Cluster, error)

GetCluster - get cluster

func (*Client) GetClusters

func (c *Client) GetClusters() ([]Cluster, error)

GetClusters - list clusters

func (*Client) GetHost

func (c *Client) GetHost(searchOpts HostSearch) (*Host, error)

GetHost - get host

func (*Client) GetHosts

func (c *Client) GetHosts() ([]Host, error)

GetHosts - list host

func (*Client) GetProvider

func (c *Client) GetProvider(searchOpts ProviderSearch) (*Provider, error)

GetProvider - Returns provider

func (*Client) GetProviders

func (c *Client) GetProviders() ([]Provider, error)

GetProviders - Returns list of providers

func (*Client) SignIn

func (c *Client) SignIn() (*AuthResponse, error)

SignIn - Get a new token for user

func (*Client) UploadBundle

func (c *Client) UploadBundle(url string) (*Bundle, error)

type Cluster

type Cluster struct {
	ClusterResponse
	ServicesConfig ServiceConfigResponse
	ClusterConfig  ClusterConfigResponse
	HCMap          map[string][]map[string][]string `json:"hc_map"`
	State          string                           `json:"state"`
}

type ClusterConfigResponse

type ClusterConfigResponse struct {
	Config map[string]interface{} `json:"config"`
}

type ClusterResponse

type ClusterResponse struct {
	ClusterSearch
}

type ClusterSearch

type ClusterSearch struct {
	Identifier
	Name        string `json:"name"`
	Description string `json:"description"`
	BundleID    int64  `json:"bundle_id"`
}

type Component

type Component struct {
	Identifier
	Name string `json:"name"`
}

type Host

type Host struct {
	HostResponse
	HostConfigResponse
}

type HostConfigResponse

type HostConfigResponse struct {
	Config map[string]interface{} `json:"config"`
}

type HostResponse

type HostResponse struct {
	HostSearch
}

type HostSearch

type HostSearch struct {
	Identifier
	FQDN        string `json:"fqdn"`
	Description string `json:"description"`
	ProviderID  int64  `json:"provider_id"`
	ClusterID   int64  `json:"cluster_id"`
}

type Identifier

type Identifier struct {
	ID int64 `json:"id"`
}

type Provider

type Provider struct {
	ProviderSearch
	ProviderConfig ProviderConfigResponse
}

type ProviderConfigResponse

type ProviderConfigResponse struct {
	Config map[string]interface{} `json:"config"`
}

type ProviderSearch

type ProviderSearch struct {
	Identifier
	Name        string `json:"name"`
	BundleID    int64  `json:"bundle_id"`
	Description string `json:"description"`
	State       string `json:"state"`
}

type ServiceConfigResponse

type ServiceConfigResponse struct {
	Config map[string]interface{} `json:"config"`
	Attr   map[string]interface{} `json:"attr"`
}

type TaskResponse

type TaskResponse struct {
	Identifier
	Status string `json:"status"`
}

Jump to

Keyboard shortcuts

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