client

package
v0.0.0-...-8abd549 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHostVersion

func GetHostVersion() string

GetHostVersion fetches the version of YBA Host

func GetVersion

func GetVersion() string

GetVersion fetches the version of YBA CLI

func ParseURL

func ParseURL(host string) (*url.URL, error)

ParseURL returns a URL if string is valid, or returns error

func SetHostVersion

func SetHostVersion(version string)

SetHostVersion assigns the version of YBA Host

func SetVersion

func SetVersion(version string)

SetVersion assigns the version of YBA CLI

Types

type AuthAPIClient

type AuthAPIClient struct {
	RestClient   *RestAPIClient
	APIClient    *ybaclient.APIClient
	CustomerUUID string
	// contains filtered or unexported fields
}

AuthAPIClient contains authenticated api client and customer UUID

func NewAuthAPIClient

func NewAuthAPIClient() (*AuthAPIClient, error)

NewAuthAPIClient function is returning a new AuthAPIClient Client

func NewAuthAPIClientAndCustomer

func NewAuthAPIClientAndCustomer() *AuthAPIClient

NewAuthAPIClientAndCustomer before every command to access YBA host

func NewAuthAPIClientInitialize

func NewAuthAPIClientInitialize(url *url.URL, apiToken string) (*AuthAPIClient, error)

NewAuthAPIClientInitialize function is returning a new AuthAPIClient Client

func (*AuthAPIClient) AbortTask

AbortTask triggers abort task API

func (*AuthAPIClient) ApiLogin

ApiLogin fetches API Token and CustomerUUID

func (*AuthAPIClient) ApiToken

ApiToken regenerates and fetches unmasked API token

func (*AuthAPIClient) CheckValidYBAVersion

func (a *AuthAPIClient) CheckValidYBAVersion(versions YBAMinimumVersion) (bool,
	string, error)

CheckValidYBAVersion allows operation if version is higher than listed versions For releases older than 2024.1, keeping both stable and preview min version as the same version would provide the correct result For features on and after 2024.1, min stable and min preview must be different

func (*AuthAPIClient) CreateAllClusters

CreateAllClusters creates a universe with a minimum of 1 cluster

func (*AuthAPIClient) CreateBackup

CreateBackup creates backups associated with the universe

func (*AuthAPIClient) CreateBackupSchedule

CreateBackupSchedule creates a backup schedule

func (*AuthAPIClient) CreateCustomerConfig

CreateCustomerConfig creates configs associated with the customer

func (*AuthAPIClient) CreateInstanceType

CreateInstanceType for onprem providers

func (*AuthAPIClient) CreateKMSConfig

CreateKMSConfig creates kms config

func (*AuthAPIClient) CreateNewRelease

CreateNewRelease API to create new release

func (*AuthAPIClient) CreateNodeInstance

CreateNodeInstance adds a node instance to an onprem provider

func (*AuthAPIClient) CreateProvider

CreateProvider calls the create provider API

func (*AuthAPIClient) CreateRole

CreateRole creates role

func (*AuthAPIClient) CreateUser

CreateUser creates a new user

func (*AuthAPIClient) CreateXClusterConfig

CreateXClusterConfig create xCluster config

func (*AuthAPIClient) DeleteBackupSchedule

func (a *AuthAPIClient) DeleteBackupSchedule(scheduleUUID string) ybaclient.ScheduleManagementApiApiDeleteScheduleV2Request

DeleteBackupSchedule deletes the backup schedule

func (*AuthAPIClient) DeleteBackups

DeleteBackups deletes the backups

func (*AuthAPIClient) DeleteCertificate

DeleteCertificate - delete certificate

func (*AuthAPIClient) DeleteCustomerConfig

DeleteCustomerConfig deletes configs associated with the customer

func (*AuthAPIClient) DeleteInstance

DeleteInstance deletes the node instance from the onprem provider

func (*AuthAPIClient) DeleteInstanceType

func (a *AuthAPIClient) DeleteInstanceType(pUUID, instanceTypeName string) ybaclient.InstanceTypesApiApiDeleteInstanceTypeRequest

DeleteInstanceType for onprem providers

func (*AuthAPIClient) DeleteKMSConfig

DeleteKMSConfig deletes kms config

func (*AuthAPIClient) DeleteKey

DeleteKey deletes runtime configuration key

func (*AuthAPIClient) DeleteNewRelease

DeleteNewRelease API to delete new release

func (*AuthAPIClient) DeleteProvider

