Documentation ¶
Overview ¶
Package api Copyright 2020-2021 Author.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Mustafa mbayramo@vmware.com
Package api Copyright 2020-2021 Author.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Mustafa mbayramo@vmware.com
Package api Copyright 2020-2021 Author.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Mustafa mbayramo@vmware.com
Package api Copyright 2020-2021 Author.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Mustafa mbayramo@vmware.com
Package api Copyright 2020-2021 Author.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Mustafa mbayramo@vmware.com
Package api Copyright 2020-2021 Author.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Mustafa mbayramo@vmware.com
Index ¶
- Constants
- func ClusterFields() []string
- func GetTestAssetsDir() string
- func IsInState(currentState string, predicate string) bool
- func IsValidUUID(u string) bool
- func NewInstanceRequestSpec(cloudName string, clusterName string, vimType string, nfdName string, ...) (*specs.InstanceRequestSpec, error)
- func SetLoggingFlags()
- func TemplateFields() []string
- func TenantFields() []string
- type CloudProviderNotFound
- type ClusterCreateApiReq
- type ClusterDeleteApiReq
- type CnfMoveReq
- type CreateInstanceApiReq
- type HelmNodeSelector
- type NodePoolCreateApiReq
- type Repo
- type ResetInstanceApiReq
- type TaskCanceled
- type TaskNotFound
- type TcaApi
- func (a *TcaApi) BlockWaitStateChange(ctx context.Context, instanceId string, waitFor string, maxRetry int, ...) error
- func (a *TcaApi) BlockWaitTaskFinish(ctx context.Context, task *models.TcaTask, waitFor string, maxRetry int, ...) error
- func (a *TcaApi) CnfMove(ctx context.Context, instanceName string, moveReq *CnfMoveReq, isDry bool) error
- func (a *TcaApi) CnfReconfigure(ctx context.Context, instanceName string, valueFile string, vduName string, ...) error
- func (a *TcaApi) CreateCatalogEntity(fileName string, catalogName string, substitution map[string]string) (bool, error)
- func (a *TcaApi) CreateClusterTemplate(spec *specs.SpecClusterTemplate) (string, error)
- func (a *TcaApi) CreateClusters(ctx context.Context, req *ClusterCreateApiReq) (*models.TcaTask, error)
- func (a *TcaApi) CreateCnfInstance(ctx context.Context, req *CreateInstanceApiReq) error
- func (a *TcaApi) CreateCnfNewInstance(ctx context.Context, n *specs.InstanceRequestSpec, isDry bool, isBlocked bool) (*response.LcmInfo, error)
- func (a *TcaApi) CreateExtension(ctx context.Context, spec *specs.SpecExtension) (string, error)
- func (a *TcaApi) CreateNewNodePool(ctx context.Context, req *NodePoolCreateApiReq) (*models.TcaTask, error)
- func (a *TcaApi) CreateSpecExample(name string, t string, h string, vm string, ip string, p string, ...) *specs.SpecCluster
- func (a *TcaApi) CreateTenantProvider(spec *specs.SpecCloudProvider) (*models.RegistrationRespond, error)
- func (a *TcaApi) DeleteCatalogEntity(catalogName string) (bool, error)
- func (a *TcaApi) DeleteCloudProvider(ctx context.Context, s string) (*models.TcaTask, error)
- func (a *TcaApi) DeleteCluster(ctx context.Context, req *ClusterDeleteApiReq) (*models.TcaTask, error)
- func (a *TcaApi) DeleteCnf(ctx context.Context, instanceName string) error
- func (a *TcaApi) DeleteCnfInstance(ctx context.Context, instanceName string, vimName string, isForce bool) error
- func (a *TcaApi) DeleteExtension(ctx context.Context, NameOrId string) (bool, error)
- func (a *TcaApi) DeleteNodePool(ctx context.Context, cluster string, nodePool string) (*models.TcaTask, error)
- func (a *TcaApi) DeleteTemplate(template string) error
- func (a *TcaApi) DeleteTenantCluster(ctx context.Context, tenantCluster string) (*models.TcaTask, error)
- func (a *TcaApi) DeleteTenantsProvider(ctx context.Context, tenantCluster string) (*models.TcaTask, error)
- func (a *TcaApi) ExtensionQuery(ctx context.Context) (*response.Extensions, error)
- func (a *TcaApi) GetAllInstances() (*response.CnfsExtended, error)
- func (a *TcaApi) GetAllNodePool(ctx context.Context) (*response.NodePool, error)
- func (a *TcaApi) GetAllNodePools(ctx context.Context) ([]response.NodesSpecs, error)
- func (a *TcaApi) GetAllPackages() (*response.CnfsExtended, error)
- func (a *TcaApi) GetApiKey() string
- func (a *TcaApi) GetAuthorization() (bool, error)
- func (a *TcaApi) GetBaseUrl() string
- func (a *TcaApi) GetCatalogAndVdu(nfdName string) (*response.VnfPackage, *response.VduPackage, error)
- func (a *TcaApi) GetCatalogId(catalogId string) (string, string, error)
- func (a *TcaApi) GetCluster(ctx context.Context, clusterId string) (*response.ClusterSpec, error)
- func (a *TcaApi) GetClusterNodePool(ctx context.Context, clusterId string, nodePoolId string) (*response.NodesSpecs, error)
- func (a *TcaApi) GetClusterNodePools(Id string) (*response.NodePool, error)
- func (a *TcaApi) GetClusterTask(ctx context.Context, clusterId string, showChildren bool) (*models.ClusterTask, error)
- func (a *TcaApi) GetClusterTemplate(templateId string) (*response.ClusterTemplateSpec, error)
- func (a *TcaApi) GetClusterTemplates() (*response.ClusterTemplates, error)
- func (a *TcaApi) GetClusters(ctx context.Context) (*response.Clusters, error)
- func (a *TcaApi) GetConsumption(ctx context.Context) (*models.ConsumptionResp, error)
- func (a *TcaApi) GetCurrentClusterTask(ctx context.Context, clusterId string) (*models.ClusterTask, error)
- func (a *TcaApi) GetEntireCatalog() (*response.VnfPackages, error)
- func (a *TcaApi) GetExtension(ctx context.Context, NameOrId string) (*response.Extensions, error)
- func (a *TcaApi) GetExtensions(ctx context.Context) (*response.Extensions, error)
- func (a *TcaApi) GetFilteredExtension(ctx context.Context) (*response.ReposList, error)
- func (a *TcaApi) GetInstance(ctx context.Context, NameOrId string) (*response.LcmInfo, error)
- func (a *TcaApi) GetLcmActions(ctx context.Context, instanceName string) (*models.PolicyLinks, error)
- func (a *TcaApi) GetNamedClusterTemplate(name string) (*response.ClusterTemplateSpec, error)
- func (a *TcaApi) GetNodePool(ctx context.Context, NameOrId string) (*response.NodePool, error)
- func (a *TcaApi) GetRepos(ctx context.Context) (*response.ReposList, error)
- func (a *TcaApi) GetTenant(ctx context.Context, tenant string) (*response.Tenants, error)
- func (a *TcaApi) GetTenantsQuery(tenantId string, nfType string) (*response.Tenants, error)
- func (a *TcaApi) GetVdu(nfdName string) (*response.VduPackage, error)
- func (a *TcaApi) GetVim(ctx context.Context, NameOrId string) (*response.TenantSpecs, error)
- func (a *TcaApi) GetVimComputeClusters(ctx context.Context, cloudName string) (*models.VMwareClusters, error)
- func (a *TcaApi) GetVimFolders(ctx context.Context, cloudName string) (*models.Folders, error)
- func (a *TcaApi) GetVimNetworks(ctx context.Context, cloudName string) (*models.CloudNetworks, error)
- func (a *TcaApi) GetVimResourcePool(ctx context.Context, cloudName string) (*models.ResourcePool, error)
- func (a *TcaApi) GetVimTenants(ctx context.Context) (*response.Tenants, error)
- func (a *TcaApi) GetVimVMTemplates(ctx context.Context, cloudName string, templateType VmTemplateFilterType, ...) (*models.VcInventory, error)
- func (a *TcaApi) GetVims(ctx context.Context) (*response.Tenants, error)
- func (a *TcaApi) GetVnfPkgm(filter string, pkgId string) (*response.VnfPackages, error)
- func (a *TcaApi) GetVnflcm(f ...string) (interface{}, error)
- func (a *TcaApi) NormalizeTemplateId(IdOrName string, templateType string) (string, error)
- func (a *TcaApi) ResetState(ctx context.Context, req *ResetInstanceApiReq) error
- func (a *TcaApi) ResolveClusterName(ctx context.Context, q string) (string, error)
- func (a *TcaApi) ResolveExtensionId(ctx context.Context, NameOrId string) (string, error)
- func (a *TcaApi) ResolveInstanceName(name string) (string, error)
- func (a *TcaApi) ResolveManagementCluster(NameOrId string, tenants *response.Clusters) (*response.ClusterSpec, error)
- func (a *TcaApi) ResolvePoolAndCluster(ctx context.Context, cluster string, nodePool string) (string, string, error)
- func (a *TcaApi) ResolvePoolId(ctx context.Context, poolName string, clusterScope ...string) (string, error)
- func (a *TcaApi) ResolvePoolName(ctx context.Context, poolName string, clusterName string) (string, string, error)
- func (a *TcaApi) ResolveTemplateId(templateId string) (string, error)
- func (a *TcaApi) ResolveVim(ctx context.Context, name string) (*response.TenantsDetails, error)
- func (a *TcaApi) ResolveVimId(ctx context.Context, name string) (string, error)
- func (a *TcaApi) ResolveVimName(ctx context.Context, name string) (string, error)
- func (a *TcaApi) RollbackCnf(ctx context.Context, instanceName string, doBlock bool, verbose bool) error
- func (a *TcaApi) SetBaseUrl(url string)
- func (a *TcaApi) SetPassword(password string)
- func (a *TcaApi) SetTrace(trace bool)
- func (a *TcaApi) SetUsername(username string)
- func (a *TcaApi) TenantsCloudProvider(ctx context.Context, query string) (*response.Tenants, error)
- func (a *TcaApi) TerminateCnfInstance(ctx context.Context, req *TerminateInstanceApiReq) error
- func (a *TcaApi) UpdateClusterTemplate(spec *specs.SpecClusterTemplate) error
- func (a *TcaApi) UpdateCnfState(ctx context.Context, req *UpdateInstanceApiReq) (*response.InstanceUpdate, error)
- func (a *TcaApi) UpdateExtension(ctx context.Context, spec *specs.SpecExtension) (bool, error)
- func (a *TcaApi) UpdateNodePool(ctx context.Context, req *NodePoolCreateApiReq) (*models.TcaTask, error)
- type TcaTaskFailed
- type TcaTaskStateType
- type TerminateInstanceApiReq
- type UnsupportedCloudProvider
- type UpdateInstanceApiReq
- type VmTemplateFilterType
- type VmwareVim
Constants ¶
const ( //VmwareTemplateK8s default filter for k8s templates VmwareTemplateK8s VmTemplateFilterType = "k8svm" // DefaultNamespace - default name space used for placement DefaultNamespace = "default" // DefaultFlavor default vdu flavor DefaultFlavor = "default" )
const ( // BlockMaxRetryTimer - default retry timer BlockMaxRetryTimer = 32 // TaskPoolSeconds default pool timer. TaskPoolSeconds = 10 StateInstantiate = "INSTANTIATE" StateCompleted = "COMPLETED" StateStarting = "STARTING" StateInstantiated = "INSTANTIATED" StateTerminated = "TERMINATED" StateTerminate = "TERMINATE" StateFailedTemp = "FAILED_TEMP" StateNotInstantiated = "NOT_INSTANTIATED" DefaultMaxRetry = 32 // TaskStateSuccess task state successes TaskStateSuccess = "SUCCESS" // TaskStateQueued task state queued by tca TaskStateQueued = "QUEUED" // TaskStateFailed task state failed TaskStateFailed = "FAILED" TaskTypeNodePoolCreation = "Node Pool Creation" TaskTypeInventoryUpdate = "Inventory Update" TaskTypeUpdateNodePool = "Update Node Pool" CLusterCsiNfs = "nfs_client" ClusterCsiVsphere = "vsphere-csi" )
Variables ¶
This section is empty.
Functions ¶
func ClusterFields ¶
func ClusterFields() []string
func GetTestAssetsDir ¶
func GetTestAssetsDir() string
GetTestAssetsDir return dir where test assets are it call RunOnRootFolder that change dir
func IsInState ¶
IsInState - abstract state change, late if I move code to state as different representation we swap code here.
func NewInstanceRequestSpec ¶
func NewInstanceRequestSpec(cloudName string, clusterName string, vimType string, nfdName string, repo *Repo, instanceName string, nodePoolName string) (*specs.InstanceRequestSpec, error)
NewInstanceRequestSpec return new instance request spec
func TemplateFields ¶
func TemplateFields() []string
Types ¶
type CloudProviderNotFound ¶
type CloudProviderNotFound struct {
// contains filtered or unexported fields
}
CloudProviderNotFound error raised if tenant cloud not found
func (*CloudProviderNotFound) Error ¶
func (m *CloudProviderNotFound) Error() string
Error - return if cloud provider not found
type ClusterCreateApiReq ¶
type ClusterCreateApiReq struct { // Spec hold a pointer to specs.SpecCluster and must not be nil Spec *specs.SpecCluster // IsDryRun bool // IsBlocking bool // IsVerbose bool // isFixConflict if true , api create method will try to resolve cluster IP conflict. IsFixConflict bool }
ClusterCreateApiReq api request issued to create new cluster
type ClusterDeleteApiReq ¶
type ClusterDeleteApiReq struct { // cluster name or id Cluster string // IsBlocking bool // IsVerbose bool }
ClusterDeleteApiReq api request issued to delete cluster
type CnfMoveReq ¶
type CnfMoveReq struct {
NodeSelector HelmNodeSelector `yaml:"nodeSelector"`
}
type CreateInstanceApiReq ¶
type CreateInstanceApiReq struct { //InstanceName instance name InstanceName string //PoolName node pool name PoolName string //VimName target vim name VimName string //ClusterName target cluster name ClusterName string //IsBlocking block or async task IsBlocking bool // if blocking request require output progress IsVerbose bool // additional param AdditionalParam *specs.AdditionalParams //Namespace overwrite name Namespace string //RepoUsername overwrites Repo username RepoUsername string //RepoPassword overwrite Repo password RepoPassword string // RepoUrl overwrite Repo url RepoUrl string }
CreateInstanceApiReq - api request to create new cnf or vnf instance
type HelmNodeSelector ¶
type HelmNodeSelector struct {
Label string `yaml:"telco.vmware.com/nodepool"`
}
type NodePoolCreateApiReq ¶
type NodePoolCreateApiReq struct { // Spec is a specs.SpecNodePool Spec *specs.SpecNodePool // Cluster is cluster name or cluster id Cluster string // dry run or apply change IsDryRun bool // if node pool creation needs to block IsBlocking bool // if blocking request require output progress IsVerbose bool }
NodePoolCreateApiReq api request issued to create new node pool
type ResetInstanceApiReq ¶
type ResetInstanceApiReq struct { //InstanceName instance name or id InstanceName string //ClusterName target cluster name ClusterName string //IsBlocking block or async task IsBlocking bool // if a request is blocking, and caller requires output progress IsVerbose bool }
ResetInstanceApiReq api request to reset existing CNF or VNF instance.
type TaskCanceled ¶
type TaskCanceled struct {
ErrMsg string
}
func (*TaskCanceled) Error ¶
func (e *TaskCanceled) Error() string
type TaskNotFound ¶
type TaskNotFound struct {
ErrMsg string
}
func (*TaskNotFound) Error ¶
func (e *TaskNotFound) Error() string
type TcaApi ¶
type TcaApi struct {
// contains filtered or unexported fields
}
TcaApi - TCA Api interface Called need to use NewTcaApi to get instance before
func NewTcaApi ¶
func NewTcaApi(r *client.RestClient) (*TcaApi, error)
NewTcaApi - return instance for API.
func (*TcaApi) BlockWaitStateChange ¶
func (a *TcaApi) BlockWaitStateChange(ctx context.Context, instanceId string, waitFor string, maxRetry int, verbose bool) error
BlockWaitStateChange - simple block and pull status instanceId is instance that method will pull and check waitFor is target status method waits. maxRetry a limit.
func (*TcaApi) BlockWaitTaskFinish ¶
func (a *TcaApi) BlockWaitTaskFinish(ctx context.Context, task *models.TcaTask, waitFor string, maxRetry int, verbose bool) error
BlockWaitTaskFinish - simple block and pull status instanceId is instance that method will pull and check waitFor is target status method waits. maxRetry a limit.
func (*TcaApi) CnfMove ¶
func (a *TcaApi) CnfMove(ctx context.Context, instanceName string, moveReq *CnfMoveReq, isDry bool) error
CnfMove - reconfigure existing instance
func (*TcaApi) CnfReconfigure ¶
func (a *TcaApi) CnfReconfigure(ctx context.Context, instanceName string, valueFile string, vduName string, isDry bool) error
CnfReconfigure - reconfigure existing instance
func (*TcaApi) CreateCatalogEntity ¶
func (a *TcaApi) CreateCatalogEntity( fileName string, catalogName string, substitution map[string]string) (bool, error)
CreateCatalogEntity method create a new package it take file name that must compressed zip file package catalog name and a substitution map. substitution map used to replace CSAR values. a key of map is key in CSAR and value a new value that used to replace value in actual CSAR. i.e existing CSAR used as template and substitution map applied a transformation.
func (*TcaApi) CreateClusterTemplate ¶
func (a *TcaApi) CreateClusterTemplate(spec *specs.SpecClusterTemplate) (string, error)
CreateClusterTemplate - create cluster template from initialSpec
func (*TcaApi) CreateClusters ¶
func (a *TcaApi) CreateClusters(ctx context.Context, req *ClusterCreateApiReq) (*models.TcaTask, error)
CreateClusters - creates new cluster , in Dry Run method only will do specString validation. isBlocking will indicate if caller expects cluster task to finish. verbose will output status of each task, linked to specific cluster creation.
func (*TcaApi) CreateCnfInstance ¶
func (a *TcaApi) CreateCnfInstance(ctx context.Context, req *CreateInstanceApiReq) error
CreateCnfInstance - create cnf instance that already in running, not instantiated state or termination state. method take req *CreateInstanceApiReq
where InstanceName is instance that state must change poolName is target pool ClusterName a cluster that will be used to query and search instance.
func (*TcaApi) CreateCnfNewInstance ¶
func (a *TcaApi) CreateCnfNewInstance(ctx context.Context, n *specs.InstanceRequestSpec, isDry bool, isBlocked bool) (*response.LcmInfo, error)
CreateCnfNewInstance create a new instance of VNF or CNF. Dry run will validate request but will not create any CNF.
func (*TcaApi) CreateExtension ¶
CreateExtension api call create extension in TCA
func (*TcaApi) CreateNewNodePool ¶
func (a *TcaApi) CreateNewNodePool(ctx context.Context, req *NodePoolCreateApiReq) (*models.TcaTask, error)
CreateNewNodePool api call creates a new node pool for a given cluster name or id. both cluster can be named or ids. API call returns models.TcaTas that monitored. isDry run provide capability only validate specs without creating actual node pool.
func (*TcaApi) CreateSpecExample ¶
func (*TcaApi) CreateTenantProvider ¶
func (a *TcaApi) CreateTenantProvider(spec *specs.SpecCloudProvider) (*models.RegistrationRespond, error)
CreateTenantProvider method create, registers new target cloud provider as tenant infrastructure in TCA.
func (*TcaApi) DeleteCatalogEntity ¶
DeleteCatalogEntity api method deletes catalog entity
func (*TcaApi) DeleteCloudProvider ¶
DeleteCloudProvider method delete cloud provider note cloud provider must not contain any active clusters
func (*TcaApi) DeleteCluster ¶
func (a *TcaApi) DeleteCluster(ctx context.Context, req *ClusterDeleteApiReq) (*models.TcaTask, error)
DeleteCluster - Method deletes cluster, note in order delete it must not have anything running on it. In order delete management cluster, all tenant cluster must be deleted first.
func (*TcaApi) DeleteCnfInstance ¶
func (a *TcaApi) DeleteCnfInstance(ctx context.Context, instanceName string, vimName string, isForce bool) error
DeleteCnfInstance - deletes instance
func (*TcaApi) DeleteExtension ¶
DeleteExtension api call delete extension from tca return true
func (*TcaApi) DeleteNodePool ¶
func (a *TcaApi) DeleteNodePool(ctx context.Context, cluster string, nodePool string) (*models.TcaTask, error)
DeleteNodePool api call deletes node pool from a tenant cluster, cluster argument is cluster name or id. API call returns models.TcaTask that hold operation id that can be used for subsequent monitoring.
func (*TcaApi) DeleteTemplate ¶
DeleteTemplate deletes cluster template from TCA template argument can be name or ID.
func (*TcaApi) DeleteTenantCluster ¶
func (a *TcaApi) DeleteTenantCluster(ctx context.Context, tenantCluster string) (*models.TcaTask, error)
DeleteTenantCluster - deletes tenant cluster it accept just name or id.
func (*TcaApi) DeleteTenantsProvider ¶
func (a *TcaApi) DeleteTenantsProvider(ctx context.Context, tenantCluster string) (*models.TcaTask, error)
DeleteTenantsProvider delete a tenant attached to cloud provide.
func (*TcaApi) ExtensionQuery ¶
ExtensionQuery - query for all extension api
func (*TcaApi) GetAllInstances ¶
func (a *TcaApi) GetAllInstances() (*response.CnfsExtended, error)
GetAllInstances api method returns a list of CNF/VNF instances in response.CnfsExtended that encapsulate in collection
func (*TcaApi) GetAllNodePool ¶
GetAllNodePool return a Node pool for particular cluster It generally useful to get list only if we need to display all in all other cases it efficient to use direct call for cluster.
func (*TcaApi) GetAllNodePools ¶
GetAllNodePools - return all node pool for clusterId
func (*TcaApi) GetAllPackages ¶
func (a *TcaApi) GetAllPackages() (*response.CnfsExtended, error)
GetAllPackages return all catalog entries as response.CnfsExtended object
func (*TcaApi) GetAuthorization ¶
GetAuthorization retrieve API key from TCA and update internal state.
func (*TcaApi) GetBaseUrl ¶
GetBaseUrl set base url for TCA API client interface.
func (*TcaApi) GetCatalogAndVdu ¶
func (a *TcaApi) GetCatalogAndVdu(nfdName string) (*response.VnfPackage, *response.VduPackage, error)
GetCatalogAndVdu API method returns catalog entity and vdu package.
func (*TcaApi) GetCatalogId ¶
GetCatalogId return vnf Package ID and VNFD ID
func (*TcaApi) GetCluster ¶
GetCluster - method retrieve cluster information
func (*TcaApi) GetClusterNodePool ¶
func (a *TcaApi) GetClusterNodePool(ctx context.Context, clusterId string, nodePoolId string) (*response.NodesSpecs, error)
GetClusterNodePool - API Method lookup clusters node pool. clusterId is identified either a name or UUID. nodePoolId is identifier either a name or UUID.
func (*TcaApi) GetClusterNodePools ¶
GetClusterNodePools - return node pool for a given id.
func (*TcaApi) GetClusterTask ¶
func (a *TcaApi) GetClusterTask(ctx context.Context, clusterId string, showChildren bool) (*models.ClusterTask, error)
GetClusterTask method return list task models.ClusterTask currently executing on given cluster
func (*TcaApi) GetClusterTemplate ¶
func (a *TcaApi) GetClusterTemplate(templateId string) (*response.ClusterTemplateSpec, error)
GetClusterTemplate return cluster template
func (*TcaApi) GetClusterTemplates ¶
func (a *TcaApi) GetClusterTemplates() (*response.ClusterTemplates, error)
GetClusterTemplates - return list of cluster templates
func (*TcaApi) GetClusters ¶
GetClusters get cluster
func (*TcaApi) GetConsumption ¶
GetConsumption - return lic consumption
func (*TcaApi) GetCurrentClusterTask ¶
func (a *TcaApi) GetCurrentClusterTask(ctx context.Context, clusterId string) (*models.ClusterTask, error)
GetCurrentClusterTask get current cluster task
func (*TcaApi) GetEntireCatalog ¶
func (a *TcaApi) GetEntireCatalog() (*response.VnfPackages, error)
GetEntireCatalog - api call return entire TCA catalog.
func (*TcaApi) GetExtension ¶
GetExtension api call return extension register in TCA NameOrId is name of extension or id. If name provided method need resolve name to id first.
func (*TcaApi) GetExtensions ¶
GetExtensions returns all extension registered in TCA This method useful if we need find Harbor or any other extension for example attached to particular VIM
func (*TcaApi) GetFilteredExtension ¶
GetFilteredExtension retrieve repos by tenant id
func (*TcaApi) GetInstance ¶
func (*TcaApi) GetLcmActions ¶
func (a *TcaApi) GetLcmActions(ctx context.Context, instanceName string) (*models.PolicyLinks, error)
GetLcmActions return list of available actions in current state
func (*TcaApi) GetNamedClusterTemplate ¶
func (a *TcaApi) GetNamedClusterTemplate(name string) (*response.ClusterTemplateSpec, error)
GetNamedClusterTemplate - return template if name is string first resolve template
func (*TcaApi) GetNodePool ¶
GetNodePool api method returns a Node pool response.NodePool lookup based on cluster id or cluster name
func (*TcaApi) GetTenant ¶
GetTenant method return tenant as response.Tenants if tenant is name, method will lookup by name. if tenant is UUID it will lookup by id if it has prefix vmware it will lookup by VIM id.
func (*TcaApi) GetTenantsQuery ¶
GetTenantsQuery query tenant information based on tenant id and package id
func (*TcaApi) GetVdu ¶
func (a *TcaApi) GetVdu(nfdName string) (*response.VduPackage, error)
GetVdu retrieve Vdu
func (*TcaApi) GetVimComputeClusters ¶
func (a *TcaApi) GetVimComputeClusters(ctx context.Context, cloudName string) (*models.VMwareClusters, error)
GetVimComputeClusters - return compute cluster attached to VIM For example VMware VIM is vCenter.
func (*TcaApi) GetVimFolders ¶
GetVimFolders - return folders in target cloud provider. for VMware VC it list of VM Folders, models.Folders
func (*TcaApi) GetVimNetworks ¶
func (a *TcaApi) GetVimNetworks(ctx context.Context, cloudName string) (*models.CloudNetworks, error)
GetVimNetworks - method return network attached to vim, cloud provider, for a VMware vim it is a full path to object.
func (*TcaApi) GetVimResourcePool ¶
func (a *TcaApi) GetVimResourcePool(ctx context.Context, cloudName string) (*models.ResourcePool, error)
GetVimResourcePool - return resource pool in target VIM. caller need indicate template type and version.
func (*TcaApi) GetVimTenants ¶
GetVimTenants method return vim tenants as response.Tenants collection.
func (*TcaApi) GetVimVMTemplates ¶
func (a *TcaApi) GetVimVMTemplates(ctx context.Context, cloudName string, templateType VmTemplateFilterType, ver string) (*models.VcInventory, error)
GetVimVMTemplates - return compute cluster attached to cloud provider. caller need indicate template type and version.
func (*TcaApi) GetVnfPkgm ¶
GetVnfPkgm - return catalog entity pkgId is id of package in TCA filter
func (*TcaApi) NormalizeTemplateId ¶
NormalizeTemplateId - resolve template name to id for a give template type. Both must match in order method return ture
func (*TcaApi) ResetState ¶
func (a *TcaApi) ResetState(ctx context.Context, req *ResetInstanceApiReq) error
ResetState reset instance state.
func (*TcaApi) ResolveClusterName ¶
ResolveClusterName - resolve cluster name to cluster id and return a string version. TCA use UUID format for ID.
func (*TcaApi) ResolveExtensionId ¶
ResolveExtensionId method resolve Name or Id to extension if extension already valid id it no op
func (*TcaApi) ResolveInstanceName ¶
ResolveInstanceName resolve instance name to id
func (*TcaApi) ResolveManagementCluster ¶
func (a *TcaApi) ResolveManagementCluster(NameOrId string, tenants *response.Clusters) (*response.ClusterSpec, error)
ResolveManagementCluster mgmt cluster
func (*TcaApi) ResolvePoolAndCluster ¶
func (a *TcaApi) ResolvePoolAndCluster(ctx context.Context, cluster string, nodePool string) (string, string, error)
ResolvePoolAndCluster - api method resolves cluster and node pool in pair return cluster id and pool id or error
func (*TcaApi) ResolvePoolId ¶
func (a *TcaApi) ResolvePoolId(ctx context.Context, poolName string, clusterScope ...string) (string, error)
ResolvePoolId method resolves pool name to pool id
func (*TcaApi) ResolvePoolName ¶
func (a *TcaApi) ResolvePoolName(ctx context.Context, poolName string, clusterName string) (string, string, error)
ResolvePoolName - method resolves pool name to id for a requested cluster. pool name is named pool and cluster is name or uuid
func (*TcaApi) ResolveTemplateId ¶
ResolveTemplateId - resolves template name to id
func (*TcaApi) ResolveVim ¶
ResolveVim resolve vim name to id
func (*TcaApi) ResolveVimId ¶
func (*TcaApi) ResolveVimName ¶
ResolveVimName resolve name to id
func (*TcaApi) RollbackCnf ¶
func (a *TcaApi) RollbackCnf(ctx context.Context, instanceName string, doBlock bool, verbose bool) error
RollbackCnf rollbacks instance if flag delete provide will also delete.
func (*TcaApi) SetPassword ¶
SetPassword - set password for TCA API client interface.
func (*TcaApi) SetUsername ¶
SetUsername - sets username for TCA API client interface.
func (*TcaApi) TenantsCloudProvider ¶
TenantsCloudProvider return a tenant attached to cloud provide for lookup query string
func (*TcaApi) TerminateCnfInstance ¶
func (a *TcaApi) TerminateCnfInstance(ctx context.Context, req *TerminateInstanceApiReq) error
TerminateCnfInstance method terminate cnf instance caller need provider either name or uuid and vimName doBlock block and wait task to finish verbose output status on screen after each pool timer.
func (*TcaApi) UpdateClusterTemplate ¶
func (a *TcaApi) UpdateClusterTemplate(spec *specs.SpecClusterTemplate) error
UpdateClusterTemplate - updates cluster template based on input initialSpec
func (*TcaApi) UpdateCnfState ¶
func (a *TcaApi) UpdateCnfState(ctx context.Context, req *UpdateInstanceApiReq) (*response.InstanceUpdate, error)
UpdateCnfState update instance state.
func (*TcaApi) UpdateExtension ¶
UpdateExtension api call delete extension from TCA
func (*TcaApi) UpdateNodePool ¶
func (a *TcaApi) UpdateNodePool(ctx context.Context, req *NodePoolCreateApiReq) (*models.TcaTask, error)
UpdateNodePool api call updates a node pool for a existing cluster or node pool. Both cluster and node pool can be a pool name or pool ids.
API call returns models.TcaTask that hold operation id. req *NodePoolCreateApiReq field
isDry run provide capability to validate specs without applying any changes. isBlocking will block and wait when all task finish or fail. isVerbose flag will output progress message during each pool interval.
type TcaTaskFailed ¶
type TcaTaskFailed struct {
ErrMsg string
}
func (*TcaTaskFailed) Error ¶
func (e *TcaTaskFailed) Error() string
type TcaTaskStateType ¶
type TcaTaskStateType int
const ( // Instantiate CNF/VNF instantiated Instantiate TcaTaskStateType = 1 << iota // Terminated CNF/VNF terminated Terminated // Completed task competed Completed )
TODO move all state
type TerminateInstanceApiReq ¶
type TerminateInstanceApiReq struct { //InstanceName instance name InstanceName string //ClusterName target cluster name ClusterName string //IsBlocking block or async task IsBlocking bool // if blocking request require output progress IsVerbose bool }
TerminateInstanceApiReq - api request to terminate CNF or VNF instance.
type UnsupportedCloudProvider ¶
type UnsupportedCloudProvider struct {
// contains filtered or unexported fields
}
UnsupportedCloudProvider error raised if tenant cloud not found
func (*UnsupportedCloudProvider) Error ¶
func (m *UnsupportedCloudProvider) Error() string
type UpdateInstanceApiReq ¶
type UpdateInstanceApiReq struct { // UpdateReq *specs.LcmInstantiateRequest //InstanceName instance name InstanceName string //PoolName node pool name PoolName string //ClusterName target cluster name ClusterName string //IsBlocking block or async task IsBlocking bool // if a request is blocking, and caller requires output progress IsVerbose bool }
UpdateInstanceApiReq api request to update a LCM state of existing CNF or VNF instance.
type VmTemplateFilterType ¶
type VmTemplateFilterType string