disk_edit.go raw
1 // Copyright 2022-2025 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 "github.com/sacloud/iaas-api-go/types"
18
19 // DiskEdit ディスクの修正パラメータ
20 type DiskEdit struct {
21 Password string `json:",omitempty" yaml:",omitempty" structs:",omitempty"` // パスワード
22 SSHKey *DiskEditSSHKey `json:",omitempty" yaml:",omitempty" structs:",omitempty"` // 公開鍵(単体)
23 SSHKeys []*DiskEditSSHKey `json:",omitempty" yaml:",omitempty" structs:",omitempty"` // 公開鍵(複数)
24 DisablePWAuth bool `json:",omitempty" yaml:",omitempty" structs:",omitempty"` // パスワード認証無効化フラグ
25 EnableDHCP bool `json:",omitempty" yaml:",omitempty" structs:",omitempty"` // DHCPの有効化
26 ChangePartitionUUID bool `json:",omitempty" yaml:",omitempty" structs:",omitempty"` // パーティションのUUID変更
27 HostName string `json:",omitempty" yaml:",omitempty" structs:",omitempty"` // ホスト名
28 Notes []*DiskEditNote `json:",omitempty" yaml:",omitempty" structs:",omitempty"` // スタートアップスクリプト
29 UserIPAddress string `json:",omitempty" yaml:",omitempty" structs:",omitempty"` // IPアドレス
30 UserSubnet *UserSubnet `json:",omitempty" yaml:",omitempty" structs:",omitempty"` // デフォルトルート/サブネットマスク長
31 Background bool `json:",omitempty" yaml:",omitempty" structs:",omitempty"` // バックグラウンド実行
32 }
33
34 // DiskEditSSHKey ディスク修正時のSSHキー
35 type DiskEditSSHKey struct {
36 ID types.ID `json:",omitempty" yaml:",omitempty" structs:",omitempty"`
37 PublicKey string `json:",omitempty" yaml:",omitempty" structs:",omitempty"`
38 }
39
40 // DiskEditNote ディスクの修正で指定するスタートアップスクリプト
41 type DiskEditNote struct {
42 ID types.ID `json:",omitempty" yaml:",omitempty" structs:",omitempty"`
43 APIKey *APIKey `json:",omitempty" yaml:"api_key,omitempty" structs:",omitempty"`
44 Variables map[string]interface{} `json:",omitempty" yaml:",omitempty" structs:",omitempty"`
45 }
46
47 type APIKey struct {
48 ID types.ID `json:",omitempty" yaml:",omitempty" structs:",omitempty"`
49 }
50