DeleteProvider deletes provider associated with the providerUUID

func (*AuthAPIClient) DeleteRole

DeleteRole deletes role

func (*AuthAPIClient) DeleteUniverse

DeleteUniverse deletes universe associated with the universeUUID

func (*AuthAPIClient) DeleteUser

DeleteUser deletes a user

func (*AuthAPIClient) DeleteXClusterConfig

DeleteXClusterConfig delete xCluster config

func (*AuthAPIClient) DescribeTable

DescribeTable for the description of a table in the universe

func (*AuthAPIClient) DetachedNodeAction

DetachedNodeAction deletes the node instance from the onprem provider

func (*AuthAPIClient) EditBackup

EditBackup edits a backup

func (*AuthAPIClient) EditBackupSchedule

EditBackupSchedule edits a backup schedule

func (*AuthAPIClient) EditCertificate

EditCertificate - edit certificate

func (*AuthAPIClient) EditCustomerConfig

EditCustomerConfig edits configs associated with the customer

func (*AuthAPIClient) EditKMSConfig

EditKMSConfig edits kms config

func (*AuthAPIClient) EditProvider

EditProvider edits the provider associated with the providerUUIS

func (*AuthAPIClient) EditRole

EditRole edits role

func (*AuthAPIClient) EditXClusterConfig

EditXClusterConfig edit xCluster config

func (*AuthAPIClient) ExtractMetadata

ExtractMetadata API to extract metadata from tarball

func (*AuthAPIClient) GetAllNamespaces

GetAllNamespaces for the listing of all namespaces in the universe

func (*AuthAPIClient) GetAllTableSpaces

GetAllTableSpaces for the listing of all table spaces in the universe

func (*AuthAPIClient) GetAllTables

GetAllTables for the listing of all tables in the universe

func (*AuthAPIClient) GetAppVersion

GetAppVersion fetches YugabyteDB Anywhere version

func (*AuthAPIClient) GetBackupByTaskUUID

func (a *AuthAPIClient) GetBackupByTaskUUID(universeUUID string, taskUUID string) ybaclient.BackupsApiApiFetchBackupsByTaskUUIDRequest

GetBackupByTaskUUID fetches backups by the universe and task UUID

func (*AuthAPIClient) GetBackupSchedule

func (a *AuthAPIClient) GetBackupSchedule(scheduleUUID string) ybaclient.ScheduleManagementApiApiGetScheduleRequest

GetBackupSchedule fetches backups by the universe and task UUID

func (*AuthAPIClient) GetClientCert

GetClientCert - get client certificate

func (*AuthAPIClient) GetConfig

GetConfig fetches runtime configuration

func (*AuthAPIClient) GetConfigurationKey

GetConfigurationKey fetches runtime configuration key

func (*AuthAPIClient) GetCustomerTaskStatus

func (a *AuthAPIClient) GetCustomerTaskStatus(taskUUID string) ybaclient.CustomerTasksApiApiTaskStatusRequest

GetCustomerTaskStatus fetches the customer task status

func (*AuthAPIClient) GetCustomerUUID

func (a *AuthAPIClient) GetCustomerUUID() error

GetCustomerUUID fetches YugabyteDB Anywhere customer UUID

func (*AuthAPIClient) GetExtractMetadata

GetExtractMetadata API to get extract metadata

func (*AuthAPIClient) GetListOfCertificates

GetListOfCertificates fetches list of certificates associated with the customer

func (*AuthAPIClient) GetListOfCustomerConfig

GetListOfCustomerConfig fetches list of configs associated with the customer

func (*AuthAPIClient) GetListOfProviders

GetListOfProviders fetches list of providers associated with the customer

func (*AuthAPIClient) GetListOfReleases

func (a *AuthAPIClient) GetListOfReleases(includeMetadata bool) ybaclient.ReleaseManagementApiApiGetListOfReleasesRequest

GetListOfReleases API to fetch list of releases

func (*AuthAPIClient) GetNewRelease

GetNewRelease API to fetch list of new releases

func (*AuthAPIClient) GetNodeDetails

GetNodeDetails fetches a node based on UUID

func (*AuthAPIClient) GetNodeInstance

GetNodeInstance fetches a node based on UUID

func (*AuthAPIClient) GetProvider

GetProvider fetches provider associated with the customer and providerUUID

func (*AuthAPIClient) GetRegion

GetRegion fetches region list of a provider

func (*AuthAPIClient) GetRestore

GetRestore fetches restores of the customer

