fix: update lego.
This commit is contained in:
parent
b8b0c8f3e5
commit
8d848c3d60
169 changed files with 12224 additions and 605 deletions
73
vendor/github.com/sacloud/libsacloud/api/disk.go
generated
vendored
73
vendor/github.com/sacloud/libsacloud/api/disk.go
generated
vendored
|
@ -2,8 +2,9 @@ package api
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/sacloud/libsacloud/sacloud"
|
||||
"time"
|
||||
|
||||
"github.com/sacloud/libsacloud/sacloud"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -56,7 +57,50 @@ func (api *DiskAPI) Create(value *sacloud.Disk) (*sacloud.Disk, error) {
|
|||
Success string `json:",omitempty"`
|
||||
}
|
||||
res := &diskResponse{}
|
||||
err := api.create(api.createRequest(value), res)
|
||||
|
||||
rawBody := &sacloud.Request{}
|
||||
rawBody.Disk = value
|
||||
if len(value.DistantFrom) > 0 {
|
||||
rawBody.DistantFrom = value.DistantFrom
|
||||
value.DistantFrom = []int64{}
|
||||
}
|
||||
|
||||
err := api.create(rawBody, res)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return res.Disk, nil
|
||||
}
|
||||
|
||||
// CreateWithConfig ディスク作成とディスクの修正、サーバ起動(指定されていれば)を1回のAPI呼び出しで実行
|
||||
func (api *DiskAPI) CreateWithConfig(value *sacloud.Disk, config *sacloud.DiskEditValue, bootAtAvailable bool) (*sacloud.Disk, error) {
|
||||
//HACK: さくらのAPI側仕様: 戻り値:Successがbool値へ変換できないため文字列で受ける("Accepted"などが返る)
|
||||
type diskResponse struct {
|
||||
*sacloud.Response
|
||||
// Success
|
||||
Success string `json:",omitempty"`
|
||||
}
|
||||
res := &diskResponse{}
|
||||
|
||||
type diskRequest struct {
|
||||
*sacloud.Request
|
||||
Config *sacloud.DiskEditValue `json:",omitempty"`
|
||||
BootAtAvailable bool `json:",omitempty"`
|
||||
}
|
||||
|
||||
rawBody := &diskRequest{
|
||||
Request: &sacloud.Request{},
|
||||
BootAtAvailable: bootAtAvailable,
|
||||
}
|
||||
rawBody.Disk = value
|
||||
rawBody.Config = config
|
||||
|
||||
if len(value.DistantFrom) > 0 {
|
||||
rawBody.DistantFrom = value.DistantFrom
|
||||
value.DistantFrom = []int64{}
|
||||
}
|
||||
|
||||
err := api.create(rawBody, res)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -90,7 +134,14 @@ func (api *DiskAPI) install(id int64, body *sacloud.Disk) (bool, error) {
|
|||
Success string `json:",omitempty"`
|
||||
}
|
||||
res := &diskResponse{}
|
||||
err := api.baseAPI.request(method, uri, body, res)
|
||||
rawBody := &sacloud.Request{}
|
||||
rawBody.Disk = body
|
||||
if len(body.DistantFrom) > 0 {
|
||||
rawBody.DistantFrom = body.DistantFrom
|
||||
body.DistantFrom = []int64{}
|
||||
}
|
||||
|
||||
err := api.baseAPI.request(method, uri, rawBody, res)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
@ -213,6 +264,14 @@ func (api *DiskAPI) CanEditDisk(id int64) (bool, error) {
|
|||
if disk.HasTag("pkg-sophosutm") || disk.IsSophosUTM() {
|
||||
return false, nil
|
||||
}
|
||||
// OPNsenseであれば編集不可
|
||||
if disk.HasTag("distro-opnsense") {
|
||||
return false, nil
|
||||
}
|
||||
// Netwiser VEであれば編集不可
|
||||
if disk.HasTag("pkg-netwiserve") {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
// ソースアーカイブ/ソースディスクともに持っていない場合
|
||||
if disk.SourceArchive == nil && disk.SourceDisk == nil {
|
||||
|
@ -263,6 +322,14 @@ func (api *DiskAPI) GetPublicArchiveIDFromAncestors(id int64) (int64, bool) {
|
|||
if disk.HasTag("pkg-sophosutm") || disk.IsSophosUTM() {
|
||||
return emptyID, false
|
||||
}
|
||||
// OPNsenseであれば編集不可
|
||||
if disk.HasTag("distro-opnsense") {
|
||||
return emptyID, false
|
||||
}
|
||||
// Netwiser VEであれば編集不可
|
||||
if disk.HasTag("pkg-netwiserve") {
|
||||
return emptyID, false
|
||||
}
|
||||
|
||||
for _, t := range allowDiskEditTags {
|
||||
if disk.HasTag(t) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue