{"modulePath":"github.com/api7/cloud-cli","version":"v0.0.0-20240523012138-b9cffea42484","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package options\n\n## Types\n\n```go\ntype BareDeployOptions struct {\n\t// APISIXVersion specifies the APISIX version to deploy.\n\tAPISIXVersion string\n\t// APISIXBinPath specifies the APISIX binary file path.\n\tAPISIXBinPath string\n\t// Reload indicates if skip the deployment and just try to reload APISIX.\n\tReload bool\n\t// Upgrade indicates if the current try is for upgrading Apache APISIX on\n\t// bare metal\n\tUpgrade bool\n}\n```\nBareDeployOptions contains options for the bare metal deployment command.\n\n```go\ntype ConfigureOptions struct {\n\t// Addr is the address of the API7 Cloud server.\n\tAddr string\n\t// Profile is the name of the profile to use.\n\tProfile string\n\t// Default indicates if the profile should be set as default.\n\tDefault bool\n\t// AccessToken is the access token of the API7 Cloud server.\n\tAccessToken string\n}\n```\nConfigureOptions contains options for \\`cloud-cli configure\\` command\n\n```go\ntype DebugOptions struct {\n\t// ShowConfig contains options for `cloud-cli debug show-config` command.\n\tShowConfig DebugShowConfigOptions\n}\n```\nDebugOptions contains options for \\`cloud-cli debug\\` command.\n\n```go\ntype DebugShowConfigOptions struct {\n\t// ID is the API7 Cloud resource id.\n\tID cloud.ID\n}\n```\nDebugShowConfigOptions contains options for \\`cloud-cli debug show-config\\` command.\n\n```go\ntype DeployOptions struct {\n\t// Name is an identifier of this deployment.\n\t// It'll be container name if deploy on Docker;\n\t// It'll be the Helm release name if deploy on Kubernetes;\n\t// It'll be noop if deploy on Bare metal.\n\tName string\n\t// APISIXInstanceID specifies the ID of the APISIX instance to deploy.\n\t// When this field is empty, the instance ID will be generated automatically.\n\tAPISIXInstanceID string `validate:\"min=1 max=128\"`\n\t// APISIXConfigFile is the path to the APISIX configuration file.\n\tAPISIXConfigFile string\n\t// Docker contains the options for the deploy docker command.\n\tDocker DockerDeployOptions\n\t// Bare contains the options for the bare metal deployment command.\n\tBare BareDeployOptions\n\t// KubernetesDeployOptions contains options for the kubernetes or helm command.\n\tKubernetes KubernetesDeployOptions\n}\n```\nDeployOptions contains options for the deploy command.\n\n```go\ntype DockerDeployOptions struct {\n\t// APISIXImage is the name of the APISIX image to deploy.\n\tAPISIXImage string `validate:\"image\"`\n\t// DockerRunArgs contains a series of arguments to pass to the docker run command.\n\tDockerRunArgs []string\n\t// DockerCLIPath is the filepath of the docker command.\n\tDockerCLIPath string\n\t// Specify the host port for HTTP\n\tHTTPHostPort int\n\t// Specify the host port for HTTPS\n\tHTTPSHostPort int\n\t// Specify the filesystem path of the host directory to mount into the container for\n\t// saving the APISIX local configuration cache.\n\tLocalCacheBindPath string\n}\n```\nDockerDeployOptions contains options for the deploy docker command.\n\n```go\nfunc (o *DockerDeployOptions) Validate() error\n```\nValidate validates the docker deploy options.\n\n```go\ntype DockerStopOptions struct {\n\t// DockerCLIPath is the filepath of the docker command.\n\tDockerCLIPath string\n}\n```\nDockerStopOptions contains options for the stop docker command.\n\n```go\ntype KubernetesDeployOptions struct {\n\t// Namespace is the name space of kubernetes\n\tNamespace string\n\t// APISIXImage is the name of the APISIX image to deploy.\n\tAPISIXImage string `validate:\"image\"`\n\t// APISIXImageRepo is the APISIXImage name\n\tAPISIXImageRepo string\n\t// APISIXImageTag is the APISIXImage tag\n\tAPISIXImageTag string\n\t// ReplicaCount is the pod replica count\n\tReplicaCount uint\n\t// HelmInstallArgs contains a series of arguments to pass to the helm install command.\n\tHelmInstallArgs []string\n\t// KubectlCLIPath is the filepath of the kubectl command.\n\tKubectlCLIPath string\n\t// HelmCLIPath is the filepath of the helm command.\n\tHelmCLIPath string\n\t// LocalCachePVC is the PVC for saving the local configuration cache.\n\tLocalCachePVC string\n}\n```\nKubernetesDeployOptions contains options for the kubectl or helm command.\n\n```go\ntype KubernetesStopOptions struct {\n\t// NameSpace is the name space of kubernetes\n\tNameSpace string\n\t// HelmUnInstallArgs contains a series of arguments to pass to the helm uninstall command.\n\tHelmUnInstallArgs []string\n\t// KubectlCLIPath is the filepath of the kubectl command.\n\tKubectlCLIPath string\n\t// HelmCLIPath is the filepath of the helm command.\n\tHelmCLIPath string\n}\n```\nKubernetesStopOptions contains options for the kubectl or helm command.\n\n```go\ntype Options struct {\n\t// Verbose controls if the output should be elaborate.\n\tVerbose bool\n\t// DryRun controls if all the actions should be simulated instead of executed.\n\tDryRun bool\n\t// Profile is the name of the profile to use.\n\tProfile string\n\t// Deploy contains the options for the deploy command.\n\tDeploy DeployOptions\n\t// Stop contains the options for the stop command.\n\tStop StopOptions\n\t// Debug contains the options for the debug command.\n\tDebug DebugOptions\n\t// Resource contains the options for the resource command.\n\tResource ResourceOptions\n\t// Configure contains the options for the configure command.\n\tConfigure ConfigureOptions\n}\n```\nOptions contains all options.\n\n```go\nvar (\n\t// Global contains all options.\n\tGlobal Options\n)\n```\n\n```go\ntype ResourceCreateOptions struct {\n\t// Specify the kind of resource.\n\tKind string\n\t// Specify the SSL create options.\n\tSSL SSLModifyOptions\n\t// Labels indicates a series of resource labels.\n\tLabels []string\n\t// FromFile indicates a filepath which contains the resource definition.\n\tFromFile string\n}\n```\nResourceCreateOptions contains options for the resource creation.\n\n```go\nfunc (o *ResourceCreateOptions) Validate() error\n```\nValidate validates the ResourceCreateOptions.\n\n```go\ntype ResourceDeleteOptions struct {\n\tKind      string\n\tID        string\n\tServiceID string\n}\n```\nResourceDeleteOptions contains options for \\`cloud-cli resource delete\\` command.\n\n```go\ntype ResourceGetOptions struct {\n\t// Specify the kind of resource\n\tKind string\n\t// Specify the ID of resource\n\tID string\n\t// Specify the service ID of resource\n\tServiceID string\n}\n```\nResourceGetOptions contains options for \\`cloud-cli resource get\\` command.\n\n```go\ntype ResourceListOptions struct {\n\t// Specify the kind of resource\n\tKind string\n\t// Specify the amount of data to be listed\n\tLimit int\n\t// Specifies how much data to skip ahead\n\tSkip int\n\t// Specify the ID of service\n\tServiceID string\n}\n```\nResourceListOptions contains options for \\`cloud-cli resource list\\` command.\n\n```go\nfunc (o *ResourceListOptions) Validate() error\n```\nValidate validates the docker deploy options.\n\n```go\ntype ResourceOptions struct {\n\tList   ResourceListOptions\n\tGet    ResourceGetOptions\n\tDelete ResourceDeleteOptions\n\tCreate ResourceCreateOptions\n\tUpdate ResourceUpdateOptions\n}\n```\nResourceOptions indicates the options for the resource operation.\n\n```go\ntype ResourceUpdateOptions struct {\n\t// ID specifies the resource ID.\n\tID string\n\t// Kind specifies the kind of resource.\n\tKind string\n\t// SSL specifies the SSL create options.\n\tSSL SSLModifyOptions\n\t// Labels indicates a series of resource labels.\n\tLabels []string\n\t// FromFile indicates a filepath which contains the resource definition.\n\tFromFile string\n}\n```\nResourceUpdateOptions contains options for the resource update.\n\n```go\nfunc (o *ResourceUpdateOptions) Validate() error\n```\nValidate validates the ResourceCreateOptions.\n\n```go\ntype SSLModifyOptions struct {\n\tCertFile   string\n\tPKeyFile   string\n\tCACertFile string\n\tType       cloud.CertificateType\n}\n```\nSSLModifyOptions contains the modify options for ssl.\n\n```go\nfunc (o *SSLModifyOptions) Validate() error\n```\n\n```go\ntype StopOptions struct {\n\t// Name is an identifier of this deployment.\n\t// It'll be container name if deploy on Docker;\n\t// It'll be the Helm release name if deploy on Kubernetes;\n\t// It'll be noop if deploy on Bare metal.\n\tName string\n\t// Remove controls whether to delete containers in docker\n\tRemove bool\n\t// Docker contains the options for the stop docker command.\n\tDocker DockerStopOptions\n\t// Kubernetes contains options for the kubectl or helm command.\n\tKubernetes KubernetesStopOptions\n}\n```\nStopOptions contains options for the stop command.\n\n","path":"github.com/api7/cloud-cli/internal/options","name":"options","synopsis":"","isRedistributable":true}
