tanzuclient

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2022 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSCluster added in v0.3.0

type AWSCluster struct {
	Distribution struct {
		ProvisionerCredentialName string `json:"provisionerCredentialName"`
		Region                    string `json:"region"`
		Version                   string `json:"version"`
	} `json:"distribution"`
	Settings struct {
		Network  Network `json:"network"`
		Security struct {
			SshKey string `json:"sshKey"`
		} `json:"security"`
	} `json:"settings"`
	Topology struct {
		ControlPlane struct {
			AvailabilityZones []string `json:"availabilityZones"`
			HighAvailability  bool     `json:"highAvailability,omitempty"`
			InstanceType      string   `json:"instanceType"`
		} `json:"controlPlane"`
	} `json:"topology"`
}

type AccessToken

type AccessToken struct {
	TokenType string `json:"token_type"`
	Token     string `json:"access_token"`
	ExpiresIn int64  `json:"expires_in"`
}

type AllClusterGroups

type AllClusterGroups struct {
	ClusterGroups []ClusterGroup `json:"clusterGroups"`
}

type AllProvisioners added in v0.2.0

type AllProvisioners struct {
	Provisioners []Provisioner `json:"provisioners"`
}

type AllWorkspaces

type AllWorkspaces struct {
	Workspaces []Workspace `json:"workspaces"`
}

type AwsAccessKey added in v0.2.0

type AwsAccessKey struct {
	AccessKeyId     string `json:"aws_access_key_id,omitempty"`
	SecretAccessKey string `json:"aws_secret_access_key,omitempty"`
}

type AwsCredential added in v0.2.0

type AwsCredential struct {
	AccountID string   `json:"accountId,omitempty"`
	IamRole   *IamRole `json:"iamRole,omitempty"`
}

type AwsCredentialKey added in v0.2.0

type AwsCredentialKey struct {
	Type string        `json:"type"`
	Data *AwsAccessKey `json:"data"`
}

type AwsNodePool added in v0.3.0

type AwsNodePool struct {
	NodeLabels      map[string]interface{} `json:"cloudLabels,omitempty"`
	CloudLabels     map[string]interface{} `json:"nodeLabels,omitempty"`
	WorkerNodeCount string                 `json:"workerNodeCount"`
	NodeTkgAws      AwsNodeSpec            `json:"tkgAws"`
}

type AwsNodeSpec added in v0.3.0

type AwsNodeSpec struct {
	InstanceType     string `json:"instanceType"`
	AvailabilityZone string `json:"availabilityZone"`
	Version          string `json:"version"`
}

type Client

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

Client is a client for working with the TMC Web API. It is created by `NewClient`.

func NewClient

func NewClient(url, apiToken *string) (*Client, error)

func (*Client) CreateAwsAccountCredential added in v0.2.0

func (c *Client) CreateAwsAccountCredential(cred *TmcAwsAccountCredential) (*TmcAwsAccountCredential, error)

func (*Client) CreateAwsCredential added in v0.2.0

func (c *Client) CreateAwsCredential(cred *TmcAwsCredential) (*TmcAwsCredential, error)

func (*Client) CreateCluster added in v0.3.0

func (c *Client) CreateCluster(name string, managementClusterName string, provisionerName string, cluster_group string, description string, labels map[string]interface{}, opts *ClusterOpts) (*Cluster, error)

func (*Client) CreateClusterBackup added in v0.3.0

func (c *Client) CreateClusterBackup(clusterName string, backup *TmcClusterBackup) (*TmcClusterBackup, error)

func (*Client) CreateClusterGroup

func (c *Client) CreateClusterGroup(name string, description string, labels map[string]interface{}) (*ClusterGroup, error)

Create a new Cluster Group with a given name. Also accepts a description for the Cluster Group and a set of labels to be added to the Cluster Group

func (*Client) CreateMgmtCluster added in v0.4.0

func (c *Client) CreateMgmtCluster(name string, defaultCg string, k8sProviderType string, description string, labels map[string]interface{}) (*ManagementCluster, error)

func (*Client) CreateNamespace added in v0.4.0