func (*AuthAPIClient) GetRole

GetRole fetches role

func (*AuthAPIClient) GetRoleBindings

GetRoleBindings fetches role bindings

func (*AuthAPIClient) GetRootCert

GetRootCert - get root certificate

func (*AuthAPIClient) GetSessionInfo

GetSessionInfo fetches YugabyteDB Anywhere session info

func (*AuthAPIClient) GetUniverse

GetUniverse fetches of universe associated with the universeUUID

func (*AuthAPIClient) GetUploadRelease

GetUploadRelease API to get URL

func (*AuthAPIClient) GetUserDetails

GetUserDetails fetches user details

func (*AuthAPIClient) GetXClusterConfig

GetXClusterConfig get xCluster config

func (*AuthAPIClient) InstanceTypeDetail

func (a *AuthAPIClient) InstanceTypeDetail(pUUID, instanceTypeName string) ybaclient.InstanceTypesApiApiInstanceTypeDetailRequest

InstanceTypeDetail fetches details of the instance type in an onprem provider

func (*AuthAPIClient) IsCLISupported

func (a *AuthAPIClient) IsCLISupported()

IsCLISupported checks if the CLI version is supported

func (*AuthAPIClient) List

List fetches the list of access keys associated with the provider

func (*AuthAPIClient) ListBackupSchedules

ListBackupSchedules associated with the customer

func (*AuthAPIClient) ListBackupSchedulesRest

func (a *AuthAPIClient) ListBackupSchedulesRest(
	reqBody ybaclient.SchedulePagedApiQuery,
	operation string,
) (
	util.SchedulePagedResponse, error,
)

ListBackupSchedulesRest uses REST API to call list schedule functionality

func (*AuthAPIClient) ListBackups

ListBackups associated with the customer

func (*AuthAPIClient) ListByProvider

ListByProvider fetches node instances associated to an onprem provider

func (*AuthAPIClient) ListFailedSubtasks

ListFailedSubtasks fetches the customer failed task status

func (*AuthAPIClient) ListIncrementalBackups

func (a *AuthAPIClient) ListIncrementalBackups(backupUUID string) ybaclient.BackupsApiApiListIncrementalBackupsRequest

ListIncrementalBackups lists the incremental backups

func (*AuthAPIClient) ListKMSConfigs

ListKMSConfigs fetches list of kms configs associated with the customer

func (*AuthAPIClient) ListKeyInfo

ListKeyInfo fetches list of mutable runtime configuration keys

func (*AuthAPIClient) ListKeys

ListKeys fetches list of mutable runtime configuration keys

func (*AuthAPIClient) ListNewReleases

ListNewReleases API to fetch list of new releases

func (*AuthAPIClient) ListOfAZ

ListOfAZ fetches az list of a provider region

func (*AuthAPIClient) ListOfInstanceType

ListOfInstanceType fetches the list of instance types associated with the provider (for onprem)

func (*AuthAPIClient) ListPermissions

ListPermissions fetches list of permissions

func (*AuthAPIClient) ListRestores

ListRestores associated with the customer

func (*AuthAPIClient) ListRoleBindingRest

func (a *AuthAPIClient) ListRoleBindingRest(
	userUUID, operation string,
) (
	map[string]([]ybaclient.RoleBinding), error,
)

ListRoleBindingRest uses REST API to call list role binding functionality

func (*AuthAPIClient) ListRoles

ListRoles fetches list of roles

func (*AuthAPIClient) ListScopes

ListScopes fetches list of mutable runtime configuration scopes

func (*AuthAPIClient) ListUniverses

ListUniverses fetches list of universes associated with the customer

func (*AuthAPIClient) ListUsers

ListUsers fetches list of users associated with the customer

func (*AuthAPIClient) NeedBootstrapTable

NeedBootstrapTable need bootstrap table

func (*AuthAPIClient) NewProviderYBAVersionCheck

func (a *AuthAPIClient) NewProviderYBAVersionCheck() (bool, string, error)

NewProviderYBAVersionCheck checks if the new API request body can be used for the Create Provider API

func (*AuthAPIClient) NewReleaseYBAVersionCheck

func (a *AuthAPIClient) NewReleaseYBAVersionCheck() (bool, string, error)

NewReleaseYBAVersionCheck checks if the new release management API can be used

func (*AuthAPIClient) NodeAction

func (a *AuthAPIClient) NodeAction(uUUID, nodeName string) ybaclient.NodeInstancesApiApiNodeActionRequest

