github.com/sacloud/iaas-api-go@v1.12.0/naked/gslb.go (about) 1 // Copyright 2022-2023 The sacloud/iaas-api-go Authors 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 package naked 16 17 import ( 18 "time" 19 20 "github.com/sacloud/iaas-api-go/types" 21 ) 22 23 // GSLB GSLB 24 type GSLB struct { 25 ID types.ID `json:",omitempty" yaml:"id,omitempty" structs:",omitempty"` 26 Name string `json:",omitempty" yaml:"name,omitempty" structs:",omitempty"` 27 Description string `yaml:"description"` 28 Tags types.Tags `yaml:"tags"` 29 Icon *Icon `json:",omitempty" yaml:"icon,omitempty" structs:",omitempty"` 30 CreatedAt *time.Time `json:",omitempty" yaml:"created_at,omitempty" structs:",omitempty"` 31 ModifiedAt *time.Time `json:",omitempty" yaml:"modified_at,omitempty" structs:",omitempty"` 32 Availability types.EAvailability `json:",omitempty" yaml:"availability,omitempty" structs:",omitempty"` 33 ServiceClass string `json:",omitempty" yaml:"service_class,omitempty" structs:",omitempty"` 34 Provider *Provider `json:",omitempty" yaml:"provider,omitempty" structs:",omitempty"` 35 Settings *GSLBSettings `json:",omitempty" yaml:"settings,omitempty" structs:",omitempty"` 36 SettingsHash string `json:",omitempty" yaml:"settings_hash,omitempty" structs:",omitempty"` 37 Status *GSLBStatus `json:",omitempty" yaml:"status,omitempty" structs:",omitempty"` 38 } 39 40 // GSLBSettingsUpdate GSLB 41 type GSLBSettingsUpdate struct { 42 Settings *GSLBSettings `json:",omitempty" yaml:"settings,omitempty" structs:",omitempty"` 43 SettingsHash string `json:",omitempty" yaml:"settings_hash,omitempty" structs:",omitempty"` 44 } 45 46 // GSLBSettings GSLBの設定 47 type GSLBSettings struct { 48 GSLB *GSLBSetting `json:",omitempty" yaml:"gslb,omitempty" structs:",omitempty"` 49 } 50 51 // GSLBSetting GSLBの設定 52 type GSLBSetting struct { 53 DelayLoop int `json:",omitempty" yaml:"delay_loop,omitempty" structs:",omitempty"` 54 HealthCheck *GSLBHealthCheck `json:",omitempty" yaml:"health_check,omitempty" structs:",omitempty"` 55 Weighted types.StringFlag `yaml:"weighted"` 56 Servers []*GSLBServer `yaml:"servers"` 57 SorryServer string `json:",omitempty" yaml:",omitempty" structs:",omitempty"` // ソーリーサーバー 58 } 59 60 // GSLBHealthCheck ヘルスチェック 61 type GSLBHealthCheck struct { 62 Protocol types.Protocol `json:",omitempty" yaml:"protocol,omitempty" structs:""` // プロトコル 63 Host string `json:",omitempty" yaml:"host,omitempty" structs:""` // 対象ホスト 64 Path string `json:",omitempty" yaml:"path,omitempty" structs:""` // HTTP/HTTPSの場合のリクエストパス 65 Status types.StringNumber `json:",omitempty" yaml:"status,omitempty" structs:""` // 期待するステータスコード 66 Port types.StringNumber `json:",omitempty" yaml:"port,omitempty" structs:""` // ポート番号 67 } 68 69 // GSLBServer GSLB配下のサーバー 70 type GSLBServer struct { 71 IPAddress string `json:",omitempty" yaml:"ip_address,omitempty" structs:",omitempty"` // IPアドレス 72 Enabled types.StringFlag `yaml:"enabled" ` // 有効/無効 73 Weight types.StringNumber `json:",omitempty" yaml:"weight,omitempty" structs:",omitempty"` // ウェイト 74 } 75 76 // GSLBStatus GSLBステータス 77 type GSLBStatus struct { 78 FQDN string `json:",omitempty" yaml:"fqdn,omitempty" structs:",omitempty"` 79 }