func (c *Client) CreateNamespace(name string, opts NamespaceOpts) (*Namespace, error)

func (*Client) CreateNodePool added in v0.3.0

func (c *Client) CreateNodePool(name string, managementClusterName string, provisionerName string, clusterName string, description string, cloudLabels map[string]interface{}, nodeLabels map[string]interface{}, nodeCount int, opts *AwsNodeSpec) (*NodePool, error)

func (*Client) CreateObservabilityCredential added in v0.2.0

func (c *Client) CreateObservabilityCredential(cred *TmcObservabilityCredential) (*TmcObservabilityCredential, error)

func (*Client) CreateProvisioner added in v0.2.0

func (c *Client) CreateProvisioner(mgmtClusterName string, name string, labels map[string]interface{}) (*Provisioner, error)

func (*Client) CreateVsphereCluster added in v0.4.0

func (c *Client) CreateVsphereCluster(name string, managementClusterName string, provisionerName string, cluster_group string, description string, labels map[string]interface{}, opts *VsphereOpts) (*VsphereCluster, error)

func (*Client) CreateWorkspace

func (c *Client) CreateWorkspace(name string, description string, labels map[string]interface{}) (*Workspace, error)

func (*Client) DeleteAwsAccountCredential added in v0.2.0

func (c *Client) DeleteAwsAccountCredential(name string, mgmtClusterName string) error

Deletes an already existing AWS Data protection credential account with a given name.

func (*Client) DeleteAwsCredential added in v0.2.0

func (c *Client) DeleteAwsCredential(name string) error

Deletes an already existing AWS Data protection credential account with a given name.

func (*Client) DeleteCluster added in v0.3.0

func (c *Client) DeleteCluster(name string, managementClusterName string, provisionerName string) error

func (*Client) DeleteClusterBackup added in v0.3.0

func (c *Client) DeleteClusterBackup(name string, mgmt_cluster_name string, cluster_name string, provisioner_name string) error

func (*Client) DeleteClusterGroup

func (c *Client) DeleteClusterGroup(name string) error

Deletes an already existing Cluster Group with a given name.

func (*Client) DeleteMgmtCluster added in v0.4.0

func (c *Client) DeleteMgmtCluster(name string) error

func (*Client) DeleteNamespace added in v0.4.0

func (c *Client) DeleteNamespace(name string, clusterName string, managementClusterName string, provisionerName string) error

func (*Client) DeleteNodePool added in v0.3.0

func (c *Client) DeleteNodePool(name string, clusterName string, managementClusterName string, provisionerName string) error

func (*Client) DeleteObservabilityCredential added in v0.2.0

func (c *Client) DeleteObservabilityCredential(name string) error

Deletes an already existing Tanzu Observability credential with a given name.

func (*Client) DeleteProvisioner added in v0.2.0

func (c *Client) DeleteProvisioner(mgmtClusterName, name string) error

func (*Client) DeleteVsphereCluster added in v0.4.0

func (c *Client) DeleteVsphereCluster(name string, managementClusterName string, provisionerName string) error

func (*Client) DeleteWorkspace

func (c *Client) DeleteWorkspace(name string) error

func (*Client) DescribeCluster added in v0.3.0

func (c *Client) DescribeCluster(fullName string, managementClusterName string, provisionerName string) (*Status, error)

func (*Client) DescribeNodePool added in v0.3.0

func (c *Client) DescribeNodePool(name string, clusterName string, managementClusterName string, provisionerName string) (*Status, error)

func (*Client) GetAllClusterGroups

func (c *Client) GetAllClusterGroups(labels map[string]interface{}) (*[]ClusterGroup, error)

func (*Client) GetAllProvisioners added in v0.2.0

func (c *Client) GetAllProvisioners(mgmtClusterName string, labels map[string]interface{}) ([]Provisioner, error)

func (*Client) GetAllWorkspaces

func (c *Client) GetAllWorkspaces(labels map[string]interface{}) ([]Workspace, error)

func (*Client) GetAwsAccountCredential added in v0.2.0

func (c *Client) GetAwsAccountCredential(name string, mgmtClusterName string) (*TmcAwsAccountCredential, error)

func (*Client) GetAwsCredential added in v0.2.0

func (c *Client) GetAwsCredential(name string) (*TmcAwsCredential, error)

func (*Client) GetCluster added in v0.3.0

func (c *Client) GetCluster(fullName string, managementClusterName string, provisionerName string) (*Cluster, error)

func (*Client) GetClusterBackup added in v0.3.0

func (c *Client) GetClusterBackup(name string, mgmt_cluster_name string, cluster_name string, provisioner_name string) (*TmcClusterBackup, error)

func (*Client) GetClusterGroup

func (c *Client) GetClusterGroup(name string) (*ClusterGroup, error)

Fetch Details about an existing Cluster Group using its name

func (*Client) GetMgmtCluster added in v0.4.0

func (c *Client) GetMgmtCluster(name string) (*ManagementCluster, error)

func (*Client) GetNamespace added in v0.4.0

func (c *Client) GetNamespace(name string, clusterName string, managementClusterName string, provisionerName string) (*Namespace, error)

func (*Client) GetNodePool added in v0.3.0

func (c *Client) GetNodePool(name string, clusterName string, managementClusterName string, provisionerName string) (*NodePool, error)

func (*Client) GetObservabilityCredential added in v0.2.0

func (c *Client) GetObservabilityCredential(name string) (*TmcObservabilityCredential, error)

func (*Client) GetProvisioner added in v0.2.0

func (c *Client) GetProvisioner(mgmtClusterName, name string) (*Provisioner, error)

func (*Client) GetVsphereCluster added in v0.4.0

func (c *Client) GetVsphereCluster(fullName string, managementClusterName string, provisionerName string) (*VsphereCluster, error)

func (*Client) GetWorkspace

func (c *Client) GetWorkspace(name string) (*Workspace, error)

func (*Client) UpdateCluster added in v0.3.0

func (c *Client) UpdateCluster(name string, managementClusterName string, provisionerName string, cluster_group string, description string, resourceVersion string, labels map[string]interface{}, opts *ClusterOpts) (*Cluster, error)

func (*Client) UpdateClusterGroup

func (c *Client) UpdateClusterGroup(name string, description string, labels map[string]interface{}) (*ClusterGroup, error)

Updates the Cluster Group using its name. Only the description and labels can be updated. Changing the Name forces replacement

func (*Client) UpdateNodePool added in v0.3.0

func (c *Client) UpdateNodePool(name string, managementClusterName string, provisionerName string, clusterName string, description string, cloudLabels map[string]interface{}, nodeLabels map[string]interface{}, nodeCount int, opts *AwsNodeSpec) (*NodePool, error)

func (*Client) UpdateObservabilityCredential added in v0.2.0

func (c *Client) UpdateObservabilityCredential(cred *TmcObservabilityCredential) (*TmcObservabilityCredential, error)

func (*Client) UpdateProvisioner added in v0.2.0

func (c *Client) UpdateProvisioner(mgmtClusterName string, name string, labels map[string]interface{}) (*Provisioner, error)

func (*Client) UpdateWorkspace

func (c *Client) UpdateWorkspace(name string, description string, labels map[string]interface{}) (*Workspace, error)

type Cluster added in v0.3.0

type Cluster struct {
	FullName *FullName    `json:"fullName"`
	Meta     *MetaData    `json:"meta"`
	Spec     *ClusterSpec `json:"spec"`
	Status   *Status      `json:"status"`
}

type ClusterBackupSpec added in v0.3.0

type ClusterBackupSpec struct {
	IncludedNamespaces      []string       `json:"includedNamespaces,omitempty"`
	ExcludedNamespaces      []string       `json:"excludedNamespaces,omitempty"`
	IncludedResources       []string       `json:"includedResources,omitempty"`
	ExcludedResources       []string       `json:"excludedResources,omitempty"`
	SnapshotVolumes         bool           `json:"snapshotVolumes"`
	TTL                     string         `json:"ttl"`
	LabelSelector           *LabelSelector `json:"labelSelector,omitempty"`
	IncludeClusterResources bool           `json:"includeClusterResources"`
	StorageLocation         string         `json:"storageLocation"`
	VolumeSnapshotLocations []string       `json:"volumeSnapshotLocations"`
}

type ClusterGroup

type ClusterGroup struct {
	// Name of the Cluster Group
	FullName *FullName `json:"fullName"`
	// Metadata about the Cluster Group
	Meta *MetaData `json:"meta"`
}

type ClusterGroupJsonObject

type ClusterGroupJsonObject struct {
	ClusterGroup ClusterGroup `json:"clusterGroup"`
}

type ClusterJSONObject added in v0.3.0

type ClusterJSONObject struct {
	Cluster Cluster `json:"cluster"`
}

type ClusterOpts added in v0.3.0

type ClusterOpts struct {
	Region           string
	Version          string
	CredentialName   string
	ControlPlaneSpec map[string]interface{}
	PodCidrBlock     string
	ServiceCidrBlock string
	SshKey           string
}

Options interface for passing arguments to the functions neccessary to perform on the Cluster

type ClusterResourceFullName added in v0.2.0

type ClusterResourceFullName struct {
	FullName
	Provisioner `json:"provisionerName"`
}

type ClusterSpec added in v0.3.0

type ClusterSpec struct {
	ClusterGroupName string     `json:"clusterGroupName"`
	TkgAws           AWSCluster `json:"tkgAws,omitempty"`
}

type CredentialData added in v0.2.0

type CredentialData struct {
	AwsCredential *AwsCredential    `json:"awsCredential"`
	KeyValue      *AwsCredentialKey `json:"keyValue,omitempty"`
}

type CredentialMetaData added in v0.2.0

type CredentialMetaData struct {
	Provider string `json:"provider,omitempty"`
}

type CredentialSpec added in v0.2.0

type CredentialSpec struct {
	MetaData   *CredentialMetaData `json:"meta"`
	Capability string              `json:"capability"`
	Data       *CredentialData     `json:"data"`
}

type FullName

type FullName struct {
	OrgID                 string `json:"orgId"`
	Name                  string `json:"name"`
	ManagementClusterName string `json:"managementClusterName"`
	ProvisionerName       string `json:"provisionerName,omitempty"`
	ClusterName           string `json:"clusterName,omitempty"`
}

type IamRole added in v0.2.0

type IamRole struct {
	Arn string `json:"arn"`
}

type LabelSelector added in v0.3.0

type LabelSelector struct {
	MatchLabels      map[string]interface{} `json:"matchLabels,omitempty"`
	MatchExpressions []MatchExpressions     `json:"matchExpressions,omitempty"`
}

type ManagementCluster added in v0.4.0

type ManagementCluster struct {
	FullName *FullName        `json:"fullName"`
	Meta     *MetaData        `json:"meta"`
	Spec     *MgmtClusterSpec `json:"spec"`
	Status   struct {
		RegistrationURL string `json:"registrationUrl,omitempty"`
	}
}

type MatchExpressions added in v0.3.0

type MatchExpressions struct {
	Key      string   `json:"key"`
	Operator string   `json:"operator"`
	Values   []string `json:"values"`
}

type MetaData

type MetaData struct {
	UID             string                 `json:"uid"`
	Description     string                 `json:"description"`
	Labels          map[string]interface{} `json:"labels,omitempty"`
	ResourceVersion string                 `json:"resourceVersion,omitempty"`
	Annotations     map[string]string      `json:"annotations,omitempty"`
}

type MgmtClusterJsonObject added in v0.4.0

type MgmtClusterJsonObject struct {
	MgmtCluster ManagementCluster `json:"managementCluster"`
}

type MgmtClusterSpec added in v0.4.0

type MgmtClusterSpec struct {
	KubernetesProviderType string `json:"kubernetesProviderType"`
	DefaultClusterGroup    string `json:"defaultClusterGroup"`
}

type Namespace added in v0.4.0

type Namespace struct {
	FullName *FullName      `json:"fullName"`
	Meta     *MetaData      `json:"meta"`
	Spec     *NamespaceSpec `json:"spec"`
}

