Documentation
¶
Index ¶
Constants ¶
View Source
const ( DatacenterResource = "datacenter" ServerResource = "server" VolumeResource = "volume" IpBlockResource = "ipblock" SnapshotResource = "snapshot" ImageResource = "image" )
Resources
View Source
const ( ArgAll = "all" ArgAllShort = "a" ArgCols = "cols" ArgUserData = "user-data" ArgFirstName = "first-name" ArgLastName = "last-name" ArgEmail = "email" ArgEmailShort = "e" ArgPassword = "password" ArgPasswordShort = "p" ArgAdmin = "admin" ArgName = "name" ArgVolumeName = "volume-name" ArgNameShort = "n" ArgApiSubnets = "api-subnets" ArgDescription = "description" ArgDescriptionShort = "d" ArgLocation = "location" ArgLocationShort = "l" ArgDirection = "direction" ArgDirectionShort = "d" ArgAction = "action" ArgActionShort = "a" ArgS3Bucket = "s3bucket" ArgS3BucketShort = "b" ArgSize = "size" ArgSizeShort = "s" ArgBus = "bus" ArgLicenceType = "licence-type" ArgSshKeyPaths = "ssh-key-paths" ArgSshKeyPathsShort = "k" ArgPublic = "public" ArgPublicShort = "p" ArgIps = "ips" ArgIp = "ip" ArgNatGatewayIp = "nat-gateway-ip" ArgDhcp = "dhcp" ArgNetwork = "network" ArgListenerLan = "listener-lan" ArgListenerIp = "listener-ip" ArgListenerPort = "listener-port" ArgAlgorithm = "algorithm" ArgTargetLan = "target-lan" ArgRetries = "retries" ArgClientTimeout = "client-timeout" ArgConnectionTimeout = "connection-timeout" ArgTargetTimeout = "target-timeout" ArgCheck = "check" ArgCheckInterval = "check-interval" ArgHealthCheckEnabled = "health-check-enabled" ArgMaintenanceEnabled = "maintenance-enabled" ArgMaintenance = "maintenance" ArgMaintenanceShort = "m" ArgFirewallActive = "firewall-active" ArgFirewallType = "firewall-type" ArgCpuHotPlug = "cpu-hot-plug" ArgCpuHotUnplug = "cpu-hot-unplug" ArgRamHotPlug = "ram-hot-plug" ArgRamHotUnplug = "ram-hot-unplug" ArgNicHotPlug = "nic-hot-plug" ArgNicHotUnplug = "nic-hot-unplug" ArgDiscVirtioHotPlug = "disc-virtio-hot-plug" ArgDiscVirtioHotUnplug = "disc-virtio-hot-unplug" ArgDiscScsiHotPlug = "disc-scsi-hot-plug" ArgDiscScsiHotUnplug = "disc-scsi-hot-unplug" ArgExposeSerial = "expose-serial" ArgRequireLegacyBios = "require-legacy-bios" ArgApplicationType = "application-type" ArgSecAuthProtection = "sec-auth-protection" ArgImageAlias = "image-alias" ArgImageAliasShort = "a" ArgProtocol = "protocol" ArgProtocolShort = "p" ArgSourceSubnet = "source-subnet" ArgTargetSubnet = "target-subnet" ArgSourceMac = "source-mac" ArgSourceIp = "source-ip" ArgDestinationIp = "destination-ip" ArgDestinationIpShort = "D" ArgTargetIp = "target-ip" ArgTargetPort = "target-port" ArgPort = "port" ArgPortShort = "P" ArgWeight = "weight" ArgWeightShort = "W" ArgIcmpCode = "icmp-code" ArgIcmpType = "icmp-type" ArgPortRangeStart = "port-range-start" ArgPortRangeEnd = "port-range-end" ArgLabelUrn = "label-urn" ArgLabelKey = "label-key" ArgLabelValue = "label-value" ArgResourceLimits = "resource-limits" ArgResourceType = "resource-type" ArgForceSecAuth = "force-secure-auth" ArgCreateDc = "create-dc" ArgCreateSnapshot = "create-snapshot" ArgReserveIp = "reserve-ip" ArgAccessLog = "access-logs" ArgS3Privilege = "s3privilege" ArgCreateBackUpUnit = "create-backup" ArgCreatePcc = "create-pcc" ArgCreateNic = "create-nic" ArgCreateK8s = "create-k8s" ArgCreateFlowLog = "create-flowlog" ArgAccessMonitoring = "access-monitoring" ArgAccessCerts = "access-certs" ArgAccessDNS = "access-dns" ArgManageDbaas = "manage-dbaas" ArgManageDataplatform = "manage-dataplatform" ArgManageRegistry = "manage-registry" ArgEditPrivilege = "edit-privilege" ArgS3KeyActive = "s3key-active" ArgK8sVersion = "k8s-version" ArgK8sMinNodeCount = "min-node-count" ArgK8sMaxNodeCount = "max-node-count" ArgK8sMaintenanceDay = "maintenance-day" ArgK8sMaintenanceTime = "maintenance-time" ArgK8sAnnotationKey = "annotation-key" ArgK8sAnnotationValue = "annotation-value" ArgPublicIps = "public-ips" ArgPrivateIps = "private-ips" ArgGatewayIp = "gateway-ip" ArgLatest = "latest" ArgMethod = "method" ArgFilters = "filters" ArgFiltersShort = "F" ArgOrderBy = "order-by" ArgDepth = "depth" ArgDepthShort = "D" ArgCheckTimeout = "check-timeout" ArgPath = "path" ArgMatchType = "match-type" ArgResponse = "response" ArgMessage = "message" ArgMessageShort = "m" ArgRegex = "regex" ArgNegate = "negate" ArgServerCertificates = "server-certificates" ArgQuery = "query" ArgQueryShort = "Q" ArgStatusCode = "status-code" ArgContentType = "content-type" ArgCondition = "condition" ArgConditionShort = "C" ArgConditionType = "condition-type" ArgConditionTypeShort = "T" ArgConditionKey = "condition-key" ArgConditionKeyShort = "K" ArgConditionValue = "condition-value" ArgConditionValueShort = "V" )
Flags
View Source
const ( ArgIdShort = "i" ArgDataCenterId = "datacenter-id" ArgServerId = "server-id" ArgNatGatewayId = "natgateway-id" ArgApplicationLoadBalancerId = "applicationloadbalancer-id" ArgNetworkLoadBalancerId = "networkloadbalancer-id" ArgNicId = "nic-id" ArgLanId = "lan-id" ArgLanIds = "lan-ids" ArgLocationId = "location-id" ArgVolumeId = "volume-id" ArgLoadBalancerId = "loadbalancer-id" ArgRequestId = "request-id" ArgSnapshotId = "snapshot-id" ArgImageId = "image-id" ArgIpBlockId = "ipblock-id" ArgFirewallRuleId = "firewallrule-id" ArgFlowLogId = "flowlog-id" ArgUserId = "user-id" ArgGroupId = "group-id" ArgResourceId = "resource-id" ArgRuleId = "rule-id" ArgS3KeyId = "s3key-id" ArgBackupUnitId = "backupunit-id" ArgPccId = "pcc-id" ArgK8sNodeId = "node-id" ArgCdromId = "cdrom-id" ArgTargetGroupId = "targetgroup-id" ArgTemplateId = "template-id" FlagIPv6CidrBlock = "ipv6-cidr" FlagDHCPv6 = "dhcpv6" FlagIPv6IPs = "ipv6-ips" FlagIPVersion = "ip-version" )
IDs Flags
View Source
const ( DatacenterId = "The unique Data Center Id" LanId = "The unique LAN Id" LoadBalancerId = "The unique Load Balancer Id" NicId = "The unique NIC Id" RequestId = "The unique Request Id" ServerId = "The unique Server Id" VolumeId = "The unique Volume Id" SnapshotId = "The unique Snapshot Id" ImageId = "The unique Image Id" IpBlockId = "The unique IpBlock Id" FirewallRuleId = "The unique FirewallRule Id" LocationId = "The unique Location Id" LabelKey = "The unique Label Key" LabelValue = "The unique Label Value" UserId = "The unique User Id" GroupId = "The unique Group Id" ResourceId = "The unique Resource Id" S3KeyId = "The unique User S3Key Id" BackupUnitId = "The unique BackupUnit Id" PccId = "The unique Cross-Connect Id" K8sClusterId = "The unique K8s Cluster Id" K8sNodePoolId = "The unique K8s Node Pool Id" K8sNodeId = "The unique K8s Node Id" CdromId = "The unique Cdrom Id" TargetGroupId = "The unique Target Group Id" TemplateId = "The unique Template Id" FlowLogId = "The unique FlowLog Id" NatGatewayId = "The unique NatGateway Id" RuleId = "The unique Rule Id" ApplicationLoadBalancerId = "The unique ApplicationLoadBalancer Id" NetworkLoadBalancerId = "The unique NetworkLoadBalancer Id" ForwardingRuleId = "The unique ForwardingRule Id" )
Descriptions for Flags Resources
View Source
const ( ArgDepthDescription = "Controls the detail depth of the response objects. Max depth is 10." ArgOrderByDescription = "Limits results to those containing a matching value for a specific property" ArgFiltersDescription = "Limits results to those containing a matching value for a specific property. " + "Use the following format to set filters: --filters KEY1=VALUE1,KEY2=VALUE2" ArgNoHeadersDescription = "When using text output, don't print headers" ArgListAllDescription = "List all resources without the need of specifying parent ID name." )
Descriptions
View Source
const ( DefaultOutputFormat = "text" DefaultWait = false DefaultPublic = false DefaultDhcp = true DefaultFirewallActive = false DefaultTimeoutSeconds = int(60) NlbTimeoutSeconds = int(300) LbTimeoutSeconds = int(300) AlbTimeoutSeconds = int(10000) K8sTimeoutSeconds = int(600) DefaultServerCores = 2 DefaultVolumeSize = 10 DefaultNicLanId = 1 DefaultMaxResults = int32(0) DefaultServerCPUFamily = "AUTO" DefaultListDepth = int32(1) DefaultGetDepth = int32(0) DefaultCreateDepth = int32(0) DefaultUpdateDepth = int32(0) DefaultDeleteDepth = int32(0) DefaultMiscDepth = int32(0) // Attach, Detach (and similar); Server start/stop/suspend/etc.; )
Default values
Variables ¶
View Source
var ( // Parent resource depth for ListAll, DetachAll, DeleteAll, etc. ParentResourceListDepth = int32(0) ParentResourceQueryParams = resources.QueryParams{Depth: &ParentResourceListDepth} ParentResourceListQueryParams = resources.ListQueryParams{QueryParams: ParentResourceQueryParams} FlagIPv6CidrBlockDescriptionForLAN = fmt.Sprintf( defaultIPv6CidrBlockDescription+` It can also be set to "AUTO" or "DISABLE".`, 64, "Datacenter", ) FlagIPv6CidrBlockDescriptionForNIC = fmt.Sprintf(defaultIPv6CidrBlockDescription, 80, "LAN") )
Utils
Functions ¶
This section is empty.
Types ¶
type ResourcesMocks ¶
type ResourcesMocks struct {
Location *mockResources.MockLocationsService
Datacenter *mockResources.MockDatacentersService
Server *mockResources.MockServersService
Volume *mockResources.MockVolumesService
Lan *mockResources.MockLansService
NatGateway *mockResources.MockNatGatewaysService
ApplicationLoadBalancer *mockResources.MockApplicationLoadBalancersService
NetworkLoadBalancer *mockResources.MockNetworkLoadBalancersService
Nic *mockResources.MockNicsService
Loadbalancer *mockResources.MockLoadbalancersService
IpBlocks *mockResources.MockIpBlocksService
Request *mockResources.MockRequestsService
Image *mockResources.MockImagesService
Snapshot *mockResources.MockSnapshotsService
FirewallRule *mockResources.MockFirewallRulesService
FlowLog *mockResources.MockFlowLogsService
Label *mockResources.MockLabelResourcesService
Contract *mockResources.MockContractsService
User *mockResources.MockUsersService
Group *mockResources.MockGroupsService
S3Key *mockResources.MockS3KeysService
BackupUnit *mockResources.MockBackupUnitsService
Pcc *mockResources.MockPccsService
K8s *mockResources.MockK8sService
Template *mockResources.MockTemplatesService
TargetGroup *mockResources.MockTargetGroupsService
}
func InitMocksResources ¶
func InitMocksResources(ctrl *gomock.Controller) *ResourcesMocks
InitMocksResources for Test
type Services ¶
type Services struct {
// Compute Resources Services
Locations func() resources.LocationsService
DataCenters func() resources.DatacentersService
Servers func() resources.ServersService
Volumes func() resources.VolumesService
Lans func() resources.LansService
NatGateways func() resources.NatGatewaysService
ApplicationLoadBalancers func() resources.ApplicationLoadBalancersService
NetworkLoadBalancers func() resources.NetworkLoadBalancersService
Nics func() resources.NicsService
Loadbalancers func() resources.LoadbalancersService
Requests func() resources.RequestsService
Images func() resources.ImagesService
Snapshots func() resources.SnapshotsService
IpBlocks func() resources.IpBlocksService
FirewallRules func() resources.FirewallRulesService
FlowLogs func() resources.FlowLogsService
Labels func() resources.LabelResourcesService
Contracts func() resources.ContractsService
Users func() resources.UsersService
Groups func() resources.GroupsService
S3Keys func() resources.S3KeysService
BackupUnit func() resources.BackupUnitsService
Pccs func() resources.PccsService
K8s func() resources.K8sService
Templates func() resources.TemplatesService
TargetGroups func() resources.TargetGroupsService
// Context
Context context.Context
}
func InitMockServices ¶
func InitMockServices(c *Services, tm *ResourcesMocks) *Services
InitMockServices for Command Test
Click to show internal directories.
Click to hide internal directories.