NodeAction for the node operations for universes

func (*AuthAPIClient) Refresh

Refresh the releases page to get the latest YugabyteDB releases

func (*AuthAPIClient) RegisterCustomer

RegisterCustomer registers a YugabyteDB Anywhere customer

func (*AuthAPIClient) ResetUserPassword

ResetUserPassword resets the password of the user

func (*AuthAPIClient) RestartUniverse

RestartUniverse for restart operation

func (*AuthAPIClient) RestartXClusterConfig

RestartXClusterConfig restart xCluster

func (*AuthAPIClient) RestoreBackup

RestoreBackup restores a backup

func (*AuthAPIClient) RetrieveOIDCAuthToken

RetrieveOIDCAuthToken fetches the OIDC JWT auth token

func (*AuthAPIClient) RetryTask

RetryTask triggers retry universe/provider API

func (*AuthAPIClient) SetKey

SetKey sets runtime configuration key

func (*AuthAPIClient) SetRoleBinding

SetRoleBinding sets role binding

func (*AuthAPIClient) SetUniverseKey

SetUniverseKey to change universe EAR settings

func (*AuthAPIClient) SyncXClusterConfig

SyncXClusterConfig sync xCluster

func (*AuthAPIClient) TasksList

TasksList triggers abort task API

func (*AuthAPIClient) UniverseYBAVersionCheck

func (a *AuthAPIClient) UniverseYBAVersionCheck() (bool, string, error)

UniverseYBAVersionCheck checks if the new API request body can be used for the Create Provider API

func (*AuthAPIClient) UpdateNewRelease

UpdateNewRelease API to update new release

func (*AuthAPIClient) UpdateUserProfile

UpdateUserProfile updates the user profile

func (*AuthAPIClient) UpgradeGFlags

UpgradeGFlags upgrades the universe gflags

func (*AuthAPIClient) UpgradeSoftware

UpgradeSoftware upgrades the universe YugabyteDB version

func (*AuthAPIClient) UpgradeVMImage

UpgradeVMImage upgrades the VM image of the universe

func (*AuthAPIClient) Upload

Upload - upload certificate

func (*AuthAPIClient) UploadRelease

UploadRelease API to upload URL

func (*AuthAPIClient) UploadReleaseRest

func (a *AuthAPIClient) UploadReleaseRest(
	filePath string,
) (
	ybaclient.YBPCreateSuccess, error,
)

UploadReleaseRest uses REST API to call list schedule functionality

func (*AuthAPIClient) WaitForExtractMetadata

func (a *AuthAPIClient) WaitForExtractMetadata(resourceUUID, message, operation string) (
	ybaclient.ResponseExtractMetadata,
	error,
)

WaitForExtractMetadata waits for state changes for a YugabyteDB Anywhere task

func (*AuthAPIClient) WaitForExtractMetadataCI

func (a *AuthAPIClient) WaitForExtractMetadataCI(resourceUUID, message, operation string) (
	ybaclient.ResponseExtractMetadata,
	error,
)

WaitForExtractMetadataCI waits for State change for a YugabyteDB Anywhere task for CI

func (*AuthAPIClient) WaitForExtractMetadataProgressBar

func (a *AuthAPIClient) WaitForExtractMetadataProgressBar(resourceUUID, message, operation string) (
	ybaclient.ResponseExtractMetadata,
	error,
)

WaitForExtractMetadataProgressBar waits for State change for a YugabyteDB Anywhere task

func (*AuthAPIClient) WaitForTask

func (a *AuthAPIClient) WaitForTask(taskUUID, message string) error

WaitForTask waits for state changes for a YugabyteDB Anywhere task

func (*AuthAPIClient) WaitForTaskCI

func (a *AuthAPIClient) WaitForTaskCI(taskUUID, message string) error

WaitForTaskCI waits for State change for a YugabyteDB Anywhere task for CI

func (*AuthAPIClient) WaitForTaskProgressBar

func (a *AuthAPIClient) WaitForTaskProgressBar(taskUUID, message string) error

WaitForTaskProgressBar waits for State change for a YugabyteDB Anywhere task

type RestAPIClient

type RestAPIClient struct {
	Client *http.Client
	Host   string
	Scheme string
}

RestAPIClient contains http client

type YBAMinimumVersion

type YBAMinimumVersion struct {
	Stable  string
	Preview string
}

YBAMinimumVersion contains the minimum YBA version for stable and preview releases for a feature

Jump to

Keyboard shortcuts

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