type NamespaceJsonObject added in v0.4.0

type NamespaceJsonObject struct {
	Namespace Namespace `json:"namespace"`
}

type NamespaceOpts added in v0.4.0

type NamespaceOpts struct {
	Description       string
	Labels            map[string]interface{}
	ManagementCluster string
	ProvisionerName   string
	ClusterName       string
	WorkspaceName     string
}

type NamespaceSpec added in v0.4.0

type NamespaceSpec struct {
	WorkspaceName string `json:"workspaceName"`
}

type Network added in v0.3.0

type Network struct {
	ClusterNetwork struct {
		Pods []struct {
			CidrBlocks string `json:"cidrBlocks"`
		} `json:"pods"`
		Services []struct {
			CidrBlocks string `json:"cidrBlocks"`
		} `json:"services"`
	} `json:"cluster"`
	Provider struct {
		Vpc struct {
			Id        string `json:"id,omitempty"`
			CidrBlock string `json:"cidrBlock"`
		} `json:"vpc"`
		Subnets []Subnet `json:"subnets"`
	} `json:"provider"`
}

type NodeName added in v0.3.0

type NodeName struct {
	OrgID                 string `json:"orgId"`
	ClusterName           string `json:"clusterName"`
	ManagementClusterName string `json:"managementClusterName"`
	ProvisionerName       string `json:"provisionerName"`
	Name                  string `json:"name"`
}

type NodePool added in v0.3.0

type NodePool struct {
	FullName *NodeName    `json:"fullName"`
	Meta     *MetaData    `json:"meta"`
	Spec     *AwsNodePool `json:"spec"`
	Status   *Status      `json:"status"`
}

type NodePoolJsonObject added in v0.3.0

type NodePoolJsonObject struct {
	NodePool NodePool `json:"nodepool"`
}

type ObservabilityCredentialData added in v0.2.0

type ObservabilityCredentialData struct {
	KeyValue ObservabilityKey `json:"keyValue"`
}

type ObservabilityCredentialSpec added in v0.2.0

type ObservabilityCredentialSpec struct {
	Capability string                      `json:"capability"`
	Data       ObservabilityCredentialData `json:"data"`
}

type ObservabilityKey added in v0.2.0

type ObservabilityKey struct {
	Data WaveFrontData `json:"data,omitempty"`
}

type Provisioner added in v0.2.0

type Provisioner struct {
	// The name of the provisioner.
	FullName *FullName `json:"fullName"`
	// The metadata of the provisioner.
	Meta *MetaData `json:"meta"`
}

type ProvisionerResponse added in v0.2.0

type ProvisionerResponse struct {
	Provisioner Provisioner `json:"provisioner"`
}

type Status added in v0.3.0

type Status struct {
	Phase string `json:"phase,omitempty"`
}

type Subnet added in v0.3.0

type Subnet struct {
	Id       string `json:"id"`
	IsPublic bool   `json:"isPublic"`
}

type TmcAwsAccountCredential added in v0.2.0

type TmcAwsAccountCredential struct {
	FullName *ClusterResourceFullName `json:"fullName"`
	Meta     *MetaData                `json:"meta"`
	Spec     *CredentialSpec          `json:"spec"`
	Status   struct {
		Phase string `json:"phase,omitempty"`
	} `json:"status,omitempty"`
}

type TmcAwsAccountCredentialResponse added in v0.2.0

type TmcAwsAccountCredentialResponse struct {
	TmcAwsAccountCredential TmcAwsAccountCredential `json:"credential"`
}

type TmcAwsCredential added in v0.2.0

type TmcAwsCredential struct {
	FullName *FullName       `json:"fullName"`
	Meta     *MetaData       `json:"meta"`
	Spec     *CredentialSpec `json:"spec"`
	Status   struct {
		Phase string `json:"phase,omitempty"`
	} `json:"status,omitempty"`
}

type TmcAwsCredentialResponse added in v0.2.0

type TmcAwsCredentialResponse struct {
	TmcAwsCredential TmcAwsCredential `json:"credential"`
}

