build-from-newest-api-specs

This commit is contained in:
rogerhu 2018-06-22 00:53:39 +08:00
parent 05aacd4b8c
commit f649f33c07
8 changed files with 317 additions and 216 deletions

View File

@ -435,95 +435,6 @@ type DissociateEIPsOutput struct {
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
}
// Documentation URL: https://docs.qingcloud.com/api/monitor/get_monitor.html
func (s *EIPService) GetEIPMonitor(i *GetEIPMonitorInput) (*GetEIPMonitorOutput, error) {
if i == nil {
i = &GetEIPMonitorInput{}
}
o := &data.Operation{
Config: s.Config,
Properties: s.Properties,
APIName: "GetMonitor",
RequestMethod: "GET",
}
x := &GetEIPMonitorOutput{}
r, err := request.New(o, i, x)
if err != nil {
return nil, err
}
err = r.Send()
if err != nil {
return nil, err
}
return x, err
}
type GetEIPMonitorInput struct {
EndTime *time.Time `json:"end_time" name:"end_time" format:"ISO 8601" location:"params"` // Required
Meters []*string `json:"meters" name:"meters" location:"params"` // Required
Resource *string `json:"resource" name:"resource" location:"params"` // Required
StartTime *time.Time `json:"start_time" name:"start_time" format:"ISO 8601" location:"params"` // Required
// Step's available values: 5m, 15m, 2h, 1d
Step *string `json:"step" name:"step" location:"params"` // Required
}
func (v *GetEIPMonitorInput) Validate() error {
if len(v.Meters) == 0 {
return errors.ParameterRequiredError{
ParameterName: "Meters",
ParentName: "GetEIPMonitorInput",
}
}
if v.Resource == nil {
return errors.ParameterRequiredError{
ParameterName: "Resource",
ParentName: "GetEIPMonitorInput",
}
}
if v.Step == nil {
return errors.ParameterRequiredError{
ParameterName: "Step",
ParentName: "GetEIPMonitorInput",
}
}
if v.Step != nil {
stepValidValues := []string{"5m", "15m", "2h", "1d"}
stepParameterValue := fmt.Sprint(*v.Step)
stepIsValid := false
for _, value := range stepValidValues {
if value == stepParameterValue {
stepIsValid = true
}
}
if !stepIsValid {
return errors.ParameterValueNotAllowedError{
ParameterName: "Step",
ParameterValue: stepParameterValue,
AllowedValues: stepValidValues,
}
}
}
return nil
}
type GetEIPMonitorOutput struct {
Message *string `json:"message" name:"message"`
Action *string `json:"action" name:"action" location:"elements"`
MeterSet []*Meter `json:"meter_set" name:"meter_set" location:"elements"`
ResourceID *string `json:"resource_id" name:"resource_id" location:"elements"`
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
}
// Documentation URL: https://docs.qingcloud.com/api/eip/modify_eip_attributes.html
func (s *EIPService) ModifyEIPAttributes(i *ModifyEIPAttributesInput) (*ModifyEIPAttributesOutput, error) {
if i == nil {

View File

@ -234,95 +234,6 @@ type DescribeInstancesOutput struct {
TotalCount *int `json:"total_count" name:"total_count" location:"elements"`
}
// Documentation URL: https://docs.qingcloud.com/api/monitor/get_monitor.html
func (s *InstanceService) GetInstanceMonitor(i *GetInstanceMonitorInput) (*GetInstanceMonitorOutput, error) {
if i == nil {
i = &GetInstanceMonitorInput{}
}
o := &data.Operation{
Config: s.Config,
Properties: s.Properties,
APIName: "GetMonitor",
RequestMethod: "GET",
}
x := &GetInstanceMonitorOutput{}
r, err := request.New(o, i, x)
if err != nil {
return nil, err
}
err = r.Send()
if err != nil {
return nil, err
}
return x, err
}
type GetInstanceMonitorInput struct {
EndTime *time.Time `json:"end_time" name:"end_time" format:"ISO 8601" location:"params"` // Required
Meters []*string `json:"meters" name:"meters" location:"params"` // Required
Resource *string `json:"resource" name:"resource" location:"params"` // Required
StartTime *time.Time `json:"start_time" name:"start_time" format:"ISO 8601" location:"params"` // Required
// Step's available values: 5m, 15m, 2h, 1d
Step *string `json:"step" name:"step" location:"params"` // Required
}
func (v *GetInstanceMonitorInput) Validate() error {
if len(v.Meters) == 0 {
return errors.ParameterRequiredError{
ParameterName: "Meters",
ParentName: "GetInstanceMonitorInput",
}
}
if v.Resource == nil {
return errors.ParameterRequiredError{
ParameterName: "Resource",
ParentName: "GetInstanceMonitorInput",
}
}
if v.Step == nil {
return errors.ParameterRequiredError{
ParameterName: "Step",
ParentName: "GetInstanceMonitorInput",
}
}
if v.Step != nil {
stepValidValues := []string{"5m", "15m", "2h", "1d"}
stepParameterValue := fmt.Sprint(*v.Step)
stepIsValid := false
for _, value := range stepValidValues {
if value == stepParameterValue {
stepIsValid = true
}
}
if !stepIsValid {
return errors.ParameterValueNotAllowedError{
ParameterName: "Step",
ParameterValue: stepParameterValue,
AllowedValues: stepValidValues,
}
}
}
return nil
}
type GetInstanceMonitorOutput struct {
Message *string `json:"message" name:"message"`
Action *string `json:"action" name:"action" location:"elements"`
MeterSet []*Meter `json:"meter_set" name:"meter_set" location:"elements"`
ResourceID *string `json:"resource_id" name:"resource_id" location:"elements"`
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
}
// Documentation URL: https://docs.qingcloud.com/api/instance/modify_instance_attributes.html
func (s *InstanceService) ModifyInstanceAttributes(i *ModifyInstanceAttributesInput) (*ModifyInstanceAttributesOutput, error) {
if i == nil {
@ -652,6 +563,7 @@ type RunInstancesInput struct {
CPU *int `json:"cpu" name:"cpu" default:"1" location:"params"`
// CPUMax's available values: 1, 2, 4, 8, 16
CPUMax *int `json:"cpu_max" name:"cpu_max" location:"params"`
Gpu *int `json:"gpu" name:"gpu" default:"0" location:"params"`
Hostname *string `json:"hostname" name:"hostname" location:"params"`
ImageID *string `json:"image_id" name:"image_id" location:"params"` // Required
// InstanceClass's available values: 0, 1

94
service/misc.go Normal file
View File

@ -0,0 +1,94 @@
// +-------------------------------------------------------------------------
// | Copyright (C) 2016 Yunify, Inc.
// +-------------------------------------------------------------------------
// | Licensed under the Apache License, Version 2.0 (the "License");
// | you may not use this work except in compliance with the License.
// | You may obtain a copy of the License in the LICENSE file, or 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.
// +-------------------------------------------------------------------------
package service
import (
"fmt"
"time"
"github.com/yunify/qingcloud-sdk-go/config"
"github.com/yunify/qingcloud-sdk-go/request"
"github.com/yunify/qingcloud-sdk-go/request/data"
"github.com/yunify/qingcloud-sdk-go/request/errors"
)
var _ fmt.State
var _ time.Time
type MiscService struct {
Config *config.Config
Properties *MiscServiceProperties
}
type MiscServiceProperties struct {
}
func (s *QingCloudService) Misc() (*MiscService, error) {
properties := &MiscServiceProperties{}
return &MiscService{Config: s.Config, Properties: properties}, nil
}
// Documentation URL: https://docs.qingcloud.com/product/api/action/misc/get_quota_left.html
func (s *MiscService) GetQuotaLeft(i *GetQuotaLeftInput) (*GetQuotaLeftOutput, error) {
if i == nil {
i = &GetQuotaLeftInput{}
}
o := &data.Operation{
Config: s.Config,
Properties: s.Properties,
APIName: "GetQuotaLeft",
RequestMethod: "GET",
}
x := &GetQuotaLeftOutput{}
r, err := request.New(o, i, x)
if err != nil {
return nil, err
}
err = r.Send()
if err != nil {
return nil, err
}
return x, err
}
type GetQuotaLeftInput struct {
ResourceTypes []*string `json:"resource_types" name:"resource_types" location:"params"`
Zone *string `json:"zone" name:"zone" location:"params"` // Required
}
func (v *GetQuotaLeftInput) Validate() error {
if v.Zone == nil {
return errors.ParameterRequiredError{
ParameterName: "Zone",
ParentName: "GetQuotaLeftInput",
}
}
return nil
}
type GetQuotaLeftOutput struct {
Message *string `json:"message" name:"message"`
Action *string `json:"action" name:"action" location:"elements"`
QuotaLeftSet []*QuotaLeft `json:"quota_left_set" name:"quota_left_set" location:"elements"`
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
}

116
service/monitor.go Normal file
View File

@ -0,0 +1,116 @@
// +-------------------------------------------------------------------------
// | Copyright (C) 2016 Yunify, Inc.
// +-------------------------------------------------------------------------
// | Licensed under the Apache License, Version 2.0 (the "License");
// | you may not use this work except in compliance with the License.
// | You may obtain a copy of the License in the LICENSE file, or 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.
// +-------------------------------------------------------------------------
package service
import (
"fmt"
"time"
"github.com/yunify/qingcloud-sdk-go/config"
"github.com/yunify/qingcloud-sdk-go/request"
"github.com/yunify/qingcloud-sdk-go/request/data"
"github.com/yunify/qingcloud-sdk-go/request/errors"
)
var _ fmt.State
var _ time.Time
type MonitorService struct {
Config *config.Config
Properties *MonitorServiceProperties
}
type MonitorServiceProperties struct {
// QingCloud Zone ID
Zone *string `json:"zone" name:"zone"` // Required
}
func (s *QingCloudService) Monitor(zone string) (*MonitorService, error) {
properties := &MonitorServiceProperties{
Zone: &zone,
}
return &MonitorService{Config: s.Config, Properties: properties}, nil
}
// Documentation URL: https://docs.qingcloud.com/api/monitor/get_monitor.html
func (s *MonitorService) GetMonitor(i *GetMonitorInput) (*GetMonitorOutput, error) {
if i == nil {
i = &GetMonitorInput{}
}
o := &data.Operation{
Config: s.Config,
Properties: s.Properties,
APIName: "GetMonitor",
RequestMethod: "GET",
}
x := &GetMonitorOutput{}
r, err := request.New(o, i, x)
if err != nil {
return nil, err
}
err = r.Send()
if err != nil {
return nil, err
}
return x, err
}
type GetMonitorInput struct {
EndTime *time.Time `json:"end_time" name:"end_time" format:"ISO 8601" location:"params"`
Meters []*string `json:"meters" name:"meters" location:"params"`
Resource *string `json:"resource" name:"resource" location:"params"`
StartTime *time.Time `json:"start_time" name:"start_time" format:"ISO 8601" location:"params"`
// Step's available values: 5m, 15m, 2h, 1d
Step *string `json:"step" name:"step" location:"params"`
}
func (v *GetMonitorInput) Validate() error {
if v.Step != nil {
stepValidValues := []string{"5m", "15m", "2h", "1d"}
stepParameterValue := fmt.Sprint(*v.Step)
stepIsValid := false
for _, value := range stepValidValues {
if value == stepParameterValue {
stepIsValid = true
}
}
if !stepIsValid {
return errors.ParameterValueNotAllowedError{
ParameterName: "Step",
ParameterValue: stepParameterValue,
AllowedValues: stepValidValues,
}
}
}
return nil
}
type GetMonitorOutput struct {
Message *string `json:"message" name:"message"`
Action *string `json:"action" name:"action" location:"elements"`
MeterSet []*Meter `json:"meter_set" name:"meter_set" location:"elements"`
ResourceID *string `json:"resource_id" name:"resource_id" location:"elements"`
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
}

View File

@ -372,7 +372,7 @@ func (s *NicService) ModifyNicAttributes(i *ModifyNicAttributesInput) (*ModifyNi
}
type ModifyNicAttributesInput struct {
NICID *string `json:"nic_id" name:"nic_id" location:"params"` // Required
NIC *string `json:"nic" name:"nic" location:"params"` // Required
NICName *string `json:"nic_name" name:"nic_name" location:"params"`
PrivateIP *string `json:"private_ip" name:"private_ip" location:"params"`
VxNet *string `json:"vxnet" name:"vxnet" location:"params"`
@ -380,9 +380,9 @@ type ModifyNicAttributesInput struct {
func (v *ModifyNicAttributesInput) Validate() error {
if v.NICID == nil {
if v.NIC == nil {
return errors.ParameterRequiredError{
ParameterName: "NICID",
ParameterName: "NIC",
ParentName: "ModifyNicAttributesInput",
}
}

View File

@ -417,7 +417,7 @@ type DescribeRouterStaticEntriesInput struct {
Limit *int `json:"limit" name:"limit" location:"params"`
Offset *int `json:"offset" name:"offset" location:"params"`
RouterStatic *string `json:"router_static" name:"router_static" location:"params"`
RouterStaticEntryID *string `json:"router_static_entry_id" name:"router_static_entry_id" location:"params"`
RouterStaticEntries *string `json:"router_static_entries" name:"router_static_entries" location:"params"`
}
func (v *DescribeRouterStaticEntriesInput) Validate() error {
@ -832,13 +832,15 @@ func (v *GetVPNCertsInput) Validate() error {
}
type GetVPNCertsOutput struct {
Message *string `json:"message" name:"message"`
Action *string `json:"action" name:"action" location:"elements"`
CaCert *string `json:"ca_cert" name:"ca_cert" location:"elements"`
ClientCrt *string `json:"client_crt" name:"client_crt" location:"elements"`
ClientKey *string `json:"client_key" name:"client_key" location:"elements"`
LinuxConfSample *string `json:"linux_conf_sample" name:"linux_conf_sample" location:"elements"`
MacConfSample *string `json:"mac_conf_sample" name:"mac_conf_sample" location:"elements"`
Message *string `json:"message" name:"message"`
Action *string `json:"action" name:"action" location:"elements"`
CaCert *string `json:"ca_cert" name:"ca_cert" location:"elements"`
ClientCrt *string `json:"client_crt" name:"client_crt" location:"elements"`
ClientKey *string `json:"client_key" name:"client_key" location:"elements"`
LinuxConfSample *string `json:"linux_conf_sample" name:"linux_conf_sample" location:"elements"`
MacConfSample *string `json:"mac_conf_sample" name:"mac_conf_sample" location:"elements"`
// Platform's available values: linux, windows, mac
Platform *string `json:"platform" name:"platform" location:"elements"`
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
RouterID *string `json:"router_id" name:"router_id" location:"elements"`
StaticKey *string `json:"static_key" name:"static_key" location:"elements"`
@ -1108,6 +1110,9 @@ type ModifyRouterStaticAttributesInput struct {
Val4 *string `json:"val4" name:"val4" location:"params"`
Val5 *string `json:"val5" name:"val5" location:"params"`
Val6 *string `json:"val6" name:"val6" location:"params"`
Val7 *string `json:"val7" name:"val7" location:"params"`
Val8 *string `json:"val8" name:"val8" location:"params"`
Val9 *string `json:"val9" name:"val9" location:"params"`
}
func (v *ModifyRouterStaticAttributesInput) Validate() error {

View File

@ -349,10 +349,11 @@ func (s *SnapshotService) DescribeSnapshots(i *DescribeSnapshotsInput) (*Describ
}
type DescribeSnapshotsInput struct {
Limit *int `json:"limit" name:"limit" default:"20" location:"params"`
Offset *int `json:"offset" name:"offset" default:"0" location:"params"`
ResourceID *string `json:"resource_id" name:"resource_id" location:"params"`
SearchWord *string `json:"search_word" name:"search_word" location:"params"`
Limit *int `json:"limit" name:"limit" default:"20" location:"params"`
Offset *int `json:"offset" name:"offset" default:"0" location:"params"`
ResourceID *string `json:"resource_id" name:"resource_id" location:"params"`
SearchWord *string `json:"search_word" name:"search_word" location:"params"`
SnapshotTime *string `json:"snapshot_time" name:"snapshot_time" location:"params"`
// SnapshotType's available values: 0, 1
SnapshotType *int `json:"snapshot_type" name:"snapshot_type" location:"params"`
Snapshots []*string `json:"snapshots" name:"snapshots" location:"params"`
@ -412,6 +413,7 @@ type DescribeSnapshotsOutput struct {
Action *string `json:"action" name:"action" location:"elements"`
RetCode *int `json:"ret_code" name:"ret_code" location:"elements"`
SnapshotSet []*Snapshot `json:"snapshot_set" name:"snapshot_set" location:"elements"`
TotalCount *int `json:"total_count" name:"total_count" location:"elements"`
}
// Documentation URL: https://docs.qingcloud.com/api/snapshot/modify_snapshot_attributes.html

View File

@ -913,21 +913,18 @@ type Instance struct {
CreateTime *time.Time `json:"create_time" name:"create_time" format:"ISO 8601"`
Description *string `json:"description" name:"description"`
Device *string `json:"device" name:"device"`
DHCPOptions *DHCPOption `json:"dhcp_options" name:"dhcp_options"`
DNSAliases []*DNSAlias `json:"dns_aliases" name:"dns_aliases"`
EIP *EIP `json:"eip" name:"eip"`
Extra *Extra `json:"extra" name:"extra"`
GraphicsPasswd *string `json:"graphics_passwd" name:"graphics_passwd"`
GraphicsProtocol *string `json:"graphics_protocol" name:"graphics_protocol"`
Image *Image `json:"image" name:"image"`
ImageID *string `json:"image_id" name:"image_id"`
InstanceClass *int `json:"instance_class" name:"instance_class"`
InstanceID *string `json:"instance_id" name:"instance_id"`
InstanceName *string `json:"instance_name" name:"instance_name"`
InstanceType *string `json:"instance_type" name:"instance_type"`
KeyPairIDs []*string `json:"keypair_ids" name:"keypair_ids"`
MemoryCurrent *int `json:"memory_current" name:"memory_current"`
PrivateIP *string `json:"private_ip" name:"private_ip"`
SecurityGroup *SecurityGroup `json:"security_group" name:"security_group"`
// Status's available values: pending, running, stopped, suspended, terminated, ceased
Status *string `json:"status" name:"status"`
@ -935,21 +932,15 @@ type Instance struct {
SubCode *int `json:"sub_code" name:"sub_code"`
Tags []*Tag `json:"tags" name:"tags"`
// TransitionStatus's available values: creating, starting, stopping, restarting, suspending, resuming, terminating, recovering, resetting
TransitionStatus *string `json:"transition_status" name:"transition_status"`
VCPUsCurrent *int `json:"vcpus_current" name:"vcpus_current"`
VolumeIDs []*string `json:"volume_ids" name:"volume_ids"`
Volumes []*Volume `json:"volumes" name:"volumes"`
VxNets []*InstanceVxNet `json:"vxnets" name:"vxnets"`
TransitionStatus *string `json:"transition_status" name:"transition_status"`
VCPUsCurrent *int `json:"vcpus_current" name:"vcpus_current"`
VolumeIDs []*string `json:"volume_ids" name:"volume_ids"`
Volumes []*Volume `json:"volumes" name:"volumes"`
VxNets []*NICVxNet `json:"vxnets" name:"vxnets"`
}
func (v *Instance) Validate() error {
if v.DHCPOptions != nil {
if err := v.DHCPOptions.Validate(); err != nil {
return err
}
}
if len(v.DNSAliases) > 0 {
for _, property := range v.DNSAliases {
if err := property.Validate(); err != nil {
@ -1157,13 +1148,17 @@ func (v *Job) Validate() error {
}
type KeyPair struct {
Description *string `json:"description" name:"description"`
CreateTime *time.Time `json:"create_time" name:"create_time" format:"ISO 8601"`
Description *string `json:"description" name:"description"`
// EncryptMethod's available values: ssh-rsa, ssh-dss
EncryptMethod *string `json:"encrypt_method" name:"encrypt_method"`
InstanceIDs []*string `json:"instance_ids" name:"instance_ids"`
KeyPairID *string `json:"keypair_id" name:"keypair_id"`
KeyPairName *string `json:"keypair_name" name:"keypair_name"`
Owner *string `json:"owner" name:"owner"`
PrivKey *string `json:"priv_key" name:"priv_key"`
PubKey *string `json:"pub_key" name:"pub_key"`
ResourceIDs *string `json:"resource_ids" name:"resource_ids"`
Tags []*Tag `json:"tags" name:"tags"`
}
@ -1459,8 +1454,7 @@ func (v *LoadBalancerPolicyRule) Validate() error {
}
type Meter struct {
Data interface{} `json:"data" name:"data"`
DataSet []interface{} `json:"data_set" name:"data_set"`
Data []interface{} `json:"data" name:"data"`
MeterID *string `json:"meter_id" name:"meter_id"`
Sequence *int `json:"sequence" name:"sequence"`
VxNetID *string `json:"vxnet_id" name:"vxnet_id"`
@ -1676,6 +1670,7 @@ func (v *MongoPrivateIP) Validate() error {
type NIC struct {
CreateTime *time.Time `json:"create_time" name:"create_time" format:"ISO 8601"`
EIP *NICEIP `json:"eip" name:"eip"`
InstanceID *string `json:"instance_id" name:"instance_id"`
NICID *string `json:"nic_id" name:"nic_id"`
NICName *string `json:"nic_name" name:"nic_name"`
@ -1694,6 +1689,12 @@ type NIC struct {
func (v *NIC) Validate() error {
if v.EIP != nil {
if err := v.EIP.Validate(); err != nil {
return err
}
}
if v.Status != nil {
statusValidValues := []string{"available", "in-use"}
statusParameterValue := fmt.Sprint(*v.Status)
@ -1725,6 +1726,17 @@ func (v *NIC) Validate() error {
return nil
}
type NICEIP struct {
Bandwidth *int `json:"bandwidth" name:"bandwidth"`
EIPAddr *string `json:"eip_addr" name:"eip_addr"`
EIPID *string `json:"eip_id" name:"eip_id"`
}
func (v *NICEIP) Validate() error {
return nil
}
type NICIP struct {
NICID *string `json:"nic_id" name:"nic_id"`
PrivateIP *string `json:"private_ip" name:"private_ip"`
@ -1735,6 +1747,30 @@ func (v *NICIP) Validate() error {
return nil
}
type NICVxNet struct {
NICID *string `json:"nic_id" name:"nic_id"`
PrivateIP *string `json:"private_ip" name:"private_ip"`
Role *int `json:"role" name:"role"`
VxNetID *string `json:"vxnet_id" name:"vxnet_id"`
VxNetName *string `json:"vxnet_name" name:"vxnet_name"`
VxNetType *int `json:"vxnet_type" name:"vxnet_type"`
}
func (v *NICVxNet) Validate() error {
return nil
}
type QuotaLeft struct {
Left *int `json:"left" name:"left"`
ResourceType *string `json:"resource_type" name:"resource_type"`
}
func (v *QuotaLeft) Validate() error {
return nil
}
type RDB struct {
// AlarmStatus's available values: ok, alarm, insufficient
AlarmStatus *string `json:"alarm_status" name:"alarm_status"`
@ -2063,6 +2099,7 @@ type Router struct {
Tags []*Tag `json:"tags" name:"tags"`
// TransitionStatus's available values: creating, updating, suspending, resuming, poweroffing, poweroning, deleting
TransitionStatus *string `json:"transition_status" name:"transition_status"`
VpcNetwork *string `json:"vpc_network" name:"vpc_network"`
VxNets []*VxNet `json:"vxnets" name:"vxnets"`
}
@ -2174,10 +2211,11 @@ func (v *Router) Validate() error {
}
type RouterStatic struct {
CreateTime *time.Time `json:"create_time" name:"create_time" format:"ISO 8601"`
RouterID *string `json:"router_id" name:"router_id"`
RouterStaticID *string `json:"router_static_id" name:"router_static_id"`
RouterStaticName *string `json:"router_static_name" name:"router_static_name"`
CreateTime *time.Time `json:"create_time" name:"create_time" format:"ISO 8601"`
EntrySet []*RouterStaticEntrySimple `json:"entry_set" name:"entry_set"`
RouterID *string `json:"router_id" name:"router_id"`
RouterStaticID *string `json:"router_static_id" name:"router_static_id"`
RouterStaticName *string `json:"router_static_name" name:"router_static_name"`
// StaticType's available values: 1, 2, 3, 4, 5, 6, 7, 8
StaticType *int `json:"static_type" name:"static_type"`
Val1 *string `json:"val1" name:"val1"`
@ -2186,11 +2224,22 @@ type RouterStatic struct {
Val4 *string `json:"val4" name:"val4"`
Val5 *string `json:"val5" name:"val5"`
Val6 *string `json:"val6" name:"val6"`
Val7 *string `json:"val7" name:"val7"`
Val8 *string `json:"val8" name:"val8"`
Val9 *string `json:"val9" name:"val9"`
VxNetID *string `json:"vxnet_id" name:"vxnet_id"`
}
func (v *RouterStatic) Validate() error {
if len(v.EntrySet) > 0 {
for _, property := range v.EntrySet {
if err := property.Validate(); err != nil {
return err
}
}
}
if v.StaticType != nil {
staticTypeValidValues := []string{"1", "2", "3", "4", "5", "6", "7", "8"}
staticTypeParameterValue := fmt.Sprint(*v.StaticType)
@ -2218,6 +2267,7 @@ type RouterStaticEntry struct {
RouterID *string `json:"router_id" name:"router_id"`
RouterStaticEntryID *string `json:"router_static_entry_id" name:"router_static_entry_id"`
RouterStaticEntryName *string `json:"router_static_entry_name" name:"router_static_entry_name"`
RouterStaticID *string `json:"router_static_id" name:"router_static_id"`
Val1 *string `json:"val1" name:"val1"`
Val2 *string `json:"val2" name:"val2"`
}
@ -2227,6 +2277,17 @@ func (v *RouterStaticEntry) Validate() error {
return nil
}
type RouterStaticEntrySimple struct {
RouterStaticEntryID *string `json:"router_static_entry_id" name:"router_static_entry_id"`
Val1 *string `json:"val1" name:"val1"`
Val2 *string `json:"val2" name:"val2"`
}
func (v *RouterStaticEntrySimple) Validate() error {
return nil
}
type RouterVxNet struct {
CreateTime *time.Time `json:"create_time" name:"create_time" format:"ISO 8601"`
DYNIPEnd *string `json:"dyn_ip_end" name:"dyn_ip_end"`
@ -2595,7 +2656,7 @@ func (v *ServerCertificate) Validate() error {
type Snapshot struct {
CreateTime *time.Time `json:"create_time" name:"create_time" format:"ISO 8601"`
Description *string `json:"description" name:"description"`
HeadChain *string `json:"head_chain" name:"head_chain"`
HeadChain *int `json:"head_chain" name:"head_chain"`
// IsHead's available values: 0, 1
IsHead *int `json:"is_head" name:"is_head"`
// IsTaken's available values: 0, 1
@ -2611,7 +2672,7 @@ type Snapshot struct {
SnapshotResource *SnapshotResource `json:"snapshot_resource" name:"snapshot_resource"`
SnapshotTime *time.Time `json:"snapshot_time" name:"snapshot_time" format:"ISO 8601"`
// SnapshotType's available values: 0, 1
SnapshotType *string `json:"snapshot_type" name:"snapshot_type"`
SnapshotType *int `json:"snapshot_type" name:"snapshot_type"`
// Status's available values: pending, available, suspended, deleted, ceased
Status *string `json:"status" name:"status"`
StatusTime *time.Time `json:"status_time" name:"status_time" format:"ISO 8601"`