Documentation ¶
Overview ¶
Package client 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 client 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 client 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 client 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 client 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 client 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 client 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 client 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 client 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 client 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 client 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 client 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 client 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
- type AuthorizationReq
- type ErrorResponse
- type ErrorsResponse
- type ExtensionDeleteReplay
- type ExtensionUpdateReplay
- type PackageCreateError
- type PackageCreatedSuccess
- type PackageUpload
- type PasswordUpdateSpec
- type RestClient
- func (c *RestClient) AddFailureCondition(s string)
- func (c *RestClient) CnfResetState(ctx context.Context, href string) error
- func (c *RestClient) CnfRollback(ctx context.Context, href string) error
- func (c *RestClient) CreateCluster(spec *specs.SpecCluster) (*models.TcaTask, error)
- func (c *RestClient) CreateClusterTemplate(spec *specs.SpecClusterTemplate) error
- func (c *RestClient) CreateExtension(ctx context.Context, spec *specs.SpecExtension) (string, error)
- func (c *RestClient) CreateInstance(ctx context.Context, req *specs.LcmCreateRequest) (*response.VNFInstantiate, error)
- func (c *RestClient) CreateNewNodePool(r *specs.SpecNodePool, clusterId string) (*models.TcaTask, error)
- func (c *RestClient) CreateVnfPkgmVnfd(pkg *PackageUpload) (*PackageCreatedSuccess, error)
- func (c *RestClient) DeleteCluster(ctx context.Context, clusterId string) (*models.TcaTask, error)
- func (c *RestClient) DeleteClusterTemplate(clusterId string) error
- func (c *RestClient) DeleteExtension(ctx context.Context, extensionId string) (bool, error)
- func (c *RestClient) DeleteInstance(ctx context.Context, id string) error
- func (c *RestClient) DeleteNodePool(clusterId string, nodePoolId string) (*models.TcaTask, error)
- func (c *RestClient) DeleteTenant(tenantCluster string) (*models.TcaTask, error)
- func (c *RestClient) DeleteVnfPkgmVnfd(pkgId string) (bool, error)
- func (c *RestClient) GetAllCatalog() (*response.VnfPackages, error)
- func (c *RestClient) GetApiKey() string
- func (c *RestClient) GetAuthorization() (bool, error)
- func (c *RestClient) GetChart(chartName string) (bool, error)
- func (c *RestClient) GetCharts() ([]response.HelmChart, error)
- func (c *RestClient) GetClient()
- func (c *RestClient) GetCluster(ctx context.Context, clusterId string) (*response.ClusterSpec, error)
- func (c *RestClient) GetClusterCompatability() (*SupportedVersion, error)
- func (c *RestClient) GetClusterNodePool(clusterId string, nodePoolId string) (*response.NodesSpecs, error)
- func (c *RestClient) GetClusterNodePools(clusterId string) (*response.NodePool, error)
- func (c *RestClient) GetClusterTask(ctx context.Context, clusterId string) (*models.ClusterTask, error)
- func (c *RestClient) GetClusterTemplate(clusterId string) (*response.ClusterTemplateSpec, error)
- func (c *RestClient) GetClusterTemplates() (*response.ClusterTemplates, error)
- func (c *RestClient) GetClusters(ctx context.Context) (*response.Clusters, error)
- func (c *RestClient) GetClustersTask(ctx context.Context, f *specs.ClusterTaskQuery) (*models.ClusterTask, error)
- func (c *RestClient) GetConsumption(ctx context.Context) (*models.ConsumptionResp, error)
- func (c *RestClient) GetExtension(ctx context.Context, eid string) (*response.Extensions, error)
- func (c *RestClient) GetExtensions(ctx context.Context) (*response.Extensions, error)
- func (c *RestClient) GetInfraNetworks(tenantId string) (*models.CloudNetworks, error)
- func (c *RestClient) GetNamedClusterNodePools(ctx context.Context, clusterName string) (*response.NodePool, string, error)
- func (c *RestClient) GetPackageCatalogId(IdOrName string) (string, string, error)
- func (c *RestClient) GetRepos() ([]response.Repos, error)
- func (c *RestClient) GetRepositoriesQuery(query *specs.RepoQuery) (*response.ReposList, error)
- func (c *RestClient) GetRunningVnflcm(instanceId string) (*response.LcmInfo, error)
- func (c *RestClient) GetTenantsQuery(f *specs.TenantsNfFilter) (*response.Tenants, error)
- func (c *RestClient) GetVMwareFolders(f *specs.VmwareFolderQuery) (*models.Folders, error)
- func (c *RestClient) GetVMwareInfraContainers(ctx context.Context, clusterId string) (*models.VmwareContainerView, error)
- func (c *RestClient) GetVMwareResourcePool(ctx context.Context, f *specs.VMwareResourcePoolQuery) (*models.ResourcePool, error)
- func (c *RestClient) GetVMwareTemplates(ctx context.Context, f *specs.VMwareTemplateQuery) (*models.VcInventory, error)
- func (c *RestClient) GetVim(ctx context.Context, vimId string) (*response.TenantSpecs, error)
- func (c *RestClient) GetVimTenants(ctx context.Context) (*response.Tenants, error)
- func (c *RestClient) GetVmwareCluster(ctx context.Context, f *specs.ClusterFilterQuery) (*models.VMwareClusters, error)
- func (c *RestClient) GetVmwareNetworks(ctx context.Context, f *specs.VMwareNetworkQuery) (*models.CloudNetworks, error)
- func (c *RestClient) GetVnfPkgm(filter string, catalogId string) (*response.VnfPackages, error)
- func (c *RestClient) GetVnfPkgmVnfd(pkgId string) (*response.VduPackage, error)
- func (c *RestClient) GetVnflcm(req ...string) (interface{}, error)
- func (c *RestClient) HarborAuthenticate() (bool, error)
- func (c *RestClient) InstanceInstantiate(ctx context.Context, instanceId string, req specs.LcmInstantiateRequest) error
- func (c *RestClient) InstanceReconfigure(ctx context.Context, r *specs.LcmReconfigureRequest, id string) error
- func (c *RestClient) InstanceUpdateState(ctx context.Context, instanceId string, req *specs.LcmInstantiateRequest) (*response.InstanceUpdate, error)
- func (c *RestClient) IsSimulateFailure(f string) bool
- func (c *RestClient) LinkedRepositories(tenantId string, repo string) (string, error)
- func (c *RestClient) NodePoolAbortTask(taskId string) (*models.TcaTask, error)
- func (c *RestClient) NodePoolRetryTask(taskId string) (*models.TcaTask, error)
- func (c *RestClient) RegisterCloudProvider(r *specs.SpecCloudProvider) (*models.RegistrationRespond, error)
- func (c *RestClient) RepositoriesQuery(query *specs.RepoQuery) (*response.ReposList, error)
- func (c *RestClient) SetDumpRespond(dumpRespond bool)
- func (c *RestClient) SetSimulateFailure(fail bool)
- func (c *RestClient) SetTrace(trace bool)
- func (c *RestClient) TerminateInstance(terminateUri string, terminateReq *specs.LcmTerminateRequest) error
- func (c *RestClient) UpdateClusterPassword(req *PasswordUpdateSpec, clusterId string) (*models.TcaTask, error)
- func (c *RestClient) UpdateClusterTemplate(spec *specs.SpecClusterTemplate) error
- func (c *RestClient) UpdateExtension(ctx context.Context, spec *specs.SpecExtension, eid string) (bool, error)
- func (c *RestClient) UpdateNodePool(r *specs.SpecNodePool, clusterId string, nodePoolId string) (*models.TcaTask, error)
- func (c *RestClient) UpgradeNodePool(clusterId string, nodePoolId string) (*models.TcaTask, error)
- func (c *RestClient) UploadHelm(csar []byte, fileName string) (bool, error)
- func (c *RestClient) UploadVnfPkgmVnfd(pkgId string, csar []byte, name string) (bool, error)
- type SuccessResponse
- type SupportedVersion
- type TaskNotFound
Constants ¶
const ( // TcaDeleteTenant - api call delete tenant TcaDeleteTenant = "/hybridity/api/vims/v1/tenants/%s" TcaVimTenant = "/hybridity/api/vims/v1/%s/tenants" // TcaInfraCluster api endpoint clusters api. TcaInfraCluster = "/hybridity/api/infra/k8s/cluster" // TcaInfraClusters - api clusters TcaInfraClusters = "/hybridity/api/infra/k8s/clusters" // TcaInfraClusterTask - api cluster task TcaInfraClusterTask = "/hybridity/api/infra/k8s/tasks" // TcaClusterTask - API query current cluster task TcaClusterTask = "/hybridity/api/infra/k8s/clusters/%s/tasks" // TcaApiVnfLcmExtensionVnfInstance api return vnf instance TcaApiVnfLcmExtensionVnfInstance = "/telco/api/vnflcm/v2/extension/vnf_instances" TcaApiVnfLcmVnfInstance = "/telco/api/vnflcm/v2/vnf_instances" // TcaVmwareExtensions extensions api TcaVmwareExtensions = "/hybridity/api/extensions" // TcaVmwareGetExtensions api call deletes extension TcaVmwareGetExtensions = "/hybridity/api/extensions/%s" // TcaVmwareDeleteExtensions api call deletes extension TcaVmwareDeleteExtensions = "/hybridity/api/extensions/%s" // TcaVmwareUpdateExtensions api call deletes extension TcaVmwareUpdateExtensions = "/hybridity/api/extensions/%s" //TcaVmwareExtensionsTypes extensions types TcaVmwareExtensionsTypes = "/hybridity/api/extensions/types" // TcaVmwareNfvNetworks api request to get networks TcaVmwareNfvNetworks = "/hybridity/api/nfv/networks" // TcaVmwareRepositories - getter for repositories TcaVmwareRepositories = "/hybridity/api/repositories/query" // TcaVmwareRepos rest call to manipulate repositories TcaVmwareRepos = "/hybridity/api/repositories" // TcaVmwarePackagesActionContent pacakge content suffix TcaVmwarePackagesActionContent = "package_content" // TcaVmwareTelcoPackages api endpoint for vnf packages. TcaVmwareTelcoPackages = "/telco/api/vnfpkgm/v2/vnf_packages" // TcaVmwareVnflcmInstances api endpoint LCM instances TcaVmwareVnflcmInstances = "/telco/api/vnflcm/v2/vnf_instances" // TcaVmwareVnflcmInstance operation on instance TcaVmwareVnflcmInstance = "/telco/api/vnflcm/v2/vnf_instances/%s" TcaVmwareVnflcmInstanceScale = "/telco/api/vnflcm/v2/vnf_instances/%s/scale" //TcaVmwareVnflcmInstantiate instantiate TcaVmwareVnflcmInstantiate = "/telco/api/vnflcm/v2/vnf_instances/%s/instantiate" //TcaVmwareVnflcmUpdate update state TcaVmwareVnflcmUpdate = "/hybridity/api/vnflcm/v1/vnf_instances/%s/update_state" // TcaInfraPoolRetry Retry task TcaInfraPoolRetry = "/hybridity/api/infra/k8s/operations/%s/retry" // TcaInfraPoolAbort abort task TcaInfraPoolAbort = "/hybridity/api/infra/k8s/operations/%s/abort" // TcaInfraCreatPool API call create node pool on target cluster TcaInfraCreatPool = "/hybridity/api/infra/k8s/cluster/%s/nodepool" TcaClustersNodePool = "/hybridity/api/infra/k8s/cluster/%s/nodepool/%s" // TcaInfraDeletePool API call delete Node pool TcaInfraDeletePool = TcaClustersNodePool // TcaInfraUpdatePool API call update Node pool TcaInfraUpdatePool = "/hybridity/api/infra/k8s/cluster/%s/nodepool/%s" // TcaClustersNodePoolUpgrade upgrade existing node pool TcaClustersNodePoolUpgrade = "/hybridity/infra/k8s/cluster/%s/nodepool/%s/upgrade" // TcaInfraSupportedVer return list of supported version TcaInfraSupportedVer = "/hybridity/api/infra/k8s/supportedK8sVersions" // TcaClusterChangePassword change password for existing cluster TcaClusterChangePassword = "/hybridity/api/infra/k8s/clusters/%s/changePassword" // TcaConsumption return consumption TcaConsumption = "/hybridity/api/licensing/consumption" )
const ( HarborChartRepo = "/api/chartrepo/library/charts" HarborRepos = "/api/v2.0/projects/library/repositories" )
const ( // TcaVmwareClusters VMware clusters TcaVmwareClusters = "/hybridity/api/infra/inventory/vc/clusters" // TcaVmwareVmTemplates VMware VM templates TcaVmwareVmTemplates = "/hybridity/api/infra/inventory/vc/templates" // TcaVmwareNetworks VMware virtual networks TcaVmwareNetworks = "/hybridity/api/nfv/networks" // TcaVmwareVmContainers VMware container view TcaVmwareVmContainers = "/hybridity/api/service/inventory/containers" // TcaServiceVmwareVmContainers Vmware service container TcaServiceVmwareVmContainers = "/api/service/inventory/containers" )
const ( UploadMultipartContentType = "application/zip" MultipartFilePart = "file" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthorizationReq ¶
type AuthorizationReq struct { Username string `json:"username" yaml:"username"` Password string `json:"password" yaml:"password"` }
AuthorizationReq - json body for authorization
type ErrorResponse ¶
type ErrorsResponse ¶
type ErrorsResponse struct {
ErrorResponses []ErrorResponse `json:"errors" yaml:"errors"`
}
func (*ErrorsResponse) GetErrors ¶
func (e *ErrorsResponse) GetErrors() []string
GetErrors - return all errors in single array
type ExtensionDeleteReplay ¶
type ExtensionUpdateReplay ¶
type PackageCreateError ¶
type PackageCreatedSuccess ¶
type PackageCreatedSuccess struct { // Id all operation to existing catalog must use this ID Id string `json:"id" yaml:"id"` // OnboardingState state OnboardingState string `json:"onboardingState" yaml:"onboardingState"` OperationalState string `json:"operationalState" yaml:"operationalState"` UsageState string `json:"usageState" yaml:"usageState"` VnfmInfo []interface{} `json:"vnfmInfo" yaml:"vnfmInfo"` UserDefinedData struct { Name string `json:"name" yaml:"name"` Tags []interface{} `json:"tags" yaml:"tags"` } `json:"userDefinedData" yaml:"userDefinedData"` // Links re-present a link that caller can use to execute update, delete operation Links struct { Self struct { Href string `json:"href" yaml:"href"` } `json:"self" yaml:"self"` } `json:"_links" yaml:"links"` }
PackageCreatedSuccess - when package created, TCA respond with Success message.
type PackageUpload ¶
type PackageUpload struct { // UserDefinedData name is mandatory element for upload request. UserDefinedData struct { Name string `json:"name" yaml:"name"` Tags []interface{} `json:"tags" yaml:"tags"` } `json:"userDefinedData"` }
PackageUpload - Package Upload REST request. it contains name and optional tag
func NewPackageUpload ¶
func NewPackageUpload(packageName string) *PackageUpload
NewPackageUpload creates a new Package Upload REST request object
type PasswordUpdateSpec ¶
type RestClient ¶
type RestClient struct { // BaseURL TCA Base API endpoint BaseURL string // SkipSsl in case client need skip self sign cert check SkipSsl bool // Client rest client Client *resty.Client // Username tca username Username string // Password tca password Password string // CertFile path to cert "certs/client.pem" CertFile string // CertKey path to cert key "certs/client.key" CertKey string // set debug mode IsDebug bool // contains filtered or unexported fields }
func NewRestClient ¶
func NewRestClient(baseURL string, skipSsl bool, username string, password string) (*RestClient, error)
NewRestClient return a new rest client.
func (*RestClient) AddFailureCondition ¶
func (c *RestClient) AddFailureCondition(s string)
func (*RestClient) CnfResetState ¶
func (c *RestClient) CnfResetState(ctx context.Context, href string) error
CnfResetState action
func (*RestClient) CnfRollback ¶
func (c *RestClient) CnfRollback(ctx context.Context, href string) error
CnfRollback rest api action, rollback
func (*RestClient) CreateCluster ¶
func (c *RestClient) CreateCluster(spec *specs.SpecCluster) (*models.TcaTask, error)
CreateCluster - create new management and or tenant cluster TCA require first create management cluster before any tenant cluster created. TCA also require each type of cluster has valid template. raw rest call doesn't do any validation, while API interface does basic validation check for spec.
func (*RestClient) CreateClusterTemplate ¶
func (c *RestClient) CreateClusterTemplate(spec *specs.SpecClusterTemplate) error
CreateClusterTemplate - creates cluster template from json or yaml specs.
func (*RestClient) CreateExtension ¶
func (c *RestClient) CreateExtension(ctx context.Context, spec *specs.SpecExtension) (string, error)
CreateExtension - method creates new extension spec can contain optional VimInfo that indicates cluster or cluster where extension will be attach.
func (*RestClient) CreateInstance ¶
func (c *RestClient) CreateInstance(ctx context.Context, req *specs.LcmCreateRequest) (*response.VNFInstantiate, error)
CreateInstance vnf instances
func (*RestClient) CreateNewNodePool ¶
func (c *RestClient) CreateNewNodePool(r *specs.SpecNodePool, clusterId string) (*models.TcaTask, error)
CreateNewNodePool api method create a new node pool for a target cluster, method return models.TcaTask that progress can be monitored.
func (*RestClient) CreateVnfPkgmVnfd ¶
func (c *RestClient) CreateVnfPkgmVnfd(pkg *PackageUpload) (*PackageCreatedSuccess, error)
CreateVnfPkgmVnfd - create a new CNF/VNF package Note this call only creates catalog entry, entity disabled when it created.
func (*RestClient) DeleteCluster ¶
DeleteCluster - delete k8s clusters. ( Management and tenant workload) note Management cluster can't deleted if there are workload clusters already attached. Method return models.TcaTask that can monitored.
func (*RestClient) DeleteClusterTemplate ¶
func (c *RestClient) DeleteClusterTemplate(clusterId string) error
DeleteClusterTemplate - deletes cluster template
func (*RestClient) DeleteExtension ¶
DeleteExtension - api call deletes extension Method returns true if extension deleted.
func (*RestClient) DeleteInstance ¶
func (c *RestClient) DeleteInstance(ctx context.Context, id string) error
DeleteInstance - delete cnf instance.
func (*RestClient) DeleteNodePool ¶
DeleteNodePool - delete a note pool
func (*RestClient) DeleteTenant ¶
func (c *RestClient) DeleteTenant(tenantCluster string) (*models.TcaTask, error)
DeleteTenant delete tenant cluster
func (*RestClient) DeleteVnfPkgmVnfd ¶
func (c *RestClient) DeleteVnfPkgmVnfd(pkgId string) (bool, error)
DeleteVnfPkgmVnfd - delete package
func (*RestClient) GetAllCatalog ¶
func (c *RestClient) GetAllCatalog() (*response.VnfPackages, error)
GetAllCatalog TCA api call return entire catalog
func (*RestClient) GetApiKey ¶
func (c *RestClient) GetApiKey() string
GetApiKey TCA return api key , it used for authentication.
func (*RestClient) GetAuthorization ¶
func (c *RestClient) GetAuthorization() (bool, error)
GetAuthorization retrieve API key from TCA and update internal state.
func (*RestClient) GetChart ¶
func (c *RestClient) GetChart(chartName string) (bool, error)
GetChart -
func (*RestClient) GetCharts ¶
func (c *RestClient) GetCharts() ([]response.HelmChart, error)
GetCharts - return all charts
func (*RestClient) GetCluster ¶
func (c *RestClient) GetCluster(ctx context.Context, clusterId string) (*response.ClusterSpec, error)
GetCluster returns infrastructure k8s clusters
func (*RestClient) GetClusterCompatability ¶
func (c *RestClient) GetClusterCompatability() (*SupportedVersion, error)
GetClusterCompatability returns k8s node pool detail.
func (*RestClient) GetClusterNodePool ¶
func (c *RestClient) GetClusterNodePool(clusterId string, nodePoolId string) (*response.NodesSpecs, error)
GetClusterNodePool returns k8s node pool detail.
func (*RestClient) GetClusterNodePools ¶
func (c *RestClient) GetClusterNodePools(clusterId string) (*response.NodePool, error)
GetClusterNodePools - returns cluster k8s node pools list each list hold specs, caller need indicate valid cluster ID not a name.
func (*RestClient) GetClusterTask ¶
func (c *RestClient) GetClusterTask(ctx context.Context, clusterId string) (*models.ClusterTask, error)
GetClusterTask returns k8s execution current task.
func (*RestClient) GetClusterTemplate ¶
func (c *RestClient) GetClusterTemplate(clusterId string) (*response.ClusterTemplateSpec, error)
GetClusterTemplate - return list of cluster templates
func (*RestClient) GetClusterTemplates ¶
func (c *RestClient) GetClusterTemplates() (*response.ClusterTemplates, error)
GetClusterTemplates - return list of all cluster templates
func (*RestClient) GetClusters ¶
GetClusters returns infrastructure k8s clusters
func (*RestClient) GetClustersTask ¶
func (c *RestClient) GetClustersTask(ctx context.Context, f *specs.ClusterTaskQuery) (*models.ClusterTask, error)
GetClustersTask - returns infrastructure k8s clusters task list Before adjusting cluster task , caller must first check existing task list. each task can fail.
func (*RestClient) GetConsumption ¶
func (c *RestClient) GetConsumption(ctx context.Context) (*models.ConsumptionResp, error)
func (*RestClient) GetExtension ¶
func (c *RestClient) GetExtension(ctx context.Context, eid string) (*response.Extensions, error)
GetExtension - api call retrieves extension, eid is internal extension id.
func (*RestClient) GetExtensions ¶
func (c *RestClient) GetExtensions(ctx context.Context) (*response.Extensions, error)
GetExtensions - api call retrieves all extension. client cna filter on particular field, VIM Id , type etc.
func (*RestClient) GetInfraNetworks ¶
func (c *RestClient) GetInfraNetworks(tenantId string) (*models.CloudNetworks, error)
GetInfraNetworks - return list of cluster templates TODO
func (*RestClient) GetNamedClusterNodePools ¶
func (c *RestClient) GetNamedClusterNodePools(ctx context.Context, clusterName string) (*response.NodePool, string, error)
GetNamedClusterNodePools method first resolves cluster name and than look up node pool list attached to a given cluster.
func (*RestClient) GetPackageCatalogId ¶
func (c *RestClient) GetPackageCatalogId(IdOrName string) (string, string, error)
GetPackageCatalogId api return vnf package id and vnfd id
func (*RestClient) GetRepos ¶
func (c *RestClient) GetRepos() ([]response.Repos, error)
GetRepos - return all charts
func (*RestClient) GetRepositoriesQuery ¶
GetRepositoriesQuery - query repositories linked to vim
func (*RestClient) GetRunningVnflcm ¶
func (c *RestClient) GetRunningVnflcm(instanceId string) (*response.LcmInfo, error)
GetRunningVnflcm rest call return state of CNF or VNF state described as response.LcmInfo
func (*RestClient) GetTenantsQuery ¶
func (c *RestClient) GetTenantsQuery(f *specs.TenantsNfFilter) (*response.Tenants, error)
GetTenantsQuery returns list of cloud provider attached to TCA. tenant filter , filter result
func (*RestClient) GetVMwareFolders ¶
func (c *RestClient) GetVMwareFolders(f *specs.VmwareFolderQuery) (*models.Folders, error)
GetVMwareFolders - return VMware folder view Typically Query filters based on cloud provider id.
func (*RestClient) GetVMwareInfraContainers ¶
func (c *RestClient) GetVMwareInfraContainers(ctx context.Context, clusterId string) (*models.VmwareContainerView, error)
GetVMwareInfraContainers - Call for VC cluster container
func (*RestClient) GetVMwareResourcePool ¶
func (c *RestClient) GetVMwareResourcePool(ctx context.Context, f *specs.VMwareResourcePoolQuery) (*models.ResourcePool, error)
GetVMwareResourcePool return VMware resource view Typically Query filters based on cloud provider id.
func (*RestClient) GetVMwareTemplates ¶
func (c *RestClient) GetVMwareTemplates(ctx context.Context, f *specs.VMwareTemplateQuery) (*models.VcInventory, error)
GetVMwareTemplates - return VMware VM templates Typically Query filters based on cloud provider id.
func (*RestClient) GetVim ¶
func (c *RestClient) GetVim(ctx context.Context, vimId string) (*response.TenantSpecs, error)
GetVim return vim attached to TCA vimId in format vmware_FB40D3DE2967483FBF9033B451DC7571
func (*RestClient) GetVimTenants ¶
GetVimTenants return list of all cloud provider attached to TCA
func (*RestClient) GetVmwareCluster ¶
func (c *RestClient) GetVmwareCluster(ctx context.Context, f *specs.ClusterFilterQuery) (*models.VMwareClusters, error)
func (*RestClient) GetVmwareNetworks ¶
func (c *RestClient) GetVmwareNetworks(ctx context.Context, f *specs.VMwareNetworkQuery) (*models.CloudNetworks, error)
GetVmwareNetworks - return query for vmware network list
func (*RestClient) GetVnfPkgm ¶
func (c *RestClient) GetVnfPkgm(filter string, catalogId string) (*response.VnfPackages, error)
GetVnfPkgm gets VNF/CNF catalog entity pkgId is catalog id and filter is optional argument is filter query
func (*RestClient) GetVnfPkgmVnfd ¶
func (c *RestClient) GetVnfPkgmVnfd(pkgId string) (*response.VduPackage, error)
GetVnfPkgmVnfd return CNF/VNF catalog entity.
func (*RestClient) GetVnflcm ¶
func (c *RestClient) GetVnflcm(req ...string) (interface{}, error)
GetVnflcm - Retrieves information about a CNF/VNF instance by reading an "Individual VNF instance" resource.
Example of filter (eq,id,5c11bd9c-085d-4913-a453-572457ddffe2)
func (*RestClient) HarborAuthenticate ¶
func (c *RestClient) HarborAuthenticate() (bool, error)
Harbor
func (*RestClient) InstanceInstantiate ¶
func (c *RestClient) InstanceInstantiate(ctx context.Context, instanceId string, req specs.LcmInstantiateRequest) error
Note instance state must be terminated.
func (*RestClient) InstanceReconfigure ¶
func (c *RestClient) InstanceReconfigure(ctx context.Context, r *specs.LcmReconfigureRequest, id string) error
InstanceReconfigure - reconfigure cnf instance.
func (*RestClient) InstanceUpdateState ¶
func (c *RestClient) InstanceUpdateState(ctx context.Context, instanceId string, req *specs.LcmInstantiateRequest) (*response.InstanceUpdate, error)
InstanceUpdateState current state of running instance.
func (*RestClient) IsSimulateFailure ¶
func (c *RestClient) IsSimulateFailure(f string) bool
func (*RestClient) LinkedRepositories ¶
func (c *RestClient) LinkedRepositories(tenantId string, repo string) (string, error)
LinkedRepositories - return linked repos to tenant's vim note repo must be linked
func (*RestClient) NodePoolAbortTask ¶
func (c *RestClient) NodePoolAbortTask(taskId string) (*models.TcaTask, error)
NodePoolAbortTask - retry task related to node pool
func (*RestClient) NodePoolRetryTask ¶
func (c *RestClient) NodePoolRetryTask(taskId string) (*models.TcaTask, error)
NodePoolRetryTask - retry task related to node pool
func (*RestClient) RegisterCloudProvider ¶
func (c *RestClient) RegisterCloudProvider(r *specs.SpecCloudProvider) (*models.RegistrationRespond, error)
RegisterCloudProvider method register new cloud provider.
func (*RestClient) RepositoriesQuery ¶
RepositoriesQuery - query repositories linked to vim
func (*RestClient) SetDumpRespond ¶
func (c *RestClient) SetDumpRespond(dumpRespond bool)
SetDumpRespond sets client in output mode.
func (*RestClient) SetSimulateFailure ¶
func (c *RestClient) SetSimulateFailure(fail bool)
SetSimulateFailure this method mainly used for unit testing to simulate failure condition
func (*RestClient) SetTrace ¶
func (c *RestClient) SetTrace(trace bool)
SetTrace enables trace server responds
func (*RestClient) TerminateInstance ¶
func (c *RestClient) TerminateInstance(terminateUri string, terminateReq *specs.LcmTerminateRequest) error
TerminateInstance rest call, terminates CNF/VNF terminateReq *specs.LcmTerminateRequest describes a request.
func (*RestClient) UpdateClusterPassword ¶
func (c *RestClient) UpdateClusterPassword(req *PasswordUpdateSpec, clusterId string) (*models.TcaTask, error)
UpdateClusterPassword update cluster password.
func (*RestClient) UpdateClusterTemplate ¶
func (c *RestClient) UpdateClusterTemplate(spec *specs.SpecClusterTemplate) error
UpdateClusterTemplate - updates existing cluster template Template must be already defined. Template id in a spec used to update template
func (*RestClient) UpdateExtension ¶
func (c *RestClient) UpdateExtension(ctx context.Context, spec *specs.SpecExtension, eid string) (bool, error)
UpdateExtension - update extension Returns true if extension updated
func (*RestClient) UpdateNodePool ¶
func (c *RestClient) UpdateNodePool(r *specs.SpecNodePool, clusterId string, nodePoolId string) (*models.TcaTask, error)
UpdateNodePool - update a note pool
func (*RestClient) UpgradeNodePool ¶
UpgradeNodePool - delete a note pool
func (*RestClient) UploadHelm ¶
func (c *RestClient) UploadHelm(csar []byte, fileName string) (bool, error)
UploadHelm - Uploads Harbor chart
func (*RestClient) UploadVnfPkgmVnfd ¶
UploadVnfPkgmVnfd - Uploads vnf package, note method doesn't check if catalog entity already create or not.
type SuccessResponse ¶
type SuccessResponse struct { Code int `json:"code" yaml:"code"` Data interface{} `json:"data" yaml:"data"` }
type SupportedVersion ¶
type SupportedVersion struct { Items []struct { ClusterType string `json:"clusterType" yaml:"cluster_type"` SupportedVersions []interface{} `json:"supportedVersions" yaml:"supported_versions"` } `json:"items"` }
type TaskNotFound ¶
type TaskNotFound struct {
// contains filtered or unexported fields
}
func (*TaskNotFound) Error ¶
func (m *TaskNotFound) Error() string
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package printer Copyright 2020-2021 Author.
|
Package printer Copyright 2020-2021 Author. |
Package response Copyright 2020-2021 Author.
|
Package response Copyright 2020-2021 Author. |
Package specs Copyright 2020-2021 Author.
|
Package specs Copyright 2020-2021 Author. |