type TmcClusterBackup added in v0.3.0

type TmcClusterBackup struct {
	FullName *FullName          `json:"fullName"`
	Meta     *MetaData          `json:"meta"`
	Status   *Status            `json:"status"`
	Spec     *ClusterBackupSpec `json:"spec"`
}

type TmcClusterBackupResponse added in v0.3.0

type TmcClusterBackupResponse struct {
	Backup TmcClusterBackup `json:"backup"`
}

type TmcObservabilityCredential added in v0.2.0

type TmcObservabilityCredential struct {
	FullName *FullName                    `json:"fullName"`
	Meta     *MetaData                    `json:"meta"`
	Spec     *ObservabilityCredentialSpec `json:"spec"`
	Status   struct {
		Phase string `json:"phase,omitempty"`
	} `json:"status,omitempty"`
}

type TmcObservabilityCredentialResponse added in v0.2.0

type TmcObservabilityCredentialResponse struct {
	TmcObservabilityCredential TmcObservabilityCredential `json:"credential"`
}

type Volume added in v0.4.0

type Volume struct {
	Name         string `json:"name"`
	MountPath    string `json:"mountPath"`
	Capacity     int    `json:"capacity"`
	StorageClass string `json:"storageClass"`
}

type VpshereNodepoolOpts added in v0.4.0

type VpshereNodepoolOpts struct {
	Name            string
	Class           string
	StorageClass    string
	WorkerNodeCount int
}

type Vsphere added in v0.4.0

type Vsphere struct {
	Settings struct {
		Network struct {
			Pods struct {
				CidrBlocks []string `json:"cidrBlocks"`
			} `json:"pods"`
			Services struct {
				CidrBlocks []string `json:"cidrBlocks"`
			} `json:"services"`
		} `json:"network"`
	} `json:"settings"`
	Distribution struct {
		Version string `json:"version"`
	} `json:"distribution"`
	Topology struct {
		ControlPlane VsphereControlPlane `json:"controlPlane"`
		NodePools    []VsphereNodepool   `json:"nodePools"`
	} `json:"topology"`
}

type VsphereCluster added in v0.4.0

type VsphereCluster struct {
	FullName *FullName    `json:"fullName"`
	Meta     *MetaData    `json:"meta"`
	Spec     *VsphereSpec `json:"spec"`
}

type VsphereControlPlane added in v0.4.0

type VsphereControlPlane struct {
	Volumes      []Volume `json:"volumes,omitempty"`
	Class        string   `json:"class"`
	StorageClass string   `json:"storageClass"`
}

type VsphereJsonObject added in v0.4.0

type VsphereJsonObject struct {
	Cluster VsphereCluster `json:"cluster"`
}

type VsphereNodeSpec added in v0.4.0

type VsphereNodeSpec struct {
	NodeCount string              `json:"workerNodeCount"`
	NodeSpec  VsphereControlPlane `json:"tkgServiceVsphere"`
}

type VsphereNodepool added in v0.4.0

type VsphereNodepool struct {
	Spec VsphereNodeSpec `json:"spec"`
	Info struct {
		Name string `json:"name"`
	} `json:"info"`
}

type VsphereOpts added in v0.4.0

type VsphereOpts struct {
	Version          string
	Class            string
	StorageClass     string
	PodCidrBlock     string
	ServiceCidrBlock string
	NodepoolOpts     []VpshereNodepoolOpts
}

type VsphereSpec added in v0.4.0

type VsphereSpec struct {
	ClusterGroupName  string  `json:"clusterGroupName"`
	TkgVsphereService Vsphere `json:"tkgServiceVsphere"`
}

type WaveFrontData added in v0.2.0

type WaveFrontData struct {
	Token string `json:"wavefront.token"`
}

type Workspace

type Workspace struct {
	// The name of the workspace.
	FullName *FullName `json:"fullName"`
	// The metadata of the workspace.
	Meta *MetaData `json:"meta"`
}

type WorkspaceResponse

type WorkspaceResponse struct {
	Workspace Workspace `json:"workspace"`
}

Jump to

Keyboard shortcuts

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