github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/iec/v1/common/common.go (about) 1 package common 2 3 import ( 4 "time" 5 ) 6 7 // Operator 运营商 8 type Operator struct { 9 // 运营商的唯一uuid 10 ID string `json:"id"` 11 12 // 运营商的名称 13 Name string `json:"name,omitempty"` 14 15 // 运营商的国际化名称 16 I18nName string `json:"i18n_name,omitempty"` 17 18 // 运营商的简写 19 Sa string `json:"sa"` 20 } 21 22 type PublicIP struct { 23 // Specifies the ID of the elastic IP address, which uniquely 24 // identifies the elastic IP address. 25 ID string `json:"id"` 26 27 // Specifies the status of the elastic IP address. 28 Status string `json:"status"` 29 30 // Specifies the obtained elastic IP address. 31 PublicIpAddress string `json:"public_ip_address"` 32 33 // Value range: 4, 6, respectively, to create ipv4 and ipv6, when not created ipv4 by default 34 IPVersion int `json:"ip_version"` 35 36 // Specifies the private IP address bound to the elastic IP 37 // address. 38 PrivateIpAddress string `json:"private_ip_address"` 39 40 // Specifies the port ID. 41 PortID string `json:"port_id"` 42 43 // Specifies the time for applying for the elastic IP address. 44 CreateTime string `json:"create_time"` 45 46 // Specifies the bandwidth ID of the elastic IP address. 47 BandwidthID string `json:"bandwidth_id"` 48 49 // Specifies the bandwidth size. 50 BandwidthSize int `json:"bandwidth_size"` 51 52 // Specifies whether the bandwidth is shared or exclusive. 53 BandwidthShareType string `json:"bandwidth_share_type"` 54 55 // Specifies the bandwidth name. 56 BandwidthName string `json:"bandwidth_name"` 57 58 //Operator information 59 Operator Operator `json:"operator"` 60 61 // Specifies the Siteid. 62 SiteID string `json:"site_id"` 63 64 // SiteInfo 65 SiteInfo string `json:"site_info"` 66 67 Region string `json:"region,omitempty"` 68 69 Type string `json:"type,omitempty"` 70 } 71 72 // GeoLocation 地理位置 73 type GeoLocation struct { 74 // ID 标志 75 ID string `json:"id"` 76 77 // City 城市 78 City string `json:"city,omitempty"` 79 80 // I18nCity 城市的国家化名称 81 I18nCity string `json:"i18n_city,omitempty"` 82 83 // Province 省份 84 Province string `json:"province,omitempty"` 85 86 // I18nProvince 省份的国际化名称 87 I18nProvince string `json:"i18n_province,omitempty"` 88 89 // Area 区域 90 Area string `json:"area,omitempty"` 91 92 // I18nArea 区域国际化名称 93 I18nArea string `json:"i18n_area,omitempty"` 94 95 // Country 国家 96 Country string `json:"country"` 97 98 // I18nCountry 国家的国际化名称 99 I18nCountry string `json:"i18n_country,omitempty"` 100 } 101 102 // Subnet represents a subnet. See package documentation for a top-level 103 // description of what this is. 104 type Subnet struct { 105 // Specifies a resource ID in UUID format. 106 ID string `json:"id"` 107 108 // Specifies the subnet name. The value is a string of 1 to 64 109 // characters that can contain letters, digits, underscores (_), and hyphens (-). 110 Name string `json:"name"` 111 112 // Specifies the network segment on which the subnet resides. The 113 // value must be in CIDR format. The value must be within the CIDR block of the VPC. The 114 // subnet mask cannot be greater than 28. 115 Cidr string `json:"cidr"` 116 117 // Specifies the gateway of the subnet. The value must be a valid 118 // IP address. The value must be an IP address in the subnet segment. 119 GatewayIP string `json:"gateway_ip"` 120 121 // Specifies whether the DHCP function is enabled for the subnet. 122 // The value can be true or false. If this parameter is left blank, it is set to true by 123 // default. 124 DhcpEnable bool `json:"dhcp_enable,omitempty"` 125 126 // Specifies the IP address of DNS server 1 on the subnet. The 127 // value must be a valid IP address. 128 PrimaryDNS string `json:"primary_dns,omitempty"` 129 130 // Specifies the IP address of DNS server 2 on the subnet. The 131 // value must be a valid IP address. 132 SecondaryDNS string `json:"secondary_dns,omitempty"` 133 134 // Specifies the DNS server address list of a subnet. This field 135 // is required if you need to use more than two DNS servers. This parameter value is the 136 // superset of both DNS server address 1 and DNS server address 2. 137 DNSList []string `json:"dnsList,omitempty"` 138 139 // Specifies the ID of the VPC to which the subnet belongs. 140 VpcID string `json:"vpc_id"` 141 142 // Specifies the status of the subnet. The value can be ACTIVE, 143 // DOWN, UNKNOWN, or ERROR. 144 Status string `json:"status"` 145 146 // Specifies the network (Native OpenStack API) ID. 147 NeutronNetworkID string `json:"neutron_network_id"` 148 149 // Specifies the subnet (Native OpenStack API) ID. 150 NeutronSubnetID string `json:"neutron_subnet_id"` 151 152 // SiteID 153 SiteID string `json:"site_id,omitempty"` 154 155 // SiteInfo 156 SiteInfo string `json:"site_info,omitempty"` 157 } 158 159 type VPC struct { 160 // Specifies a resource ID in UUID format. 161 ID string `json:"id"` 162 163 // Specifies the name of the VPC. The name must be unique for a 164 // tenant. The value is a string of no more than 64 characters and can contain digits, 165 // letters, underscores (_), and hyphens (-). 166 Name string `json:"name,omitempty"` 167 168 // Specifies the range of available subnets in the VPC. The value 169 // must be in CIDR format, for example, 192.168.0.0/16. The value ranges from 10.0.0.0/8 170 // to 10.255.255.0/24, 172.16.0.0/12 to 172.31.255.0/24, or 192.168.0.0/16 to 171 // 192.168.255.0/24. 172 Cidr string `json:"cidr,omitempty"` 173 174 // SubnetNum 175 SubnetNum int64 `json:"subnet_num"` 176 177 Mode string `json:"mode,omitempty"` 178 } 179 180 // SiteAttribute 站点扩展属性 181 type SiteAttribute struct { 182 // 站点属性的唯一uuid 183 ID string `json:"id"` 184 185 // 站点相对应的属性的key 186 Key string `json:"site_attr"` 187 188 // 站点相对应属性的value 189 Value string `json:"site_attr_value"` 190 } 191 192 // SiteBase 站点的基本信息 193 type SiteBase struct { 194 // 站点所在的城市 195 City string `json:"city,omitempty"` 196 197 // 城市的国家化名称 198 I18nCity string `json:"i18n_city,omitempty"` 199 200 // 站点所在的省份 201 Province string `json:"province,omitempty"` 202 203 // 省份的国际化名称 204 I18nProvince string `json:"i18n_province,omitempty"` 205 206 // 站点所在的区域 207 Area string `json:"area,omitempty"` 208 209 // 区域国际化名称 210 I18nArea string `json:"i18n_area,omitempty"` 211 212 // 站点所在的国家 213 Country string `json:"country,omitempty"` 214 215 // 国家的国际化名称 216 I18nCountry string `json:"i18n_country,omitempty"` 217 218 Operator *Operator `json:"operator,omitempty"` 219 } 220 221 // Site 站点信息 222 type Site struct { 223 // 站点的唯一uuid 224 ID string `json:"id"` 225 226 // 站点的名称,最好按照一定的规则命名,比如:IEG-国家-区域-省-市-运营商 227 Name string `json:"name"` 228 229 SiteBase 230 231 //站点的状态, 232 Status string `json:"status"` 233 234 // CityShortName 城市名称缩写 235 CityShortName string `json:"city_short_name"` 236 237 // EipPools 238 EipPools []EipPool `json:"pools,omitempty"` 239 } 240 241 // EipPool eip池返回体内容 242 type EipPool struct { 243 // ID EIP池的唯一uuid 244 ID string `json:"id"` 245 246 // SiteID 站点ID 247 SiteID string `json:"site_id"` 248 249 // DisplayName EIP池展示名 250 DisplayName string `json:"display_name"` 251 252 // OperatorID 运营商ID 253 OperatorID *Operator `json:"operator"` 254 255 // PoolID EIP 池标识,从neutron获取 256 PoolID string `json:"pool_id"` 257 258 // IPVersion IPv4:IPv4池 IPv6:IPv6池 259 IPVersion string `json:"ip_version"` 260 } 261 262 type Port struct { 263 // Specifies the port ID, which uniquely identifies the port. 264 ID string `json:"id"` 265 266 // Specifies the port name. The value can contain no more than 255 267 // characters. This parameter is left blank by default. 268 Name string `json:"name"` 269 270 // Specifies the ID of the network to which the port belongs. The 271 // network ID must be a real one in the network environment. 272 NetworkID string `json:"network_id"` 273 274 // Specifies the administrative state of the port. The value can 275 // only be?true, and the default value is?true. 276 AdminStateUp bool `json:"admin_state_up"` 277 278 // Specifies the port MAC address. The system automatically sets 279 // this parameter, and you are not allowed to configure the parameter value. 280 MacAddress string `json:"mac_address"` 281 282 // Specifies the port IP address. A port supports only one fixed 283 // IP address that cannot be changed. 284 FixedIPs []FixedIp `json:"fixed_ips"` 285 286 // Specifies the ID of the device to which the port belongs. The 287 // system automatically sets this parameter, and you are not allowed to configure or 288 // change the parameter value. 289 DeviceID string `json:"device_id"` 290 291 // Specifies the belonged device, which can be the DHCP server, 292 // router, load balancers, or Nova. The system automatically sets this parameter, and 293 // you are not allowed to configure or change the parameter value. 294 DeviceOwner string `json:"device_owner"` 295 296 // Specifies the status of the port. The value can 297 // be?ACTIVE,?BUILD, or?DOWN. 298 Status string `json:"status"` 299 300 // Specifies the UUID of the security group. This attribute is 301 // extended. 302 SecurityGroups []string `json:"security_groups"` 303 304 // 1. Specifies a set of zero or more allowed address pairs. An 305 // address pair consists of an IP address and MAC address. This attribute is extended. 306 // For details, see parameter?allow_address_pair. 2. The IP address cannot be?0.0.0.0. 307 // 3. Configure an independent security group for the port if a large CIDR block (subnet 308 // mask less than 24) is configured for parameter?allowed_address_pairs. 309 AllowedAddressPairs []AllowedAddressPair `json:"allowed_address_pairs"` 310 311 // Specifies a set of zero or more extra DHCP option pairs. An 312 // option pair consists of an option value and name. This attribute is extended. 313 ExtraDhcpOpts []ExtraDHCPOpt `json:"extra_dhcp_opts"` 314 315 // Specifies the type of the bound vNIC. The value can 316 // be?normal?or?direct. Parameter?normal?indicates software switching. 317 // Parameter?direct?indicates SR-IOV PCIe passthrough, which is not supported. 318 BindingvnicType string `json:"binding:vnic_type"` 319 320 // Default private domain name of the main NIC 321 DnsAssignment []DnsAssignment `json:"dns_assignment"` 322 323 // Default private DNS name of the main NIC 324 DnsName string `json:"dns_name"` 325 326 // site id 327 SiteID string `json:"site_id"` 328 } 329 330 type FixedIp struct { 331 // Specifies the subnet ID. You cannot change the parameter 332 // value. 333 SubnetId string `json:"subnet_id,omitempty"` 334 335 // Specifies the port IP address. You cannot change the parameter 336 // value. 337 IpAddress string `json:"ip_address,omitempty"` 338 } 339 340 type DnsAssignment struct { 341 // 功能说明:fqdn 342 Fqdn string `json:"fqdn,omitempty"` 343 344 // 功能说明:hostname 345 HostName string `json:"hostname,omitempty"` 346 347 // 功能说明:ip_address 348 IpAddress string `json:"ip_address,omitempty"` 349 } 350 351 type ExtraDHCPOpt struct { 352 // 功能说明:Option名称 353 OptName string `json:"opt_name,omitempty"` 354 355 // 功能说明:Option值 356 OptValue string `json:"opt_value,omitempty"` 357 } 358 359 type AllowedAddressPair struct { 360 // Specifies the IP address. You cannot set it to 0.0.0.0. 361 // Configure an independent security group for the port if a large CIDR block (subnet 362 // mask less than 24) is configured for parameter allowed_address_pairs. 363 IpAddress string `json:"ip_address,omitempty"` 364 365 // Specifies the MAC address. 366 MacAddress string `json:"mac_address,omitempty"` 367 } 368 369 type Bandwidth struct { 370 // Specifies the bandwidth name. The value is a string of 1 to 64 371 // characters that can contain letters, digits, underscores (_), and hyphens (-). 372 Name string `json:"name"` 373 374 // Specifies the bandwidth size. The value ranges from 1 Mbit/s to 375 // 300 Mbit/s. 376 Size int `json:"size"` 377 378 // Specifies the bandwidth ID, which uniquely identifies the 379 // bandwidth. 380 ID string `json:"id"` 381 382 // Specifies whether the bandwidth is shared or exclusive. The 383 // value can be PER or WHOLE. 384 ShareType string `json:"share_type"` 385 386 // Specifies the elastic IP address of the bandwidth. The 387 // bandwidth, whose type is set to WHOLE, supports up to 20 elastic IP addresses. The 388 // bandwidth, whose type is set to PER, supports only one elastic IP address. 389 PublicipInfo []PublicIpinfo `json:"publicip_info"` 390 391 // Specifies the tenant ID of the user. 392 TenantId string `json:"tenant_id"` 393 394 // Specifies the bandwidth type. 395 BandwidthType string `json:"bandwidth_type"` 396 397 // Specifies the charging mode (by traffic or by bandwidth). 398 ChargeMode string `json:"charge_mode"` 399 400 // Specifies the status of bandwidth 401 Status string `json:"status"` 402 403 SiteID string `json:"site_id,omitempty"` 404 405 CreateTime time.Time `json:"create_time,omitempty"` 406 407 SiteInfo string `json:"site_info,omitempty"` 408 409 Operator Operator `json:"operator,omitempty"` 410 411 UpdateTime time.Time `json:"update_time,omitempty"` 412 413 PoolID string `json:"pool_id,omitempty"` 414 } 415 416 type PublicIpinfo struct { 417 // Specifies the tenant ID of the user. 418 PublicipId string `json:"publicip_id"` 419 420 // Specifies the elastic IP address. 421 PublicipAddress string `json:"publicip_address"` 422 423 // Specifies the elastic IP version. 424 IPVersion int `json:"ip_version"` 425 426 // Specifies the elastic IP address type. The value can be 427 // 5_telcom, 5_union, or 5_bgp. 428 PublicipType string `json:"publicip_type"` 429 } 430 431 // Volume contains all the information associated with an OpenStack Volume. 432 type Volume struct { 433 // Unique identifier for the volume. 434 ID string `json:"id"` 435 // Current status of the volume. 436 Status string `json:"status"` 437 // Size of the volume in GB. 438 Size int `json:"size"` 439 // AvailabilityZone is which availability zone the volume is in. 440 AvailabilityZone string `json:"availability_zone"` 441 // The date when this volume was created. 442 CreatedAt time.Time `json:"-"` 443 // The date when this volume was last updated 444 UpdatedAt time.Time `json:"-"` 445 // Instances onto which the volume is attached. 446 Attachments []Attachment `json:"attachments"` 447 // Human-readable display name for the volume. 448 Name string `json:"name"` 449 // Human-readable description for the volume. 450 Description string `json:"description"` 451 // The type of volume to create, either SATA or SSD. 452 VolumeType string `json:"volume_type"` 453 // The ID of the snapshot from which the volume was created 454 SnapshotID string `json:"snapshot_id"` 455 // The ID of another block storage volume from which the current volume was created 456 SourceVolID string `json:"source_volid"` 457 // Arbitrary key-value pairs defined by the user. 458 Metadata map[string]string `json:"metadata"` 459 // UserID is the id of the user who created the volume. 460 UserID string `json:"user_id"` 461 // Indicates whether this is a bootable volume. 462 Bootable string `json:"bootable"` 463 // Encrypted denotes if the volume is encrypted. 464 Encrypted bool `json:"encrypted"` 465 // ReplicationStatus is the status of replication. 466 ReplicationStatus string `json:"replication_status"` 467 // ConsistencyGroupID is the consistency group ID. 468 ConsistencyGroupID string `json:"consistencygroup_id"` 469 // Multiattach denotes if the volume is multi-attach capable. 470 Multiattach bool `json:"multiattach"` 471 472 //Cloud hard disk uri self-description information. 473 Links []map[string]string `json:"links"` 474 475 //Whether it is a shared cloud drive. 476 //Shareable bool `json:"shareable"` 477 //Volume image metadata 478 VolumeImageMetadata map[string]string `json:"volume_image_metadata"` 479 480 //The tenant ID to which the cloud drive belongs. 481 TenantAttr string `json:"os-vol-tenant-attr:tenant_id"` 482 483 //The host name to which the cloud drive belongs. 484 HostAttr string `json:"os-vol-host-attr:host"` 485 //Reserved attribute 486 RepAttrDriverData string `json:"os-volume-replication:driver_data"` 487 //Reserved attribute 488 RepAttrExtendedStatus string `json:"os-volume-replication:extended_status"` 489 //Reserved attribute 490 MigAttrStat string `json:"os-vol-mig-status-attr:migstat"` 491 //Reserved attribute 492 MigAttrNameID string `json:"os-vol-mig-status-attr:name_id"` 493 } 494 495 type Attachment struct { 496 AttachedAt time.Time `json:"-"` 497 AttachmentID string `json:"attachment_id"` 498 Device string `json:"device"` 499 HostName string `json:"host_name"` 500 ID string `json:"id"` 501 ServerID string `json:"server_id"` 502 VolumeID string `json:"volume_id"` 503 } 504 505 // VolumeType 卷类型 506 type VolumeType struct { 507 // Unique identifier for the volume type. 508 ID string `json:"id"` 509 // Human-readable display name for the volume type. 510 Name string `json:"name"` 511 } 512 513 type Flavor struct { 514 // Specifies the ID of ECS specifications. 515 ID string `json:"id"` 516 517 // Specifies the name of the ECS specifications. 518 Name string `json:"name"` 519 520 // Specifies the number of CPU cores in the ECS specifications. 521 Vcpus string `json:"vcpus"` 522 523 // Specifies the memory size (MB) in the ECS specifications. 524 Ram int64 `json:"ram"` 525 526 // Specifies the system disk size in the ECS specifications. 527 // The value 0 indicates that the disk size is not limited. 528 Disk string `json:"disk"` 529 530 // Specifies shortcut links for ECS flavors. 531 Links []Link `json:"links"` 532 533 // Specifies extended ECS specifications. 534 OsExtraSpecs OsExtraSpecs `json:"os_extra_specs"` 535 536 // Reserved 537 Swap string `json:"swap"` 538 539 // Reserved 540 FlvEphemeral int64 `json:"OS-FLV-EXT-DATA:ephemeral"` 541 542 // Reserved 543 FlvDisabled bool `json:"OS-FLV-DISABLED:disabled"` 544 545 // Reserved 546 RxtxFactor int64 `json:"rxtx_factor"` 547 548 // Reserved 549 RxtxQuota string `json:"rxtx_quota"` 550 551 // Reserved 552 RxtxCap string `json:"rxtx_cap"` 553 554 // Reserved 555 AccessIsPublic bool `json:"os-flavor-access:is_public"` 556 } 557 558 type Link struct { 559 // Specifies the shortcut link marker name. 560 Rel string `json:"rel"` 561 562 // Provides the corresponding shortcut link. 563 Href string `json:"href"` 564 565 // Specifies the shortcut link type. 566 Type string `json:"type"` 567 } 568 569 type OsExtraSpecs struct { 570 // Specifies the ECS specifications types 571 PerformanceType string `json:"ecs:performancetype"` 572 573 // Specifies the resource type. 574 ResourceType string `json:"resource_type"` 575 576 // Specifies the generation of an ECS type 577 Generation string `json:"ecs:generation"` 578 579 // Specifies a virtualization type 580 VirtualizationEnvTypes string `json:"ecs:virtualization_env_types"` 581 582 // Indicates whether the GPU is passthrough. 583 PciPassthroughEnableGpu string `json:"pci_passthrough:enable_gpu"` 584 585 // Indicates the technology used on the G1 and G2 ECSs, 586 // including GPU virtualization and GPU passthrough. 587 PciPassthroughGpuSpecs string `json:"pci_passthrough:gpu_specs"` 588 589 // Indicates the model and quantity of passthrough-enabled GPUs on P1 ECSs. 590 PciPassthroughAlias string `json:"pci_passthrough:alias"` 591 592 // gpu info.wuzilin add 593 InfoGPUName string `json:"info:gpu:name,omitempty"` 594 595 // cpu 596 InfoCpuName string `json:"info:cpu:name,omitempty"` 597 598 CondOperationStatus string `json:"cond:operation:status"` 599 600 CondOperationAz string `json:"cond:operation:az"` 601 602 CondCompute string `json:"cond:compute"` 603 604 CondImage string `json:"cond:image"` 605 606 VifMaxNum string `json:"quota:vif_max_num"` 607 608 PhysicsMaxRate string `json:"quota:physics_max_rate"` 609 610 VifMultiqueueNum string `json:"quota:vif_multiqueue_num"` 611 612 MinRate string `json:"quota:min_rate"` 613 614 MaxRate string `json:"quota:max_rate"` 615 616 MaxPps string `json:"quota:max_pps"` 617 618 CPUSockets string `json:"hw:cpu_sockets"` 619 620 NumaNodes string `json:"hw:numa_nodes"` 621 622 CPUThreads string `json:"hw:cpu_threads"` 623 624 MemPageSize string `json:"hw:mem_page_size"` 625 626 ConnLimitTotal string `json:"quota:conn_limit_total"` 627 628 CPUCores string `json:"hw:cpu_cores"` 629 630 SpotExtraSpecs 631 } 632 633 // SpotExtraSpecs 增加spot属性 634 type SpotExtraSpecs struct { 635 CondSpotBlockOperationAz string `json:"cond:spot_block:operation:az"` 636 CondSpotBlockLdh string `json:"cond:spot_block:operation:longest_duration_hours"` 637 CondSpotBlockLdc string `json:"cond:spot_block:operation:longest_duration_count"` 638 CondSpotBlockInterruptPolicy string `json:"cond:spot_block:operation:interrupt_policy"` 639 CondSpotOperationAz string `json:"cond:spot:operation:az"` 640 CondSpotOperationStatus string `json:"cond:spot:operation:status"` 641 } 642 643 // EdgeImageInfo 边缘镜像基本字段 644 type EdgeImageInfo struct { 645 ID string `json:"id"` 646 Name string `json:"name"` 647 Status string `json:"status"` 648 DiskFormat string `json:"disk_format"` 649 MinDiskGigabytes int `json:"min_disk"` 650 MinRAMMegabytes int `json:"min_ram"` 651 Owner string `json:"owner"` 652 Protected bool `json:"protected"` 653 Visibility string `json:"visibility"` 654 CreatedAt string `json:"created_at"` 655 UpdatedAt string `json:"updated_at"` 656 Self string `json:"self"` 657 Deleted bool `json:"deleted"` 658 VirtualEnvType string `json:"virtual_env_type"` 659 DeletedAt string `json:"deleted_at"` 660 RelatedJobID string `json:"related_job_id"` 661 ImageType string `json:"__imagetype"` 662 Platform string `json:"__platform"` 663 OsType string `json:"__os_type"` 664 OsVersion string `json:"__os_version"` 665 IsRegistered bool `json:"__isregistered"` 666 SupportKvm string `json:"__support_kvm,omitempty"` 667 SupportKvmGpuType string `json:"__support_kvm_gpu_type,omitempty"` 668 SupportKvmAscend310 string `json:"__support_kvm_ascend_310,omitempty"` 669 SupportKvmHi1822Hiovs string `json:"__support_kvm_hi1822_hiovs,omitempty"` 670 SupportArm string `json:"__support_arm,omitempty"` 671 HwFirmwareType string `json:"hw_firmware_type,omitempty"` 672 } 673 674 // Coverage :Edge Coverage Rule 675 type Coverage struct { 676 CoveragePolicy string `json:"coverage_policy" required:"true"` 677 CoverageLevel string `json:"coverage_level" required:"true"` 678 CoverageSites []CoverageSite `json:"coverage_sites,omitempty"` 679 } 680 681 // CoverageSite :Edge service coverage site 682 type CoverageSite struct { 683 Site string `json:"site"` 684 Demands []Demand `json:"demands"` 685 } 686 687 // Demand 688 type Demand struct { 689 Operator string `json:"operator" required:"true"` 690 Count int `json:"demand_count" required:"true"` 691 PoolID string `json:"pool_id"` 692 } 693 694 type ResourceOpts struct { 695 //Name is the name to assign to the newly launched server. 696 Name string `json:"name" required:"true"` 697 698 // ImageRef [optional; required if ImageName is not provided] is the ID or 699 // full URL to the image that contains the server's OS and initial state. 700 // Also optional if using the boot-from-volume extension. 701 ImageRef string `json:"image_ref" required:"true"` 702 703 // FlavorRef [optional; required if FlavorName is not provided] is the ID or 704 // full URL to the flavor that describes the server's specs. 705 FlavorRef string `json:"flavor_ref" required:"true"` 706 707 // UserData contains configuration information or scripts to use upon launch. 708 // Create will base64-encode it for you, if it isn't already. 709 UserData string `json:"user_data"` 710 711 // AdminPass sets the root user password. If not set, a randomly-generated 712 // password will be created and returned in the response. 713 AdminPass string `json:"admin_pass,omitempty"` 714 715 //secret for logging in server 716 KeyName string `json:"key_name,omitempty"` 717 718 // Networks dictates how this server will be attached to available networks. 719 // By default, the server will be attached to all isolated networks for the 720 // tenant. 721 NetConfig NetConfig `json:"net_config" required:"true"` 722 723 //Specifies the EIP bandwidth. If this parameter does not exist, no EIP is bound. 724 //If this parameter exists, an EIP is bound. 725 BandWidth *BandWidth `json:"bandwidth,omitempty"` 726 727 //the number of servers created 728 Count int `json:"count"` 729 730 //System disk configuration of the ECS 731 RootVolume RootVolume `json:"root_volume"` 732 733 //Specifies the data disk configuration of the ECS. Each data structure indicates 734 //a data disk to be created. 735 DataVolumes []DataVolume `json:"data_volumes,omitempty"` 736 737 //Specifies the security group of the ECS. 738 SecurityGroups []SecurityGroup `json:"security_groups,omitempty"` 739 740 // 边缘场景,待使用 741 EdgeScenes string `json:"edge_scenes,omitempty"` 742 } 743 744 // NetConfig 745 type NetConfig struct { 746 VpcID string `json:"vpc_id" required:"true"` 747 Subnets []SubnetID `json:"subnets"` 748 NicNum int `json:"nic_num"` 749 } 750 751 // Subnet 752 type SubnetID struct { 753 ID string `json:"id" required:"true"` 754 IPv6BandWidthEnable bool `json:"ipv6_bandwidth_enable"` 755 IPv6Enable bool `json:"ipv6_enable"` 756 PoolIDV6 string `json:"-"` 757 } 758 759 type BandWidth struct { 760 //BandWidth(Mbit/s)[1,300]。 761 Size int `json:"size,omitempty"` 762 763 //ShareTypde PER indicates exclusive, and WHOLE indicates shared. 764 ShareType string `json:"sharetype" required:"true"` 765 766 //ChargeMode 767 ChargeMode string `json:"chargemode,omitempty"` 768 769 //BandWidthID,When creating an elastic IP address for a bandwidth of the 770 //WHOLE type, you can specify the original shared bandwidth. 771 Id string `json:"id,omitempty"` 772 } 773 774 type RootVolume struct { 775 //the disk type of the ECS system disk. The disk type must match the disk 776 //type provided by the system. 777 VolumeType string `json:"volume_type" required:"true"` 778 779 //the system disk size. The unit is GB. The value ranges from 1 to 1024. 780 Size int `json:"size,omitempty"` 781 } 782 783 type DataVolume struct { 784 //the disk type of the ECS data disk. The disk type must match the disk 785 //type provided by the system. 786 VolumeType string `json:"volume_type" required:"true"` 787 788 //the data disk size in GB. The value ranges from 10 to 32768. 789 Size int `json:"size" required:"true"` 790 } 791 792 type SecurityGroup struct { 793 //云服务器组ID,UUID格式。 794 ID string `json:"id" required:"true"` 795 } 796 797 // KeyPair is an SSH key known to the OpenStack Cloud that is available to be 798 // injected into servers. 799 type KeyPair struct { 800 // Name is used to refer to this keypair from other services within this 801 // region. 802 Name string `json:"name"` 803 804 // Fingerprint is a short sequence of bytes that can be used to authenticate 805 // or validate a longer public key. 806 Fingerprint string `json:"fingerprint"` 807 808 // PublicKey is the public key from this pair, in OpenSSH format. 809 // "ssh-rsa AAAAB3Nz..." 810 PublicKey string `json:"public_key"` 811 812 // PrivateKey is the private key from this pair, in PEM format. 813 // "-----BEGIN RSA PRIVATE KEY-----\nMIICXA..." 814 // It is only present if this KeyPair was just returned from a Create call. 815 PrivateKey string `json:"private_key,omitempty"` 816 817 // UserID is the user who owns this KeyPair. 818 UserID string `json:"user_id,omitempty"` 819 } 820 821 // ReqSecurityGroupRuleEntity 创建安全组的规则的结构体 822 type ReqSecurityGroupRuleEntity struct { 823 Description string `json:"description,omitempty"` 824 SecurityGroupID string `json:"security_group_id"` 825 Direction string `json:"direction"` 826 EtherType string `json:"ethertype,omitempty"` 827 Protocol string `json:"protocol,omitempty"` 828 PortRangeMin interface{} `json:"port_range_min"` 829 PortRangeMax interface{} `json:"port_range_max"` 830 RemoteIPPrefix string `json:"remote_ip_prefix,omitempty"` 831 RemoteGroupID string `json:"remote_group_id,omitempty"` 832 } 833 834 // RespSecurityGroupRuleEntity 获取安全组安全组的规则的结构体 835 type RespSecurityGroupRuleEntity struct { 836 ID string `json:"id"` 837 Description string `json:"description"` 838 SecurityGroupID string `json:"security_group_id"` 839 Direction string `json:"direction"` 840 EtherType string `json:"ethertype"` 841 Protocol string `json:"protocol"` 842 PortRangeMin interface{} `json:"port_range_min"` 843 PortRangeMax interface{} `json:"port_range_max"` 844 RemoteIPPrefix string `json:"remote_ip_prefix"` 845 RemoteGroupID string `json:"remote_group_id"` 846 } 847 848 // 边缘资源组对象 849 type Stack struct { 850 Name string `json:"name"` 851 Resources []ResourceOpts `json:"resources"` 852 } 853 854 type DeploymentEdgecloud struct { 855 ID *string `json:"id,omitempty"` 856 Name *string `json:"name,omitempty"` 857 Stacks *Stack `json:"stacks,omitempty"` 858 Description *string `json:"description,omitempty"` 859 Coverage *Coverage `json:"coverage,omitempty"` 860 } 861 862 // Distribution 实例分布对象 863 type Distribution struct { 864 Area string `json:"area,omitempty"` 865 City string `json:"name,omitempty"` 866 Operator string `json:"operator,omitempty"` 867 Province string `json:"province,omitempty"` 868 SiteId string `json:"site_id,omitempty"` 869 PoolId string `json:"pool_id,omitempty"` 870 StackCount int32 `json:"stack_count,omitempty"` 871 CityShortName string `json:"city_count_name,omitempty"` 872 IPv6Enable bool `json:"ipv6_enable,omitempty"` 873 IPv6BandWidthEnable bool `json:"ipv6_bandwidth_enable,omitempty"` 874 PoolIDV6 string `json:"pool_id_v6,omitempty"` 875 } 876 877 // DeploymentResult 部署计划的查询结果 878 type DeploymentResult struct { 879 ID string `json:"id"` 880 EdgeCloud DeploymentEdgecloud `json:"edgecloud"` 881 Distributions []Distribution `json:"distribution"` 882 }