diff --git a/cmd/internal/x/x.gen.go b/cmd/internal/x/x.gen.go index 89d4fdc0d..a1cd7ae15 100644 --- a/cmd/internal/x/x.gen.go +++ b/cmd/internal/x/x.gen.go @@ -27,9 +27,9 @@ func xServers() []map[string]string { } } -// XCreateAntiAffinityGroup Create an Anti-affinity Group -func XCreateAntiAffinityGroup(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-anti-affinity-group" +// XCreateDeployment [BETA] Create Deployment +func XCreateDeployment(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-deployment" if xSubcommand { handlerPath = "x " + handlerPath } @@ -39,7 +39,7 @@ func XCreateAntiAffinityGroup(params *viper.Viper, body string) (*gentleman.Resp server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/anti-affinity-group" + url := server + "/ai/deployment" req := cli.Client.Post().URL(url) @@ -72,9 +72,9 @@ func XCreateAntiAffinityGroup(params *viper.Viper, body string) (*gentleman.Resp return resp, decoded, nil } -// XListAntiAffinityGroups List Anti-affinity Groups -func XListAntiAffinityGroups(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "list-anti-affinity-groups" +// XListDeployments [BETA] List Deployments +func XListDeployments(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-deployments" if xSubcommand { handlerPath = "x " + handlerPath } @@ -84,7 +84,7 @@ func XListAntiAffinityGroups(params *viper.Viper) (*gentleman.Response, map[stri server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/anti-affinity-group" + url := server + "/ai/deployment" req := cli.Client.Get().URL(url) @@ -113,9 +113,9 @@ func XListAntiAffinityGroups(params *viper.Viper) (*gentleman.Response, map[stri return resp, decoded, nil } -// XDeleteAntiAffinityGroup Delete an Anti-affinity Group -func XDeleteAntiAffinityGroup(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-anti-affinity-group" +// XDeleteDeployment [BETA] Delete Deployment +func XDeleteDeployment(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-deployment" if xSubcommand { handlerPath = "x " + handlerPath } @@ -125,7 +125,7 @@ func XDeleteAntiAffinityGroup(paramId string, params *viper.Viper) (*gentleman.R server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/anti-affinity-group/{id}" + url := server + "/ai/deployment/{id}" url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Delete().URL(url) @@ -155,9 +155,9 @@ func XDeleteAntiAffinityGroup(paramId string, params *viper.Viper) (*gentleman.R return resp, decoded, nil } -// XGetAntiAffinityGroup Retrieve Anti-affinity Group details -func XGetAntiAffinityGroup(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-anti-affinity-group" +// XGetDeployment [BETA] Get Deployment +func XGetDeployment(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-deployment" if xSubcommand { handlerPath = "x " + handlerPath } @@ -167,7 +167,7 @@ func XGetAntiAffinityGroup(paramId string, params *viper.Viper) (*gentleman.Resp server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/anti-affinity-group/{id}" + url := server + "/ai/deployment/{id}" url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Get().URL(url) @@ -197,9 +197,9 @@ func XGetAntiAffinityGroup(paramId string, params *viper.Viper) (*gentleman.Resp return resp, decoded, nil } -// XCreateApiKey Create a new API key -func XCreateApiKey(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-api-key" +// XUpdateDeployment update-deployment +func XUpdateDeployment(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-deployment" if xSubcommand { handlerPath = "x " + handlerPath } @@ -209,9 +209,10 @@ func XCreateApiKey(params *viper.Viper, body string) (*gentleman.Response, map[s server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/api-key" + url := server + "/ai/deployment/{id}" + url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Post().URL(url) + req := cli.Client.Patch().URL(url) if body != "" { req = req.AddHeader("Content-Type", "application/json").BodyString(body) @@ -242,9 +243,9 @@ func XCreateApiKey(params *viper.Viper, body string) (*gentleman.Response, map[s return resp, decoded, nil } -// XListApiKeys List API keys -func XListApiKeys(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "list-api-keys" +// XRevealDeploymentApiKey [BETA] Reveal Deployment API Key +func XRevealDeploymentApiKey(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "reveal-deployment-api-key" if xSubcommand { handlerPath = "x " + handlerPath } @@ -254,7 +255,8 @@ func XListApiKeys(params *viper.Viper) (*gentleman.Response, map[string]interfac server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/api-key" + url := server + "/ai/deployment/{id}/api-key" + url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Get().URL(url) @@ -283,9 +285,9 @@ func XListApiKeys(params *viper.Viper) (*gentleman.Response, map[string]interfac return resp, decoded, nil } -// XDeleteApiKey Delete an API key -func XDeleteApiKey(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-api-key" +// XGetDeploymentLogs [BETA] Get Deployment Logs +func XGetDeploymentLogs(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-deployment-logs" if xSubcommand { handlerPath = "x " + handlerPath } @@ -295,10 +297,19 @@ func XDeleteApiKey(paramId string, params *viper.Viper) (*gentleman.Response, ma server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/api-key/{id}" + url := server + "/ai/deployment/{id}/logs" url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Delete().URL(url) + req := cli.Client.Get().URL(url) + + paramStream := params.GetBool("stream") + if paramStream != false { + req = req.AddQuery("stream", fmt.Sprintf("%v", paramStream)) + } + paramTail := params.GetInt64("tail") + if paramTail != 0 { + req = req.AddQuery("tail", fmt.Sprintf("%v", paramTail)) + } cli.HandleBefore(handlerPath, params, req) @@ -325,9 +336,9 @@ func XDeleteApiKey(paramId string, params *viper.Viper) (*gentleman.Response, ma return resp, decoded, nil } -// XGetApiKey Get API key -func XGetApiKey(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-api-key" +// XScaleDeployment [BETA] Scale Deployment +func XScaleDeployment(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "scale-deployment" if xSubcommand { handlerPath = "x " + handlerPath } @@ -337,10 +348,14 @@ func XGetApiKey(paramId string, params *viper.Viper) (*gentleman.Response, map[s server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/api-key/{id}" + url := server + "/ai/deployment/{id}/scale" url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Post().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -367,9 +382,9 @@ func XGetApiKey(paramId string, params *viper.Viper) (*gentleman.Response, map[s return resp, decoded, nil } -// XCreateBlockStorageVolume Create a block storage volume -func XCreateBlockStorageVolume(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-block-storage-volume" +// XGetInferenceEngineHelp [BETA] Get inference-engine Help +func XGetInferenceEngineHelp(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-inference-engine-help" if xSubcommand { handlerPath = "x " + handlerPath } @@ -379,12 +394,13 @@ func XCreateBlockStorageVolume(params *viper.Viper, body string) (*gentleman.Res server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/block-storage" + url := server + "/ai/help/inference-engine-parameters" - req := cli.Client.Post().URL(url) + req := cli.Client.Get().URL(url) - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) + paramVersion := params.GetString("version") + if paramVersion != "" { + req = req.AddQuery("version", fmt.Sprintf("%v", paramVersion)) } cli.HandleBefore(handlerPath, params, req) @@ -412,9 +428,9 @@ func XCreateBlockStorageVolume(params *viper.Viper, body string) (*gentleman.Res return resp, decoded, nil } -// XListBlockStorageVolumes List block storage volumes -func XListBlockStorageVolumes(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "list-block-storage-volumes" +// XListAiInstanceTypes List Instance Types +func XListAiInstanceTypes(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-ai-instance-types" if xSubcommand { handlerPath = "x " + handlerPath } @@ -424,15 +440,10 @@ func XListBlockStorageVolumes(params *viper.Viper) (*gentleman.Response, map[str server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/block-storage" + url := server + "/ai/instance-type" req := cli.Client.Get().URL(url) - paramInstanceId := params.GetString("instance-id") - if paramInstanceId != "" { - req = req.AddQuery("instance-id", fmt.Sprintf("%v", paramInstanceId)) - } - cli.HandleBefore(handlerPath, params, req) resp, err := req.Do() @@ -458,9 +469,9 @@ func XListBlockStorageVolumes(params *viper.Viper) (*gentleman.Response, map[str return resp, decoded, nil } -// XListBlockStorageSnapshots List block storage snapshots -func XListBlockStorageSnapshots(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "list-block-storage-snapshots" +// XCreateModel [BETA] Create Model +func XCreateModel(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-model" if xSubcommand { handlerPath = "x " + handlerPath } @@ -470,9 +481,13 @@ func XListBlockStorageSnapshots(params *viper.Viper) (*gentleman.Response, map[s server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/block-storage-snapshot" + url := server + "/ai/model" - req := cli.Client.Get().URL(url) + req := cli.Client.Post().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -499,9 +514,9 @@ func XListBlockStorageSnapshots(params *viper.Viper) (*gentleman.Response, map[s return resp, decoded, nil } -// XDeleteBlockStorageSnapshot Delete a block storage snapshot, data will be unrecoverable -func XDeleteBlockStorageSnapshot(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-block-storage-snapshot" +// XListModels [BETA] List Models +func XListModels(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-models" if xSubcommand { handlerPath = "x " + handlerPath } @@ -511,10 +526,9 @@ func XDeleteBlockStorageSnapshot(paramId string, params *viper.Viper) (*gentlema server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/block-storage-snapshot/{id}" - url = strings.Replace(url, "{id}", paramId, 1) + url := server + "/ai/model" - req := cli.Client.Delete().URL(url) + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -541,9 +555,9 @@ func XDeleteBlockStorageSnapshot(paramId string, params *viper.Viper) (*gentlema return resp, decoded, nil } -// XGetBlockStorageSnapshot Retrieve block storage snapshot details -func XGetBlockStorageSnapshot(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-block-storage-snapshot" +// XDeleteModel [BETA] Delete Model +func XDeleteModel(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-model" if xSubcommand { handlerPath = "x " + handlerPath } @@ -553,10 +567,10 @@ func XGetBlockStorageSnapshot(paramId string, params *viper.Viper) (*gentleman.R server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/block-storage-snapshot/{id}" + url := server + "/ai/model/{id}" url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -583,9 +597,9 @@ func XGetBlockStorageSnapshot(paramId string, params *viper.Viper) (*gentleman.R return resp, decoded, nil } -// XUpdateBlockStorageSnapshot Update block storage volume snapshot -func XUpdateBlockStorageSnapshot(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "update-block-storage-snapshot" +// XGetModel [BETA] Get Model +func XGetModel(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-model" if xSubcommand { handlerPath = "x " + handlerPath } @@ -595,14 +609,10 @@ func XUpdateBlockStorageSnapshot(paramId string, params *viper.Viper, body strin server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/block-storage-snapshot/{id}" + url := server + "/ai/model/{id}" url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Put().URL(url) - - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -629,9 +639,9 @@ func XUpdateBlockStorageSnapshot(paramId string, params *viper.Viper, body strin return resp, decoded, nil } -// XDeleteBlockStorageVolume Delete a block storage volume, data will be unrecoverable -func XDeleteBlockStorageVolume(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-block-storage-volume" +// XCreateAntiAffinityGroup Create an Anti-affinity Group +func XCreateAntiAffinityGroup(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-anti-affinity-group" if xSubcommand { handlerPath = "x " + handlerPath } @@ -641,10 +651,13 @@ func XDeleteBlockStorageVolume(paramId string, params *viper.Viper) (*gentleman. server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/block-storage/{id}" - url = strings.Replace(url, "{id}", paramId, 1) + url := server + "/anti-affinity-group" - req := cli.Client.Delete().URL(url) + req := cli.Client.Post().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -671,9 +684,9 @@ func XDeleteBlockStorageVolume(paramId string, params *viper.Viper) (*gentleman. return resp, decoded, nil } -// XGetBlockStorageVolume Retrieve block storage volume details -func XGetBlockStorageVolume(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-block-storage-volume" +// XListAntiAffinityGroups List Anti-affinity Groups +func XListAntiAffinityGroups(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-anti-affinity-groups" if xSubcommand { handlerPath = "x " + handlerPath } @@ -683,8 +696,7 @@ func XGetBlockStorageVolume(paramId string, params *viper.Viper) (*gentleman.Res server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/block-storage/{id}" - url = strings.Replace(url, "{id}", paramId, 1) + url := server + "/anti-affinity-group" req := cli.Client.Get().URL(url) @@ -713,9 +725,9 @@ func XGetBlockStorageVolume(paramId string, params *viper.Viper) (*gentleman.Res return resp, decoded, nil } -// XUpdateBlockStorageVolume Update block storage volume -func XUpdateBlockStorageVolume(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "update-block-storage-volume" +// XDeleteAntiAffinityGroup Delete an Anti-affinity Group +func XDeleteAntiAffinityGroup(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-anti-affinity-group" if xSubcommand { handlerPath = "x " + handlerPath } @@ -725,14 +737,10 @@ func XUpdateBlockStorageVolume(paramId string, params *viper.Viper, body string) server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/block-storage/{id}" + url := server + "/anti-affinity-group/{id}" url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Put().URL(url) - - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -759,9 +767,9 @@ func XUpdateBlockStorageVolume(paramId string, params *viper.Viper, body string) return resp, decoded, nil } -// XAttachBlockStorageVolumeToInstance Attach block storage volume to an instance -func XAttachBlockStorageVolumeToInstance(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "attach-block-storage-volume-to-instance" +// XGetAntiAffinityGroup Retrieve Anti-affinity Group details +func XGetAntiAffinityGroup(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-anti-affinity-group" if xSubcommand { handlerPath = "x " + handlerPath } @@ -771,14 +779,10 @@ func XAttachBlockStorageVolumeToInstance(paramId string, params *viper.Viper, bo server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/block-storage/{id}:attach" + url := server + "/anti-affinity-group/{id}" url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Put().URL(url) - - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -805,9 +809,9 @@ func XAttachBlockStorageVolumeToInstance(paramId string, params *viper.Viper, bo return resp, decoded, nil } -// XCreateBlockStorageSnapshot Create a block storage snapshot -func XCreateBlockStorageSnapshot(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-block-storage-snapshot" +// XCreateApiKey Create a new API key +func XCreateApiKey(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-api-key" if xSubcommand { handlerPath = "x " + handlerPath } @@ -817,8 +821,7 @@ func XCreateBlockStorageSnapshot(paramId string, params *viper.Viper, body strin server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/block-storage/{id}:create-snapshot" - url = strings.Replace(url, "{id}", paramId, 1) + url := server + "/api-key" req := cli.Client.Post().URL(url) @@ -851,9 +854,9 @@ func XCreateBlockStorageSnapshot(paramId string, params *viper.Viper, body strin return resp, decoded, nil } -// XDetachBlockStorageVolume Detach block storage volume -func XDetachBlockStorageVolume(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "detach-block-storage-volume" +// XListApiKeys List API keys +func XListApiKeys(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-api-keys" if xSubcommand { handlerPath = "x " + handlerPath } @@ -863,14 +866,9 @@ func XDetachBlockStorageVolume(paramId string, params *viper.Viper, body string) server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/block-storage/{id}:detach" - url = strings.Replace(url, "{id}", paramId, 1) - - req := cli.Client.Put().URL(url) + url := server + "/api-key" - if body != "" { - req = req.AddHeader("Content-Type", "").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -897,9 +895,9 @@ func XDetachBlockStorageVolume(paramId string, params *viper.Viper, body string) return resp, decoded, nil } -// XResizeBlockStorageVolume Resize a block storage volume -func XResizeBlockStorageVolume(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "resize-block-storage-volume" +// XDeleteApiKey Delete an API key +func XDeleteApiKey(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-api-key" if xSubcommand { handlerPath = "x " + handlerPath } @@ -909,14 +907,10 @@ func XResizeBlockStorageVolume(paramId string, params *viper.Viper, body string) server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/block-storage/{id}:resize-volume" + url := server + "/api-key/{id}" url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Put().URL(url) - - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -943,9 +937,9 @@ func XResizeBlockStorageVolume(paramId string, params *viper.Viper, body string) return resp, decoded, nil } -// XGetConsoleProxyUrl Retrieve signed url valid for 60 seconds to connect via console-proxy websocket to VM VNC console. -func XGetConsoleProxyUrl(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-console-proxy-url" +// XGetApiKey Get API key +func XGetApiKey(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-api-key" if xSubcommand { handlerPath = "x " + handlerPath } @@ -955,7 +949,7 @@ func XGetConsoleProxyUrl(paramId string, params *viper.Viper) (*gentleman.Respon server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/console/{id}" + url := server + "/api-key/{id}" url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Get().URL(url) @@ -985,9 +979,9 @@ func XGetConsoleProxyUrl(paramId string, params *viper.Viper) (*gentleman.Respon return resp, decoded, nil } -// XGetDbaasCaCertificate Get DBaaS CA Certificate -func XGetDbaasCaCertificate(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-dbaas-ca-certificate" +// XCreateBlockStorageVolume Create a block storage volume +func XCreateBlockStorageVolume(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-block-storage-volume" if xSubcommand { handlerPath = "x " + handlerPath } @@ -997,9 +991,13 @@ func XGetDbaasCaCertificate(params *viper.Viper) (*gentleman.Response, map[strin server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-ca-certificate" + url := server + "/block-storage" - req := cli.Client.Get().URL(url) + req := cli.Client.Post().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -1026,9 +1024,9 @@ func XGetDbaasCaCertificate(params *viper.Viper) (*gentleman.Response, map[strin return resp, decoded, nil } -// XDeleteDbaasExternalEndpointDatadog delete-dbaas-external-endpoint-datadog -func XDeleteDbaasExternalEndpointDatadog(paramEndpointId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-dbaas-external-endpoint-datadog" +// XListBlockStorageVolumes List block storage volumes +func XListBlockStorageVolumes(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-block-storage-volumes" if xSubcommand { handlerPath = "x " + handlerPath } @@ -1038,10 +1036,14 @@ func XDeleteDbaasExternalEndpointDatadog(paramEndpointId string, params *viper.V server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-external-endpoint-datadog/{endpoint-id}" - url = strings.Replace(url, "{endpoint-id}", paramEndpointId, 1) + url := server + "/block-storage" - req := cli.Client.Delete().URL(url) + req := cli.Client.Get().URL(url) + + paramInstanceId := params.GetString("instance-id") + if paramInstanceId != "" { + req = req.AddQuery("instance-id", fmt.Sprintf("%v", paramInstanceId)) + } cli.HandleBefore(handlerPath, params, req) @@ -1068,9 +1070,9 @@ func XDeleteDbaasExternalEndpointDatadog(paramEndpointId string, params *viper.V return resp, decoded, nil } -// XGetDbaasExternalEndpointDatadog get-dbaas-external-endpoint-datadog -func XGetDbaasExternalEndpointDatadog(paramEndpointId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-dbaas-external-endpoint-datadog" +// XListBlockStorageSnapshots List block storage snapshots +func XListBlockStorageSnapshots(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-block-storage-snapshots" if xSubcommand { handlerPath = "x " + handlerPath } @@ -1080,8 +1082,7 @@ func XGetDbaasExternalEndpointDatadog(paramEndpointId string, params *viper.Vipe server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-external-endpoint-datadog/{endpoint-id}" - url = strings.Replace(url, "{endpoint-id}", paramEndpointId, 1) + url := server + "/block-storage-snapshot" req := cli.Client.Get().URL(url) @@ -1110,9 +1111,9 @@ func XGetDbaasExternalEndpointDatadog(paramEndpointId string, params *viper.Vipe return resp, decoded, nil } -// XUpdateDbaasExternalEndpointDatadog update-dbaas-external-endpoint-datadog -func XUpdateDbaasExternalEndpointDatadog(paramEndpointId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "update-dbaas-external-endpoint-datadog" +// XDeleteBlockStorageSnapshot Delete a block storage snapshot, data will be unrecoverable +func XDeleteBlockStorageSnapshot(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-block-storage-snapshot" if xSubcommand { handlerPath = "x " + handlerPath } @@ -1122,14 +1123,10 @@ func XUpdateDbaasExternalEndpointDatadog(paramEndpointId string, params *viper.V server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-external-endpoint-datadog/{endpoint-id}" - url = strings.Replace(url, "{endpoint-id}", paramEndpointId, 1) - - req := cli.Client.Put().URL(url) + url := server + "/block-storage-snapshot/{id}" + url = strings.Replace(url, "{id}", paramId, 1) - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -1156,9 +1153,9 @@ func XUpdateDbaasExternalEndpointDatadog(paramEndpointId string, params *viper.V return resp, decoded, nil } -// XCreateDbaasExternalEndpointDatadog create-dbaas-external-endpoint-datadog -func XCreateDbaasExternalEndpointDatadog(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-dbaas-external-endpoint-datadog" +// XGetBlockStorageSnapshot Retrieve block storage snapshot details +func XGetBlockStorageSnapshot(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-block-storage-snapshot" if xSubcommand { handlerPath = "x " + handlerPath } @@ -1168,10 +1165,52 @@ func XCreateDbaasExternalEndpointDatadog(paramName string, params *viper.Viper, server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-external-endpoint-datadog/{name}" - url = strings.Replace(url, "{name}", paramName, 1) + url := server + "/block-storage-snapshot/{id}" + url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Post().URL(url) + req := cli.Client.Get().URL(url) + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XUpdateBlockStorageSnapshot Update block storage volume snapshot +func XUpdateBlockStorageSnapshot(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-block-storage-snapshot" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/block-storage-snapshot/{id}" + url = strings.Replace(url, "{id}", paramId, 1) + + req := cli.Client.Put().URL(url) if body != "" { req = req.AddHeader("Content-Type", "application/json").BodyString(body) @@ -1202,9 +1241,9 @@ func XCreateDbaasExternalEndpointDatadog(paramName string, params *viper.Viper, return resp, decoded, nil } -// XDeleteDbaasExternalEndpointElasticsearch delete-dbaas-external-endpoint-elasticsearch -func XDeleteDbaasExternalEndpointElasticsearch(paramEndpointId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-dbaas-external-endpoint-elasticsearch" +// XDeleteBlockStorageVolume Delete a block storage volume, data will be unrecoverable +func XDeleteBlockStorageVolume(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-block-storage-volume" if xSubcommand { handlerPath = "x " + handlerPath } @@ -1214,8 +1253,8 @@ func XDeleteDbaasExternalEndpointElasticsearch(paramEndpointId string, params *v server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-external-endpoint-elasticsearch/{endpoint-id}" - url = strings.Replace(url, "{endpoint-id}", paramEndpointId, 1) + url := server + "/block-storage/{id}" + url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Delete().URL(url) @@ -1244,9 +1283,9 @@ func XDeleteDbaasExternalEndpointElasticsearch(paramEndpointId string, params *v return resp, decoded, nil } -// XGetDbaasExternalEndpointElasticsearch get-dbaas-external-endpoint-elasticsearch -func XGetDbaasExternalEndpointElasticsearch(paramEndpointId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-dbaas-external-endpoint-elasticsearch" +// XGetBlockStorageVolume Retrieve block storage volume details +func XGetBlockStorageVolume(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-block-storage-volume" if xSubcommand { handlerPath = "x " + handlerPath } @@ -1256,8 +1295,8 @@ func XGetDbaasExternalEndpointElasticsearch(paramEndpointId string, params *vipe server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-external-endpoint-elasticsearch/{endpoint-id}" - url = strings.Replace(url, "{endpoint-id}", paramEndpointId, 1) + url := server + "/block-storage/{id}" + url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Get().URL(url) @@ -1286,9 +1325,9 @@ func XGetDbaasExternalEndpointElasticsearch(paramEndpointId string, params *vipe return resp, decoded, nil } -// XUpdateDbaasExternalEndpointElasticsearch update-dbaas-external-endpoint-elasticsearch -func XUpdateDbaasExternalEndpointElasticsearch(paramEndpointId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "update-dbaas-external-endpoint-elasticsearch" +// XUpdateBlockStorageVolume Update block storage volume +func XUpdateBlockStorageVolume(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-block-storage-volume" if xSubcommand { handlerPath = "x " + handlerPath } @@ -1298,8 +1337,8 @@ func XUpdateDbaasExternalEndpointElasticsearch(paramEndpointId string, params *v server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-external-endpoint-elasticsearch/{endpoint-id}" - url = strings.Replace(url, "{endpoint-id}", paramEndpointId, 1) + url := server + "/block-storage/{id}" + url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Put().URL(url) @@ -1332,9 +1371,9 @@ func XUpdateDbaasExternalEndpointElasticsearch(paramEndpointId string, params *v return resp, decoded, nil } -// XCreateDbaasExternalEndpointElasticsearch create-dbaas-external-endpoint-elasticsearch -func XCreateDbaasExternalEndpointElasticsearch(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-dbaas-external-endpoint-elasticsearch" +// XAttachBlockStorageVolumeToInstance Attach block storage volume to an instance +func XAttachBlockStorageVolumeToInstance(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "attach-block-storage-volume-to-instance" if xSubcommand { handlerPath = "x " + handlerPath } @@ -1344,10 +1383,10 @@ func XCreateDbaasExternalEndpointElasticsearch(paramName string, params *viper.V server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-external-endpoint-elasticsearch/{name}" - url = strings.Replace(url, "{name}", paramName, 1) + url := server + "/block-storage/{id}:attach" + url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Post().URL(url) + req := cli.Client.Put().URL(url) if body != "" { req = req.AddHeader("Content-Type", "application/json").BodyString(body) @@ -1378,9 +1417,9 @@ func XCreateDbaasExternalEndpointElasticsearch(paramName string, params *viper.V return resp, decoded, nil } -// XDeleteDbaasExternalEndpointOpensearch delete-dbaas-external-endpoint-opensearch -func XDeleteDbaasExternalEndpointOpensearch(paramEndpointId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-dbaas-external-endpoint-opensearch" +// XCreateBlockStorageSnapshot Create a block storage snapshot +func XCreateBlockStorageSnapshot(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-block-storage-snapshot" if xSubcommand { handlerPath = "x " + handlerPath } @@ -1390,10 +1429,14 @@ func XDeleteDbaasExternalEndpointOpensearch(paramEndpointId string, params *vipe server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-external-endpoint-opensearch/{endpoint-id}" - url = strings.Replace(url, "{endpoint-id}", paramEndpointId, 1) + url := server + "/block-storage/{id}:create-snapshot" + url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Delete().URL(url) + req := cli.Client.Post().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -1420,9 +1463,9 @@ func XDeleteDbaasExternalEndpointOpensearch(paramEndpointId string, params *vipe return resp, decoded, nil } -// XGetDbaasExternalEndpointOpensearch get-dbaas-external-endpoint-opensearch -func XGetDbaasExternalEndpointOpensearch(paramEndpointId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-dbaas-external-endpoint-opensearch" +// XDetachBlockStorageVolume Detach block storage volume +func XDetachBlockStorageVolume(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "detach-block-storage-volume" if xSubcommand { handlerPath = "x " + handlerPath } @@ -1432,10 +1475,14 @@ func XGetDbaasExternalEndpointOpensearch(paramEndpointId string, params *viper.V server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-external-endpoint-opensearch/{endpoint-id}" - url = strings.Replace(url, "{endpoint-id}", paramEndpointId, 1) + url := server + "/block-storage/{id}:detach" + url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Put().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -1462,9 +1509,9 @@ func XGetDbaasExternalEndpointOpensearch(paramEndpointId string, params *viper.V return resp, decoded, nil } -// XUpdateDbaasExternalEndpointOpensearch update-dbaas-external-endpoint-opensearch -func XUpdateDbaasExternalEndpointOpensearch(paramEndpointId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "update-dbaas-external-endpoint-opensearch" +// XResizeBlockStorageVolume Resize a block storage volume +func XResizeBlockStorageVolume(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "resize-block-storage-volume" if xSubcommand { handlerPath = "x " + handlerPath } @@ -1474,8 +1521,8 @@ func XUpdateDbaasExternalEndpointOpensearch(paramEndpointId string, params *vipe server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-external-endpoint-opensearch/{endpoint-id}" - url = strings.Replace(url, "{endpoint-id}", paramEndpointId, 1) + url := server + "/block-storage/{id}:resize-volume" + url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Put().URL(url) @@ -1508,9 +1555,9 @@ func XUpdateDbaasExternalEndpointOpensearch(paramEndpointId string, params *vipe return resp, decoded, nil } -// XCreateDbaasExternalEndpointOpensearch create-dbaas-external-endpoint-opensearch -func XCreateDbaasExternalEndpointOpensearch(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-dbaas-external-endpoint-opensearch" +// XGetConsoleProxyUrl Retrieve signed url valid for 60 seconds to connect via console-proxy websocket to VM VNC console. +func XGetConsoleProxyUrl(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-console-proxy-url" if xSubcommand { handlerPath = "x " + handlerPath } @@ -1520,15 +1567,52 @@ func XCreateDbaasExternalEndpointOpensearch(paramName string, params *viper.Vipe server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-external-endpoint-opensearch/{name}" - url = strings.Replace(url, "{name}", paramName, 1) + url := server + "/console/{id}" + url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Post().URL(url) + req := cli.Client.Get().URL(url) - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) } + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XGetDbaasCaCertificate Get DBaaS CA Certificate +func XGetDbaasCaCertificate(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dbaas-ca-certificate" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/dbaas-ca-certificate" + + req := cli.Client.Get().URL(url) + cli.HandleBefore(handlerPath, params, req) resp, err := req.Do() @@ -1554,9 +1638,9 @@ func XCreateDbaasExternalEndpointOpensearch(paramName string, params *viper.Vipe return resp, decoded, nil } -// XDeleteDbaasExternalEndpointPrometheus delete-dbaas-external-endpoint-prometheus -func XDeleteDbaasExternalEndpointPrometheus(paramEndpointId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-dbaas-external-endpoint-prometheus" +// XDeleteDbaasExternalEndpointDatadog delete-dbaas-external-endpoint-datadog +func XDeleteDbaasExternalEndpointDatadog(paramEndpointId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-dbaas-external-endpoint-datadog" if xSubcommand { handlerPath = "x " + handlerPath } @@ -1566,7 +1650,7 @@ func XDeleteDbaasExternalEndpointPrometheus(paramEndpointId string, params *vipe server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-external-endpoint-prometheus/{endpoint-id}" + url := server + "/dbaas-external-endpoint-datadog/{endpoint-id}" url = strings.Replace(url, "{endpoint-id}", paramEndpointId, 1) req := cli.Client.Delete().URL(url) @@ -1596,9 +1680,9 @@ func XDeleteDbaasExternalEndpointPrometheus(paramEndpointId string, params *vipe return resp, decoded, nil } -// XGetDbaasExternalEndpointPrometheus get-dbaas-external-endpoint-prometheus -func XGetDbaasExternalEndpointPrometheus(paramEndpointId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-dbaas-external-endpoint-prometheus" +// XGetDbaasExternalEndpointDatadog get-dbaas-external-endpoint-datadog +func XGetDbaasExternalEndpointDatadog(paramEndpointId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dbaas-external-endpoint-datadog" if xSubcommand { handlerPath = "x " + handlerPath } @@ -1608,7 +1692,7 @@ func XGetDbaasExternalEndpointPrometheus(paramEndpointId string, params *viper.V server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-external-endpoint-prometheus/{endpoint-id}" + url := server + "/dbaas-external-endpoint-datadog/{endpoint-id}" url = strings.Replace(url, "{endpoint-id}", paramEndpointId, 1) req := cli.Client.Get().URL(url) @@ -1638,9 +1722,9 @@ func XGetDbaasExternalEndpointPrometheus(paramEndpointId string, params *viper.V return resp, decoded, nil } -// XUpdateDbaasExternalEndpointPrometheus update-dbaas-external-endpoint-prometheus -func XUpdateDbaasExternalEndpointPrometheus(paramEndpointId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "update-dbaas-external-endpoint-prometheus" +// XUpdateDbaasExternalEndpointDatadog update-dbaas-external-endpoint-datadog +func XUpdateDbaasExternalEndpointDatadog(paramEndpointId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-dbaas-external-endpoint-datadog" if xSubcommand { handlerPath = "x " + handlerPath } @@ -1650,7 +1734,7 @@ func XUpdateDbaasExternalEndpointPrometheus(paramEndpointId string, params *vipe server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-external-endpoint-prometheus/{endpoint-id}" + url := server + "/dbaas-external-endpoint-datadog/{endpoint-id}" url = strings.Replace(url, "{endpoint-id}", paramEndpointId, 1) req := cli.Client.Put().URL(url) @@ -1684,9 +1768,9 @@ func XUpdateDbaasExternalEndpointPrometheus(paramEndpointId string, params *vipe return resp, decoded, nil } -// XCreateDbaasExternalEndpointPrometheus create-dbaas-external-endpoint-prometheus -func XCreateDbaasExternalEndpointPrometheus(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-dbaas-external-endpoint-prometheus" +// XCreateDbaasExternalEndpointDatadog create-dbaas-external-endpoint-datadog +func XCreateDbaasExternalEndpointDatadog(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-dbaas-external-endpoint-datadog" if xSubcommand { handlerPath = "x " + handlerPath } @@ -1696,7 +1780,7 @@ func XCreateDbaasExternalEndpointPrometheus(paramName string, params *viper.Vipe server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-external-endpoint-prometheus/{name}" + url := server + "/dbaas-external-endpoint-datadog/{name}" url = strings.Replace(url, "{name}", paramName, 1) req := cli.Client.Post().URL(url) @@ -1730,9 +1814,9 @@ func XCreateDbaasExternalEndpointPrometheus(paramName string, params *viper.Vipe return resp, decoded, nil } -// XDeleteDbaasExternalEndpointRsyslog delete-dbaas-external-endpoint-rsyslog -func XDeleteDbaasExternalEndpointRsyslog(paramEndpointId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-dbaas-external-endpoint-rsyslog" +// XDeleteDbaasExternalEndpointElasticsearch delete-dbaas-external-endpoint-elasticsearch +func XDeleteDbaasExternalEndpointElasticsearch(paramEndpointId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-dbaas-external-endpoint-elasticsearch" if xSubcommand { handlerPath = "x " + handlerPath } @@ -1742,7 +1826,7 @@ func XDeleteDbaasExternalEndpointRsyslog(paramEndpointId string, params *viper.V server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-external-endpoint-rsyslog/{endpoint-id}" + url := server + "/dbaas-external-endpoint-elasticsearch/{endpoint-id}" url = strings.Replace(url, "{endpoint-id}", paramEndpointId, 1) req := cli.Client.Delete().URL(url) @@ -1772,9 +1856,9 @@ func XDeleteDbaasExternalEndpointRsyslog(paramEndpointId string, params *viper.V return resp, decoded, nil } -// XGetDbaasExternalEndpointRsyslog get-dbaas-external-endpoint-rsyslog -func XGetDbaasExternalEndpointRsyslog(paramEndpointId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-dbaas-external-endpoint-rsyslog" +// XGetDbaasExternalEndpointElasticsearch get-dbaas-external-endpoint-elasticsearch +func XGetDbaasExternalEndpointElasticsearch(paramEndpointId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dbaas-external-endpoint-elasticsearch" if xSubcommand { handlerPath = "x " + handlerPath } @@ -1784,7 +1868,7 @@ func XGetDbaasExternalEndpointRsyslog(paramEndpointId string, params *viper.Vipe server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-external-endpoint-rsyslog/{endpoint-id}" + url := server + "/dbaas-external-endpoint-elasticsearch/{endpoint-id}" url = strings.Replace(url, "{endpoint-id}", paramEndpointId, 1) req := cli.Client.Get().URL(url) @@ -1814,9 +1898,9 @@ func XGetDbaasExternalEndpointRsyslog(paramEndpointId string, params *viper.Vipe return resp, decoded, nil } -// XUpdateDbaasExternalEndpointRsyslog update-dbaas-external-endpoint-rsyslog -func XUpdateDbaasExternalEndpointRsyslog(paramEndpointId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "update-dbaas-external-endpoint-rsyslog" +// XUpdateDbaasExternalEndpointElasticsearch update-dbaas-external-endpoint-elasticsearch +func XUpdateDbaasExternalEndpointElasticsearch(paramEndpointId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-dbaas-external-endpoint-elasticsearch" if xSubcommand { handlerPath = "x " + handlerPath } @@ -1826,7 +1910,7 @@ func XUpdateDbaasExternalEndpointRsyslog(paramEndpointId string, params *viper.V server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-external-endpoint-rsyslog/{endpoint-id}" + url := server + "/dbaas-external-endpoint-elasticsearch/{endpoint-id}" url = strings.Replace(url, "{endpoint-id}", paramEndpointId, 1) req := cli.Client.Put().URL(url) @@ -1860,9 +1944,9 @@ func XUpdateDbaasExternalEndpointRsyslog(paramEndpointId string, params *viper.V return resp, decoded, nil } -// XCreateDbaasExternalEndpointRsyslog create-dbaas-external-endpoint-rsyslog -func XCreateDbaasExternalEndpointRsyslog(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-dbaas-external-endpoint-rsyslog" +// XCreateDbaasExternalEndpointElasticsearch create-dbaas-external-endpoint-elasticsearch +func XCreateDbaasExternalEndpointElasticsearch(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-dbaas-external-endpoint-elasticsearch" if xSubcommand { handlerPath = "x " + handlerPath } @@ -1872,7 +1956,7 @@ func XCreateDbaasExternalEndpointRsyslog(paramName string, params *viper.Viper, server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-external-endpoint-rsyslog/{name}" + url := server + "/dbaas-external-endpoint-elasticsearch/{name}" url = strings.Replace(url, "{name}", paramName, 1) req := cli.Client.Post().URL(url) @@ -1906,9 +1990,9 @@ func XCreateDbaasExternalEndpointRsyslog(paramName string, params *viper.Viper, return resp, decoded, nil } -// XListDbaasExternalEndpointTypes list-dbaas-external-endpoint-types -func XListDbaasExternalEndpointTypes(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "list-dbaas-external-endpoint-types" +// XDeleteDbaasExternalEndpointOpensearch delete-dbaas-external-endpoint-opensearch +func XDeleteDbaasExternalEndpointOpensearch(paramEndpointId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-dbaas-external-endpoint-opensearch" if xSubcommand { handlerPath = "x " + handlerPath } @@ -1918,9 +2002,10 @@ func XListDbaasExternalEndpointTypes(params *viper.Viper) (*gentleman.Response, server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-external-endpoint-types" - - req := cli.Client.Get().URL(url) + url := server + "/dbaas-external-endpoint-opensearch/{endpoint-id}" + url = strings.Replace(url, "{endpoint-id}", paramEndpointId, 1) + + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -1947,9 +2032,9 @@ func XListDbaasExternalEndpointTypes(params *viper.Viper) (*gentleman.Response, return resp, decoded, nil } -// XAttachDbaasServiceToEndpoint attach-dbaas-service-to-endpoint -func XAttachDbaasServiceToEndpoint(paramSourceServiceName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "attach-dbaas-service-to-endpoint" +// XGetDbaasExternalEndpointOpensearch get-dbaas-external-endpoint-opensearch +func XGetDbaasExternalEndpointOpensearch(paramEndpointId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dbaas-external-endpoint-opensearch" if xSubcommand { handlerPath = "x " + handlerPath } @@ -1959,14 +2044,10 @@ func XAttachDbaasServiceToEndpoint(paramSourceServiceName string, params *viper. server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-external-endpoint/{source-service-name}/attach" - url = strings.Replace(url, "{source-service-name}", paramSourceServiceName, 1) - - req := cli.Client.Put().URL(url) + url := server + "/dbaas-external-endpoint-opensearch/{endpoint-id}" + url = strings.Replace(url, "{endpoint-id}", paramEndpointId, 1) - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -1993,9 +2074,9 @@ func XAttachDbaasServiceToEndpoint(paramSourceServiceName string, params *viper. return resp, decoded, nil } -// XDetachDbaasServiceFromEndpoint detach-dbaas-service-from-endpoint -func XDetachDbaasServiceFromEndpoint(paramSourceServiceName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "detach-dbaas-service-from-endpoint" +// XUpdateDbaasExternalEndpointOpensearch update-dbaas-external-endpoint-opensearch +func XUpdateDbaasExternalEndpointOpensearch(paramEndpointId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-dbaas-external-endpoint-opensearch" if xSubcommand { handlerPath = "x " + handlerPath } @@ -2005,8 +2086,8 @@ func XDetachDbaasServiceFromEndpoint(paramSourceServiceName string, params *vipe server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-external-endpoint/{source-service-name}/detach" - url = strings.Replace(url, "{source-service-name}", paramSourceServiceName, 1) + url := server + "/dbaas-external-endpoint-opensearch/{endpoint-id}" + url = strings.Replace(url, "{endpoint-id}", paramEndpointId, 1) req := cli.Client.Put().URL(url) @@ -2039,9 +2120,9 @@ func XDetachDbaasServiceFromEndpoint(paramSourceServiceName string, params *vipe return resp, decoded, nil } -// XListDbaasExternalEndpoints list-dbaas-external-endpoints -func XListDbaasExternalEndpoints(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "list-dbaas-external-endpoints" +// XCreateDbaasExternalEndpointOpensearch create-dbaas-external-endpoint-opensearch +func XCreateDbaasExternalEndpointOpensearch(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-dbaas-external-endpoint-opensearch" if xSubcommand { handlerPath = "x " + handlerPath } @@ -2051,9 +2132,14 @@ func XListDbaasExternalEndpoints(params *viper.Viper) (*gentleman.Response, map[ server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-external-endpoints" + url := server + "/dbaas-external-endpoint-opensearch/{name}" + url = strings.Replace(url, "{name}", paramName, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Post().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -2080,9 +2166,9 @@ func XListDbaasExternalEndpoints(params *viper.Viper) (*gentleman.Response, map[ return resp, decoded, nil } -// XGetDbaasExternalIntegrationSettingsDatadog get-dbaas-external-integration-settings-datadog -func XGetDbaasExternalIntegrationSettingsDatadog(paramIntegrationId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-dbaas-external-integration-settings-datadog" +// XDeleteDbaasExternalEndpointPrometheus delete-dbaas-external-endpoint-prometheus +func XDeleteDbaasExternalEndpointPrometheus(paramEndpointId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-dbaas-external-endpoint-prometheus" if xSubcommand { handlerPath = "x " + handlerPath } @@ -2092,10 +2178,10 @@ func XGetDbaasExternalIntegrationSettingsDatadog(paramIntegrationId string, para server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-external-integration-settings-datadog/{integration-id}" - url = strings.Replace(url, "{integration-id}", paramIntegrationId, 1) + url := server + "/dbaas-external-endpoint-prometheus/{endpoint-id}" + url = strings.Replace(url, "{endpoint-id}", paramEndpointId, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -2122,9 +2208,9 @@ func XGetDbaasExternalIntegrationSettingsDatadog(paramIntegrationId string, para return resp, decoded, nil } -// XUpdateDbaasExternalIntegrationSettingsDatadog update-dbaas-external-integration-settings-datadog -func XUpdateDbaasExternalIntegrationSettingsDatadog(paramIntegrationId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "update-dbaas-external-integration-settings-datadog" +// XGetDbaasExternalEndpointPrometheus get-dbaas-external-endpoint-prometheus +func XGetDbaasExternalEndpointPrometheus(paramEndpointId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dbaas-external-endpoint-prometheus" if xSubcommand { handlerPath = "x " + handlerPath } @@ -2134,14 +2220,10 @@ func XUpdateDbaasExternalIntegrationSettingsDatadog(paramIntegrationId string, p server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-external-integration-settings-datadog/{integration-id}" - url = strings.Replace(url, "{integration-id}", paramIntegrationId, 1) - - req := cli.Client.Post().URL(url) + url := server + "/dbaas-external-endpoint-prometheus/{endpoint-id}" + url = strings.Replace(url, "{endpoint-id}", paramEndpointId, 1) - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -2168,9 +2250,9 @@ func XUpdateDbaasExternalIntegrationSettingsDatadog(paramIntegrationId string, p return resp, decoded, nil } -// XGetDbaasExternalIntegration get-dbaas-external-integration -func XGetDbaasExternalIntegration(paramIntegrationId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-dbaas-external-integration" +// XUpdateDbaasExternalEndpointPrometheus update-dbaas-external-endpoint-prometheus +func XUpdateDbaasExternalEndpointPrometheus(paramEndpointId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-dbaas-external-endpoint-prometheus" if xSubcommand { handlerPath = "x " + handlerPath } @@ -2180,10 +2262,14 @@ func XGetDbaasExternalIntegration(paramIntegrationId string, params *viper.Viper server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-external-integration/{integration-id}" - url = strings.Replace(url, "{integration-id}", paramIntegrationId, 1) + url := server + "/dbaas-external-endpoint-prometheus/{endpoint-id}" + url = strings.Replace(url, "{endpoint-id}", paramEndpointId, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Put().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -2210,9 +2296,9 @@ func XGetDbaasExternalIntegration(paramIntegrationId string, params *viper.Viper return resp, decoded, nil } -// XListDbaasExternalIntegrations list-dbaas-external-integrations -func XListDbaasExternalIntegrations(paramServiceName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "list-dbaas-external-integrations" +// XCreateDbaasExternalEndpointPrometheus create-dbaas-external-endpoint-prometheus +func XCreateDbaasExternalEndpointPrometheus(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-dbaas-external-endpoint-prometheus" if xSubcommand { handlerPath = "x " + handlerPath } @@ -2222,10 +2308,14 @@ func XListDbaasExternalIntegrations(paramServiceName string, params *viper.Viper server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-external-integrations/{service-name}" - url = strings.Replace(url, "{service-name}", paramServiceName, 1) + url := server + "/dbaas-external-endpoint-prometheus/{name}" + url = strings.Replace(url, "{name}", paramName, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Post().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -2252,9 +2342,9 @@ func XListDbaasExternalIntegrations(paramServiceName string, params *viper.Viper return resp, decoded, nil } -// XCreateDbaasServiceGrafana create-dbaas-service-grafana -func XCreateDbaasServiceGrafana(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-dbaas-service-grafana" +// XDeleteDbaasExternalEndpointRsyslog delete-dbaas-external-endpoint-rsyslog +func XDeleteDbaasExternalEndpointRsyslog(paramEndpointId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-dbaas-external-endpoint-rsyslog" if xSubcommand { handlerPath = "x " + handlerPath } @@ -2264,14 +2354,10 @@ func XCreateDbaasServiceGrafana(paramName string, params *viper.Viper, body stri server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-grafana/{name}" - url = strings.Replace(url, "{name}", paramName, 1) - - req := cli.Client.Post().URL(url) + url := server + "/dbaas-external-endpoint-rsyslog/{endpoint-id}" + url = strings.Replace(url, "{endpoint-id}", paramEndpointId, 1) - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -2298,9 +2384,9 @@ func XCreateDbaasServiceGrafana(paramName string, params *viper.Viper, body stri return resp, decoded, nil } -// XDeleteDbaasServiceGrafana Delete a Grafana service -func XDeleteDbaasServiceGrafana(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-dbaas-service-grafana" +// XGetDbaasExternalEndpointRsyslog get-dbaas-external-endpoint-rsyslog +func XGetDbaasExternalEndpointRsyslog(paramEndpointId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dbaas-external-endpoint-rsyslog" if xSubcommand { handlerPath = "x " + handlerPath } @@ -2310,10 +2396,10 @@ func XDeleteDbaasServiceGrafana(paramName string, params *viper.Viper) (*gentlem server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-grafana/{name}" - url = strings.Replace(url, "{name}", paramName, 1) + url := server + "/dbaas-external-endpoint-rsyslog/{endpoint-id}" + url = strings.Replace(url, "{endpoint-id}", paramEndpointId, 1) - req := cli.Client.Delete().URL(url) + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -2340,9 +2426,9 @@ func XDeleteDbaasServiceGrafana(paramName string, params *viper.Viper) (*gentlem return resp, decoded, nil } -// XGetDbaasServiceGrafana Get a DBaaS Grafana service -func XGetDbaasServiceGrafana(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-dbaas-service-grafana" +// XUpdateDbaasExternalEndpointRsyslog update-dbaas-external-endpoint-rsyslog +func XUpdateDbaasExternalEndpointRsyslog(paramEndpointId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-dbaas-external-endpoint-rsyslog" if xSubcommand { handlerPath = "x " + handlerPath } @@ -2352,10 +2438,14 @@ func XGetDbaasServiceGrafana(paramName string, params *viper.Viper) (*gentleman. server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-grafana/{name}" - url = strings.Replace(url, "{name}", paramName, 1) + url := server + "/dbaas-external-endpoint-rsyslog/{endpoint-id}" + url = strings.Replace(url, "{endpoint-id}", paramEndpointId, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Put().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -2382,9 +2472,9 @@ func XGetDbaasServiceGrafana(paramName string, params *viper.Viper) (*gentleman. return resp, decoded, nil } -// XUpdateDbaasServiceGrafana Update a DBaaS Grafana service -func XUpdateDbaasServiceGrafana(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "update-dbaas-service-grafana" +// XCreateDbaasExternalEndpointRsyslog create-dbaas-external-endpoint-rsyslog +func XCreateDbaasExternalEndpointRsyslog(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-dbaas-external-endpoint-rsyslog" if xSubcommand { handlerPath = "x " + handlerPath } @@ -2394,10 +2484,10 @@ func XUpdateDbaasServiceGrafana(paramName string, params *viper.Viper, body stri server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-grafana/{name}" + url := server + "/dbaas-external-endpoint-rsyslog/{name}" url = strings.Replace(url, "{name}", paramName, 1) - req := cli.Client.Put().URL(url) + req := cli.Client.Post().URL(url) if body != "" { req = req.AddHeader("Content-Type", "application/json").BodyString(body) @@ -2428,9 +2518,9 @@ func XUpdateDbaasServiceGrafana(paramName string, params *viper.Viper, body stri return resp, decoded, nil } -// XStartDbaasGrafanaMaintenance Initiate Grafana maintenance update -func XStartDbaasGrafanaMaintenance(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "start-dbaas-grafana-maintenance" +// XListDbaasExternalEndpointTypes list-dbaas-external-endpoint-types +func XListDbaasExternalEndpointTypes(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-dbaas-external-endpoint-types" if xSubcommand { handlerPath = "x " + handlerPath } @@ -2440,14 +2530,9 @@ func XStartDbaasGrafanaMaintenance(paramName string, params *viper.Viper, body s server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-grafana/{name}/maintenance/start" - url = strings.Replace(url, "{name}", paramName, 1) - - req := cli.Client.Put().URL(url) + url := server + "/dbaas-external-endpoint-types" - if body != "" { - req = req.AddHeader("Content-Type", "").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -2474,9 +2559,9 @@ func XStartDbaasGrafanaMaintenance(paramName string, params *viper.Viper, body s return resp, decoded, nil } -// XResetDbaasGrafanaUserPassword Reset the credentials of a DBaaS Grafana user -func XResetDbaasGrafanaUserPassword(paramServiceName string, paramUsername string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "reset-dbaas-grafana-user-password" +// XAttachDbaasServiceToEndpoint attach-dbaas-service-to-endpoint +func XAttachDbaasServiceToEndpoint(paramSourceServiceName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "attach-dbaas-service-to-endpoint" if xSubcommand { handlerPath = "x " + handlerPath } @@ -2486,9 +2571,8 @@ func XResetDbaasGrafanaUserPassword(paramServiceName string, paramUsername strin server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-grafana/{service-name}/user/{username}/password/reset" - url = strings.Replace(url, "{service-name}", paramServiceName, 1) - url = strings.Replace(url, "{username}", paramUsername, 1) + url := server + "/dbaas-external-endpoint/{source-service-name}/attach" + url = strings.Replace(url, "{source-service-name}", paramSourceServiceName, 1) req := cli.Client.Put().URL(url) @@ -2521,9 +2605,9 @@ func XResetDbaasGrafanaUserPassword(paramServiceName string, paramUsername strin return resp, decoded, nil } -// XRevealDbaasGrafanaUserPassword Reveal the secrets of a DBaaS Grafana user -func XRevealDbaasGrafanaUserPassword(paramServiceName string, paramUsername string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "reveal-dbaas-grafana-user-password" +// XDetachDbaasServiceFromEndpoint detach-dbaas-service-from-endpoint +func XDetachDbaasServiceFromEndpoint(paramSourceServiceName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "detach-dbaas-service-from-endpoint" if xSubcommand { handlerPath = "x " + handlerPath } @@ -2533,11 +2617,14 @@ func XRevealDbaasGrafanaUserPassword(paramServiceName string, paramUsername stri server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-grafana/{service-name}/user/{username}/password/reveal" - url = strings.Replace(url, "{service-name}", paramServiceName, 1) - url = strings.Replace(url, "{username}", paramUsername, 1) + url := server + "/dbaas-external-endpoint/{source-service-name}/detach" + url = strings.Replace(url, "{source-service-name}", paramSourceServiceName, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Put().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -2564,9 +2651,9 @@ func XRevealDbaasGrafanaUserPassword(paramServiceName string, paramUsername stri return resp, decoded, nil } -// XCreateDbaasIntegration create-dbaas-integration -func XCreateDbaasIntegration(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-dbaas-integration" +// XListDbaasExternalEndpoints list-dbaas-external-endpoints +func XListDbaasExternalEndpoints(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-dbaas-external-endpoints" if xSubcommand { handlerPath = "x " + handlerPath } @@ -2576,13 +2663,9 @@ func XCreateDbaasIntegration(params *viper.Viper, body string) (*gentleman.Respo server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-integration" - - req := cli.Client.Post().URL(url) + url := server + "/dbaas-external-endpoints" - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -2609,9 +2692,9 @@ func XCreateDbaasIntegration(params *viper.Viper, body string) (*gentleman.Respo return resp, decoded, nil } -// XListDbaasIntegrationSettings list-dbaas-integration-settings -func XListDbaasIntegrationSettings(paramIntegrationType string, paramSourceType string, paramDestType string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "list-dbaas-integration-settings" +// XGetDbaasExternalIntegrationSettingsDatadog get-dbaas-external-integration-settings-datadog +func XGetDbaasExternalIntegrationSettingsDatadog(paramIntegrationId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dbaas-external-integration-settings-datadog" if xSubcommand { handlerPath = "x " + handlerPath } @@ -2621,10 +2704,8 @@ func XListDbaasIntegrationSettings(paramIntegrationType string, paramSourceType server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-integration-settings/{integration-type}/{source-type}/{dest-type}" - url = strings.Replace(url, "{integration-type}", paramIntegrationType, 1) - url = strings.Replace(url, "{source-type}", paramSourceType, 1) - url = strings.Replace(url, "{dest-type}", paramDestType, 1) + url := server + "/dbaas-external-integration-settings-datadog/{integration-id}" + url = strings.Replace(url, "{integration-id}", paramIntegrationId, 1) req := cli.Client.Get().URL(url) @@ -2653,9 +2734,9 @@ func XListDbaasIntegrationSettings(paramIntegrationType string, paramSourceType return resp, decoded, nil } -// XListDbaasIntegrationTypes list-dbaas-integration-types -func XListDbaasIntegrationTypes(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "list-dbaas-integration-types" +// XUpdateDbaasExternalIntegrationSettingsDatadog update-dbaas-external-integration-settings-datadog +func XUpdateDbaasExternalIntegrationSettingsDatadog(paramIntegrationId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-dbaas-external-integration-settings-datadog" if xSubcommand { handlerPath = "x " + handlerPath } @@ -2665,9 +2746,14 @@ func XListDbaasIntegrationTypes(params *viper.Viper) (*gentleman.Response, map[s server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-integration-types" + url := server + "/dbaas-external-integration-settings-datadog/{integration-id}" + url = strings.Replace(url, "{integration-id}", paramIntegrationId, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Post().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -2694,9 +2780,9 @@ func XListDbaasIntegrationTypes(params *viper.Viper) (*gentleman.Response, map[s return resp, decoded, nil } -// XDeleteDbaasIntegration delete-dbaas-integration -func XDeleteDbaasIntegration(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-dbaas-integration" +// XGetDbaasExternalIntegration get-dbaas-external-integration +func XGetDbaasExternalIntegration(paramIntegrationId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dbaas-external-integration" if xSubcommand { handlerPath = "x " + handlerPath } @@ -2706,10 +2792,10 @@ func XDeleteDbaasIntegration(paramId string, params *viper.Viper) (*gentleman.Re server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-integration/{id}" - url = strings.Replace(url, "{id}", paramId, 1) + url := server + "/dbaas-external-integration/{integration-id}" + url = strings.Replace(url, "{integration-id}", paramIntegrationId, 1) - req := cli.Client.Delete().URL(url) + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -2736,9 +2822,9 @@ func XDeleteDbaasIntegration(paramId string, params *viper.Viper) (*gentleman.Re return resp, decoded, nil } -// XGetDbaasIntegration get-dbaas-integration -func XGetDbaasIntegration(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-dbaas-integration" +// XListDbaasExternalIntegrations list-dbaas-external-integrations +func XListDbaasExternalIntegrations(paramServiceName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-dbaas-external-integrations" if xSubcommand { handlerPath = "x " + handlerPath } @@ -2748,8 +2834,8 @@ func XGetDbaasIntegration(paramId string, params *viper.Viper) (*gentleman.Respo server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-integration/{id}" - url = strings.Replace(url, "{id}", paramId, 1) + url := server + "/dbaas-external-integrations/{service-name}" + url = strings.Replace(url, "{service-name}", paramServiceName, 1) req := cli.Client.Get().URL(url) @@ -2778,9 +2864,9 @@ func XGetDbaasIntegration(paramId string, params *viper.Viper) (*gentleman.Respo return resp, decoded, nil } -// XUpdateDbaasIntegration update-dbaas-integration -func XUpdateDbaasIntegration(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "update-dbaas-integration" +// XCreateDbaasServiceGrafana create-dbaas-service-grafana +func XCreateDbaasServiceGrafana(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-dbaas-service-grafana" if xSubcommand { handlerPath = "x " + handlerPath } @@ -2790,10 +2876,10 @@ func XUpdateDbaasIntegration(paramId string, params *viper.Viper, body string) ( server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-integration/{id}" - url = strings.Replace(url, "{id}", paramId, 1) + url := server + "/dbaas-grafana/{name}" + url = strings.Replace(url, "{name}", paramName, 1) - req := cli.Client.Put().URL(url) + req := cli.Client.Post().URL(url) if body != "" { req = req.AddHeader("Content-Type", "application/json").BodyString(body) @@ -2824,9 +2910,9 @@ func XUpdateDbaasIntegration(paramId string, params *viper.Viper, body string) ( return resp, decoded, nil } -// XCreateDbaasServiceKafka Create a DBaaS Kafka service -func XCreateDbaasServiceKafka(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-dbaas-service-kafka" +// XDeleteDbaasServiceGrafana Delete a Grafana service +func XDeleteDbaasServiceGrafana(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-dbaas-service-grafana" if xSubcommand { handlerPath = "x " + handlerPath } @@ -2836,14 +2922,10 @@ func XCreateDbaasServiceKafka(paramName string, params *viper.Viper, body string server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-kafka/{name}" + url := server + "/dbaas-grafana/{name}" url = strings.Replace(url, "{name}", paramName, 1) - req := cli.Client.Post().URL(url) - - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -2870,9 +2952,9 @@ func XCreateDbaasServiceKafka(paramName string, params *viper.Viper, body string return resp, decoded, nil } -// XDeleteDbaasServiceKafka Delete a Kafka service -func XDeleteDbaasServiceKafka(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-dbaas-service-kafka" +// XGetDbaasServiceGrafana Get a DBaaS Grafana service +func XGetDbaasServiceGrafana(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dbaas-service-grafana" if xSubcommand { handlerPath = "x " + handlerPath } @@ -2882,10 +2964,10 @@ func XDeleteDbaasServiceKafka(paramName string, params *viper.Viper) (*gentleman server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-kafka/{name}" + url := server + "/dbaas-grafana/{name}" url = strings.Replace(url, "{name}", paramName, 1) - req := cli.Client.Delete().URL(url) + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -2912,9 +2994,9 @@ func XDeleteDbaasServiceKafka(paramName string, params *viper.Viper) (*gentleman return resp, decoded, nil } -// XGetDbaasServiceKafka Get a DBaaS Kafka service -func XGetDbaasServiceKafka(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-dbaas-service-kafka" +// XUpdateDbaasServiceGrafana Update a DBaaS Grafana service +func XUpdateDbaasServiceGrafana(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-dbaas-service-grafana" if xSubcommand { handlerPath = "x " + handlerPath } @@ -2924,10 +3006,14 @@ func XGetDbaasServiceKafka(paramName string, params *viper.Viper) (*gentleman.Re server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-kafka/{name}" + url := server + "/dbaas-grafana/{name}" url = strings.Replace(url, "{name}", paramName, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Put().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -2954,9 +3040,9 @@ func XGetDbaasServiceKafka(paramName string, params *viper.Viper) (*gentleman.Re return resp, decoded, nil } -// XUpdateDbaasServiceKafka Update a DBaaS Kafka service -func XUpdateDbaasServiceKafka(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "update-dbaas-service-kafka" +// XStartDbaasGrafanaMaintenance Initiate Grafana maintenance update +func XStartDbaasGrafanaMaintenance(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "start-dbaas-grafana-maintenance" if xSubcommand { handlerPath = "x " + handlerPath } @@ -2966,13 +3052,13 @@ func XUpdateDbaasServiceKafka(paramName string, params *viper.Viper, body string server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-kafka/{name}" + url := server + "/dbaas-grafana/{name}/maintenance/start" url = strings.Replace(url, "{name}", paramName, 1) req := cli.Client.Put().URL(url) if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) + req = req.AddHeader("Content-Type", "").BodyString(body) } cli.HandleBefore(handlerPath, params, req) @@ -3000,9 +3086,9 @@ func XUpdateDbaasServiceKafka(paramName string, params *viper.Viper, body string return resp, decoded, nil } -// XGetDbaasKafkaAclConfig Get DBaaS kafka ACL configuration -func XGetDbaasKafkaAclConfig(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-dbaas-kafka-acl-config" +// XResetDbaasGrafanaUserPassword Reset the credentials of a DBaaS Grafana user +func XResetDbaasGrafanaUserPassword(paramServiceName string, paramUsername string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "reset-dbaas-grafana-user-password" if xSubcommand { handlerPath = "x " + handlerPath } @@ -3012,10 +3098,15 @@ func XGetDbaasKafkaAclConfig(paramName string, params *viper.Viper) (*gentleman. server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-kafka/{name}/acl-config" - url = strings.Replace(url, "{name}", paramName, 1) + url := server + "/dbaas-grafana/{service-name}/user/{username}/password/reset" + url = strings.Replace(url, "{service-name}", paramServiceName, 1) + url = strings.Replace(url, "{username}", paramUsername, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Put().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -3042,9 +3133,9 @@ func XGetDbaasKafkaAclConfig(paramName string, params *viper.Viper) (*gentleman. return resp, decoded, nil } -// XStartDbaasKafkaMaintenance Initiate Kafka maintenance update -func XStartDbaasKafkaMaintenance(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "start-dbaas-kafka-maintenance" +// XRevealDbaasGrafanaUserPassword Reveal the secrets of a DBaaS Grafana user +func XRevealDbaasGrafanaUserPassword(paramServiceName string, paramUsername string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "reveal-dbaas-grafana-user-password" if xSubcommand { handlerPath = "x " + handlerPath } @@ -3054,14 +3145,11 @@ func XStartDbaasKafkaMaintenance(paramName string, params *viper.Viper, body str server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-kafka/{name}/maintenance/start" - url = strings.Replace(url, "{name}", paramName, 1) - - req := cli.Client.Put().URL(url) + url := server + "/dbaas-grafana/{service-name}/user/{username}/password/reveal" + url = strings.Replace(url, "{service-name}", paramServiceName, 1) + url = strings.Replace(url, "{username}", paramUsername, 1) - if body != "" { - req = req.AddHeader("Content-Type", "").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -3088,9 +3176,9 @@ func XStartDbaasKafkaMaintenance(paramName string, params *viper.Viper, body str return resp, decoded, nil } -// XCreateDbaasKafkaSchemaRegistryAclConfig Add a Kafka Schema Registry ACL entry -func XCreateDbaasKafkaSchemaRegistryAclConfig(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-dbaas-kafka-schema-registry-acl-config" +// XCreateDbaasIntegration create-dbaas-integration +func XCreateDbaasIntegration(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-dbaas-integration" if xSubcommand { handlerPath = "x " + handlerPath } @@ -3100,8 +3188,7 @@ func XCreateDbaasKafkaSchemaRegistryAclConfig(paramName string, params *viper.Vi server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-kafka/{name}/schema-registry/acl-config" - url = strings.Replace(url, "{name}", paramName, 1) + url := server + "/dbaas-integration" req := cli.Client.Post().URL(url) @@ -3134,9 +3221,9 @@ func XCreateDbaasKafkaSchemaRegistryAclConfig(paramName string, params *viper.Vi return resp, decoded, nil } -// XDeleteDbaasKafkaSchemaRegistryAclConfig Delete a Kafka ACL entry -func XDeleteDbaasKafkaSchemaRegistryAclConfig(paramName string, paramAclId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-dbaas-kafka-schema-registry-acl-config" +// XListDbaasIntegrationSettings list-dbaas-integration-settings +func XListDbaasIntegrationSettings(paramIntegrationType string, paramSourceType string, paramDestType string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-dbaas-integration-settings" if xSubcommand { handlerPath = "x " + handlerPath } @@ -3146,11 +3233,12 @@ func XDeleteDbaasKafkaSchemaRegistryAclConfig(paramName string, paramAclId strin server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-kafka/{name}/schema-registry/acl-config/{acl-id}" - url = strings.Replace(url, "{name}", paramName, 1) - url = strings.Replace(url, "{acl-id}", paramAclId, 1) + url := server + "/dbaas-integration-settings/{integration-type}/{source-type}/{dest-type}" + url = strings.Replace(url, "{integration-type}", paramIntegrationType, 1) + url = strings.Replace(url, "{source-type}", paramSourceType, 1) + url = strings.Replace(url, "{dest-type}", paramDestType, 1) - req := cli.Client.Delete().URL(url) + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -3177,9 +3265,9 @@ func XDeleteDbaasKafkaSchemaRegistryAclConfig(paramName string, paramAclId strin return resp, decoded, nil } -// XCreateDbaasKafkaTopicAclConfig Add a Kafka topic ACL entry -func XCreateDbaasKafkaTopicAclConfig(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-dbaas-kafka-topic-acl-config" +// XListDbaasIntegrationTypes list-dbaas-integration-types +func XListDbaasIntegrationTypes(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-dbaas-integration-types" if xSubcommand { handlerPath = "x " + handlerPath } @@ -3189,14 +3277,9 @@ func XCreateDbaasKafkaTopicAclConfig(paramName string, params *viper.Viper, body server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-kafka/{name}/topic/acl-config" - url = strings.Replace(url, "{name}", paramName, 1) - - req := cli.Client.Post().URL(url) + url := server + "/dbaas-integration-types" - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -3223,9 +3306,9 @@ func XCreateDbaasKafkaTopicAclConfig(paramName string, params *viper.Viper, body return resp, decoded, nil } -// XDeleteDbaasKafkaTopicAclConfig Delete a Kafka ACL entry -func XDeleteDbaasKafkaTopicAclConfig(paramName string, paramAclId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-dbaas-kafka-topic-acl-config" +// XDeleteDbaasIntegration delete-dbaas-integration +func XDeleteDbaasIntegration(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-dbaas-integration" if xSubcommand { handlerPath = "x " + handlerPath } @@ -3235,9 +3318,8 @@ func XDeleteDbaasKafkaTopicAclConfig(paramName string, paramAclId string, params server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-kafka/{name}/topic/acl-config/{acl-id}" - url = strings.Replace(url, "{name}", paramName, 1) - url = strings.Replace(url, "{acl-id}", paramAclId, 1) + url := server + "/dbaas-integration/{id}" + url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Delete().URL(url) @@ -3266,9 +3348,9 @@ func XDeleteDbaasKafkaTopicAclConfig(paramName string, paramAclId string, params return resp, decoded, nil } -// XRevealDbaasKafkaConnectPassword Reveal the secrets for DBaaS Kafka Connect -func XRevealDbaasKafkaConnectPassword(paramServiceName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "reveal-dbaas-kafka-connect-password" +// XGetDbaasIntegration get-dbaas-integration +func XGetDbaasIntegration(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dbaas-integration" if xSubcommand { handlerPath = "x " + handlerPath } @@ -3278,8 +3360,8 @@ func XRevealDbaasKafkaConnectPassword(paramServiceName string, params *viper.Vip server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-kafka/{service-name}/connect/password/reveal" - url = strings.Replace(url, "{service-name}", paramServiceName, 1) + url := server + "/dbaas-integration/{id}" + url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Get().URL(url) @@ -3308,9 +3390,9 @@ func XRevealDbaasKafkaConnectPassword(paramServiceName string, params *viper.Vip return resp, decoded, nil } -// XCreateDbaasKafkaUser Create a DBaaS Kafka user -func XCreateDbaasKafkaUser(paramServiceName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-dbaas-kafka-user" +// XUpdateDbaasIntegration update-dbaas-integration +func XUpdateDbaasIntegration(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-dbaas-integration" if xSubcommand { handlerPath = "x " + handlerPath } @@ -3320,10 +3402,10 @@ func XCreateDbaasKafkaUser(paramServiceName string, params *viper.Viper, body st server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-kafka/{service-name}/user" - url = strings.Replace(url, "{service-name}", paramServiceName, 1) + url := server + "/dbaas-integration/{id}" + url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Post().URL(url) + req := cli.Client.Put().URL(url) if body != "" { req = req.AddHeader("Content-Type", "application/json").BodyString(body) @@ -3354,9 +3436,9 @@ func XCreateDbaasKafkaUser(paramServiceName string, params *viper.Viper, body st return resp, decoded, nil } -// XDeleteDbaasKafkaUser Delete a DBaaS kafka user -func XDeleteDbaasKafkaUser(paramServiceName string, paramUsername string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-dbaas-kafka-user" +// XCreateDbaasServiceKafka Create a DBaaS Kafka service +func XCreateDbaasServiceKafka(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-dbaas-service-kafka" if xSubcommand { handlerPath = "x " + handlerPath } @@ -3366,11 +3448,14 @@ func XDeleteDbaasKafkaUser(paramServiceName string, paramUsername string, params server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-kafka/{service-name}/user/{username}" - url = strings.Replace(url, "{service-name}", paramServiceName, 1) - url = strings.Replace(url, "{username}", paramUsername, 1) + url := server + "/dbaas-kafka/{name}" + url = strings.Replace(url, "{name}", paramName, 1) - req := cli.Client.Delete().URL(url) + req := cli.Client.Post().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -3397,9 +3482,9 @@ func XDeleteDbaasKafkaUser(paramServiceName string, paramUsername string, params return resp, decoded, nil } -// XResetDbaasKafkaUserPassword Reset the credentials of a DBaaS Kafka user -func XResetDbaasKafkaUserPassword(paramServiceName string, paramUsername string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "reset-dbaas-kafka-user-password" +// XDeleteDbaasServiceKafka Delete a Kafka service +func XDeleteDbaasServiceKafka(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-dbaas-service-kafka" if xSubcommand { handlerPath = "x " + handlerPath } @@ -3409,15 +3494,10 @@ func XResetDbaasKafkaUserPassword(paramServiceName string, paramUsername string, server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-kafka/{service-name}/user/{username}/password/reset" - url = strings.Replace(url, "{service-name}", paramServiceName, 1) - url = strings.Replace(url, "{username}", paramUsername, 1) - - req := cli.Client.Put().URL(url) + url := server + "/dbaas-kafka/{name}" + url = strings.Replace(url, "{name}", paramName, 1) - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -3444,9 +3524,9 @@ func XResetDbaasKafkaUserPassword(paramServiceName string, paramUsername string, return resp, decoded, nil } -// XRevealDbaasKafkaUserPassword Reveal the secrets of a DBaaS Kafka user -func XRevealDbaasKafkaUserPassword(paramServiceName string, paramUsername string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "reveal-dbaas-kafka-user-password" +// XGetDbaasServiceKafka Get a DBaaS Kafka service +func XGetDbaasServiceKafka(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dbaas-service-kafka" if xSubcommand { handlerPath = "x " + handlerPath } @@ -3456,9 +3536,8 @@ func XRevealDbaasKafkaUserPassword(paramServiceName string, paramUsername string server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-kafka/{service-name}/user/{username}/password/reveal" - url = strings.Replace(url, "{service-name}", paramServiceName, 1) - url = strings.Replace(url, "{username}", paramUsername, 1) + url := server + "/dbaas-kafka/{name}" + url = strings.Replace(url, "{name}", paramName, 1) req := cli.Client.Get().URL(url) @@ -3487,9 +3566,9 @@ func XRevealDbaasKafkaUserPassword(paramServiceName string, paramUsername string return resp, decoded, nil } -// XGetDbaasMigrationStatus Get a DBaaS migration status -func XGetDbaasMigrationStatus(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-dbaas-migration-status" +// XUpdateDbaasServiceKafka Update a DBaaS Kafka service +func XUpdateDbaasServiceKafka(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-dbaas-service-kafka" if xSubcommand { handlerPath = "x " + handlerPath } @@ -3499,10 +3578,14 @@ func XGetDbaasMigrationStatus(paramName string, params *viper.Viper) (*gentleman server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-migration-status/{name}" + url := server + "/dbaas-kafka/{name}" url = strings.Replace(url, "{name}", paramName, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Put().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -3529,9 +3612,9 @@ func XGetDbaasMigrationStatus(paramName string, params *viper.Viper) (*gentleman return resp, decoded, nil } -// XCreateDbaasServiceMysql Create a DBaaS MySQL service -func XCreateDbaasServiceMysql(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-dbaas-service-mysql" +// XGetDbaasKafkaAclConfig Get DBaaS kafka ACL configuration +func XGetDbaasKafkaAclConfig(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dbaas-kafka-acl-config" if xSubcommand { handlerPath = "x " + handlerPath } @@ -3541,14 +3624,10 @@ func XCreateDbaasServiceMysql(paramName string, params *viper.Viper, body string server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-mysql/{name}" + url := server + "/dbaas-kafka/{name}/acl-config" url = strings.Replace(url, "{name}", paramName, 1) - req := cli.Client.Post().URL(url) - - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -3575,9 +3654,9 @@ func XCreateDbaasServiceMysql(paramName string, params *viper.Viper, body string return resp, decoded, nil } -// XDeleteDbaasServiceMysql Delete a MySQL service -func XDeleteDbaasServiceMysql(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-dbaas-service-mysql" +// XStartDbaasKafkaMaintenance Initiate Kafka maintenance update +func XStartDbaasKafkaMaintenance(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "start-dbaas-kafka-maintenance" if xSubcommand { handlerPath = "x " + handlerPath } @@ -3587,10 +3666,14 @@ func XDeleteDbaasServiceMysql(paramName string, params *viper.Viper) (*gentleman server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-mysql/{name}" + url := server + "/dbaas-kafka/{name}/maintenance/start" url = strings.Replace(url, "{name}", paramName, 1) - req := cli.Client.Delete().URL(url) + req := cli.Client.Put().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -3617,9 +3700,9 @@ func XDeleteDbaasServiceMysql(paramName string, params *viper.Viper) (*gentleman return resp, decoded, nil } -// XGetDbaasServiceMysql Get a DBaaS MySQL service -func XGetDbaasServiceMysql(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-dbaas-service-mysql" +// XCreateDbaasKafkaSchemaRegistryAclConfig Add a Kafka Schema Registry ACL entry +func XCreateDbaasKafkaSchemaRegistryAclConfig(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-dbaas-kafka-schema-registry-acl-config" if xSubcommand { handlerPath = "x " + handlerPath } @@ -3629,10 +3712,14 @@ func XGetDbaasServiceMysql(paramName string, params *viper.Viper) (*gentleman.Re server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-mysql/{name}" + url := server + "/dbaas-kafka/{name}/schema-registry/acl-config" url = strings.Replace(url, "{name}", paramName, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Post().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -3659,9 +3746,9 @@ func XGetDbaasServiceMysql(paramName string, params *viper.Viper) (*gentleman.Re return resp, decoded, nil } -// XUpdateDbaasServiceMysql Update a DBaaS MySQL service -func XUpdateDbaasServiceMysql(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "update-dbaas-service-mysql" +// XDeleteDbaasKafkaSchemaRegistryAclConfig Delete a Kafka ACL entry +func XDeleteDbaasKafkaSchemaRegistryAclConfig(paramName string, paramAclId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-dbaas-kafka-schema-registry-acl-config" if xSubcommand { handlerPath = "x " + handlerPath } @@ -3671,14 +3758,11 @@ func XUpdateDbaasServiceMysql(paramName string, params *viper.Viper, body string server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-mysql/{name}" + url := server + "/dbaas-kafka/{name}/schema-registry/acl-config/{acl-id}" url = strings.Replace(url, "{name}", paramName, 1) + url = strings.Replace(url, "{acl-id}", paramAclId, 1) - req := cli.Client.Put().URL(url) - - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -3705,9 +3789,9 @@ func XUpdateDbaasServiceMysql(paramName string, params *viper.Viper, body string return resp, decoded, nil } -// XEnableDbaasMysqlWrites Temporarily enable writes for MySQL services in read-only mode due to filled up storage -func XEnableDbaasMysqlWrites(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "enable-dbaas-mysql-writes" +// XCreateDbaasKafkaTopicAclConfig Add a Kafka topic ACL entry +func XCreateDbaasKafkaTopicAclConfig(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-dbaas-kafka-topic-acl-config" if xSubcommand { handlerPath = "x " + handlerPath } @@ -3717,13 +3801,13 @@ func XEnableDbaasMysqlWrites(paramName string, params *viper.Viper, body string) server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-mysql/{name}/enable/writes" + url := server + "/dbaas-kafka/{name}/topic/acl-config" url = strings.Replace(url, "{name}", paramName, 1) - req := cli.Client.Put().URL(url) + req := cli.Client.Post().URL(url) if body != "" { - req = req.AddHeader("Content-Type", "").BodyString(body) + req = req.AddHeader("Content-Type", "application/json").BodyString(body) } cli.HandleBefore(handlerPath, params, req) @@ -3751,9 +3835,9 @@ func XEnableDbaasMysqlWrites(paramName string, params *viper.Viper, body string) return resp, decoded, nil } -// XStartDbaasMysqlMaintenance Initiate MySQL maintenance update -func XStartDbaasMysqlMaintenance(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "start-dbaas-mysql-maintenance" +// XDeleteDbaasKafkaTopicAclConfig Delete a Kafka ACL entry +func XDeleteDbaasKafkaTopicAclConfig(paramName string, paramAclId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-dbaas-kafka-topic-acl-config" if xSubcommand { handlerPath = "x " + handlerPath } @@ -3763,14 +3847,11 @@ func XStartDbaasMysqlMaintenance(paramName string, params *viper.Viper, body str server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-mysql/{name}/maintenance/start" + url := server + "/dbaas-kafka/{name}/topic/acl-config/{acl-id}" url = strings.Replace(url, "{name}", paramName, 1) + url = strings.Replace(url, "{acl-id}", paramAclId, 1) - req := cli.Client.Put().URL(url) - - if body != "" { - req = req.AddHeader("Content-Type", "").BodyString(body) - } + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -3797,9 +3878,9 @@ func XStartDbaasMysqlMaintenance(paramName string, params *viper.Viper, body str return resp, decoded, nil } -// XStopDbaasMysqlMigration Stop a DBaaS MySQL migration -func XStopDbaasMysqlMigration(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "stop-dbaas-mysql-migration" +// XRevealDbaasKafkaConnectPassword Reveal the secrets for DBaaS Kafka Connect +func XRevealDbaasKafkaConnectPassword(paramServiceName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "reveal-dbaas-kafka-connect-password" if xSubcommand { handlerPath = "x " + handlerPath } @@ -3809,14 +3890,10 @@ func XStopDbaasMysqlMigration(paramName string, params *viper.Viper, body string server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-mysql/{name}/migration/stop" - url = strings.Replace(url, "{name}", paramName, 1) - - req := cli.Client.Post().URL(url) + url := server + "/dbaas-kafka/{service-name}/connect/password/reveal" + url = strings.Replace(url, "{service-name}", paramServiceName, 1) - if body != "" { - req = req.AddHeader("Content-Type", "").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -3843,9 +3920,9 @@ func XStopDbaasMysqlMigration(paramName string, params *viper.Viper, body string return resp, decoded, nil } -// XCreateDbaasMysqlDatabase Create a DBaaS MySQL database -func XCreateDbaasMysqlDatabase(paramServiceName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-dbaas-mysql-database" +// XCreateDbaasKafkaUser Create a DBaaS Kafka user +func XCreateDbaasKafkaUser(paramServiceName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-dbaas-kafka-user" if xSubcommand { handlerPath = "x " + handlerPath } @@ -3855,7 +3932,7 @@ func XCreateDbaasMysqlDatabase(paramServiceName string, params *viper.Viper, bod server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-mysql/{service-name}/database" + url := server + "/dbaas-kafka/{service-name}/user" url = strings.Replace(url, "{service-name}", paramServiceName, 1) req := cli.Client.Post().URL(url) @@ -3889,9 +3966,9 @@ func XCreateDbaasMysqlDatabase(paramServiceName string, params *viper.Viper, bod return resp, decoded, nil } -// XDeleteDbaasMysqlDatabase Delete a DBaaS MySQL database -func XDeleteDbaasMysqlDatabase(paramServiceName string, paramDatabaseName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-dbaas-mysql-database" +// XDeleteDbaasKafkaUser Delete a DBaaS kafka user +func XDeleteDbaasKafkaUser(paramServiceName string, paramUsername string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-dbaas-kafka-user" if xSubcommand { handlerPath = "x " + handlerPath } @@ -3901,9 +3978,9 @@ func XDeleteDbaasMysqlDatabase(paramServiceName string, paramDatabaseName string server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-mysql/{service-name}/database/{database-name}" + url := server + "/dbaas-kafka/{service-name}/user/{username}" url = strings.Replace(url, "{service-name}", paramServiceName, 1) - url = strings.Replace(url, "{database-name}", paramDatabaseName, 1) + url = strings.Replace(url, "{username}", paramUsername, 1) req := cli.Client.Delete().URL(url) @@ -3932,9 +4009,9 @@ func XDeleteDbaasMysqlDatabase(paramServiceName string, paramDatabaseName string return resp, decoded, nil } -// XCreateDbaasMysqlUser Create a DBaaS MySQL user -func XCreateDbaasMysqlUser(paramServiceName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-dbaas-mysql-user" +// XResetDbaasKafkaUserPassword Reset the credentials of a DBaaS Kafka user +func XResetDbaasKafkaUserPassword(paramServiceName string, paramUsername string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "reset-dbaas-kafka-user-password" if xSubcommand { handlerPath = "x " + handlerPath } @@ -3944,10 +4021,11 @@ func XCreateDbaasMysqlUser(paramServiceName string, params *viper.Viper, body st server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-mysql/{service-name}/user" + url := server + "/dbaas-kafka/{service-name}/user/{username}/password/reset" url = strings.Replace(url, "{service-name}", paramServiceName, 1) + url = strings.Replace(url, "{username}", paramUsername, 1) - req := cli.Client.Post().URL(url) + req := cli.Client.Put().URL(url) if body != "" { req = req.AddHeader("Content-Type", "application/json").BodyString(body) @@ -3978,9 +4056,9 @@ func XCreateDbaasMysqlUser(paramServiceName string, params *viper.Viper, body st return resp, decoded, nil } -// XDeleteDbaasMysqlUser Delete a DBaaS MySQL user -func XDeleteDbaasMysqlUser(paramServiceName string, paramUsername string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-dbaas-mysql-user" +// XRevealDbaasKafkaUserPassword Reveal the secrets of a DBaaS Kafka user +func XRevealDbaasKafkaUserPassword(paramServiceName string, paramUsername string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "reveal-dbaas-kafka-user-password" if xSubcommand { handlerPath = "x " + handlerPath } @@ -3990,11 +4068,11 @@ func XDeleteDbaasMysqlUser(paramServiceName string, paramUsername string, params server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-mysql/{service-name}/user/{username}" + url := server + "/dbaas-kafka/{service-name}/user/{username}/password/reveal" url = strings.Replace(url, "{service-name}", paramServiceName, 1) url = strings.Replace(url, "{username}", paramUsername, 1) - req := cli.Client.Delete().URL(url) + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -4021,9 +4099,9 @@ func XDeleteDbaasMysqlUser(paramServiceName string, paramUsername string, params return resp, decoded, nil } -// XResetDbaasMysqlUserPassword Reset the credentials of a DBaaS mysql user -func XResetDbaasMysqlUserPassword(paramServiceName string, paramUsername string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "reset-dbaas-mysql-user-password" +// XGetDbaasMigrationStatus Get a DBaaS migration status +func XGetDbaasMigrationStatus(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dbaas-migration-status" if xSubcommand { handlerPath = "x " + handlerPath } @@ -4033,15 +4111,10 @@ func XResetDbaasMysqlUserPassword(paramServiceName string, paramUsername string, server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-mysql/{service-name}/user/{username}/password/reset" - url = strings.Replace(url, "{service-name}", paramServiceName, 1) - url = strings.Replace(url, "{username}", paramUsername, 1) - - req := cli.Client.Put().URL(url) + url := server + "/dbaas-migration-status/{name}" + url = strings.Replace(url, "{name}", paramName, 1) - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -4068,9 +4141,9 @@ func XResetDbaasMysqlUserPassword(paramServiceName string, paramUsername string, return resp, decoded, nil } -// XRevealDbaasMysqlUserPassword Reveal the secrets of a DBaaS MySQL user -func XRevealDbaasMysqlUserPassword(paramServiceName string, paramUsername string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "reveal-dbaas-mysql-user-password" +// XCreateDbaasServiceMysql Create a DBaaS MySQL service +func XCreateDbaasServiceMysql(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-dbaas-service-mysql" if xSubcommand { handlerPath = "x " + handlerPath } @@ -4080,11 +4153,14 @@ func XRevealDbaasMysqlUserPassword(paramServiceName string, paramUsername string server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-mysql/{service-name}/user/{username}/password/reveal" - url = strings.Replace(url, "{service-name}", paramServiceName, 1) - url = strings.Replace(url, "{username}", paramUsername, 1) + url := server + "/dbaas-mysql/{name}" + url = strings.Replace(url, "{name}", paramName, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Post().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -4111,9 +4187,9 @@ func XRevealDbaasMysqlUserPassword(paramServiceName string, paramUsername string return resp, decoded, nil } -// XCreateDbaasServiceOpensearch Create a DBaaS OpenSearch service -func XCreateDbaasServiceOpensearch(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-dbaas-service-opensearch" +// XDeleteDbaasServiceMysql Delete a MySQL service +func XDeleteDbaasServiceMysql(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-dbaas-service-mysql" if xSubcommand { handlerPath = "x " + handlerPath } @@ -4123,14 +4199,10 @@ func XCreateDbaasServiceOpensearch(paramName string, params *viper.Viper, body s server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-opensearch/{name}" + url := server + "/dbaas-mysql/{name}" url = strings.Replace(url, "{name}", paramName, 1) - req := cli.Client.Post().URL(url) - - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -4157,9 +4229,9 @@ func XCreateDbaasServiceOpensearch(paramName string, params *viper.Viper, body s return resp, decoded, nil } -// XDeleteDbaasServiceOpensearch Delete a OpenSearch service -func XDeleteDbaasServiceOpensearch(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-dbaas-service-opensearch" +// XGetDbaasServiceMysql Get a DBaaS MySQL service +func XGetDbaasServiceMysql(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dbaas-service-mysql" if xSubcommand { handlerPath = "x " + handlerPath } @@ -4169,10 +4241,10 @@ func XDeleteDbaasServiceOpensearch(paramName string, params *viper.Viper) (*gent server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-opensearch/{name}" + url := server + "/dbaas-mysql/{name}" url = strings.Replace(url, "{name}", paramName, 1) - req := cli.Client.Delete().URL(url) + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -4199,9 +4271,9 @@ func XDeleteDbaasServiceOpensearch(paramName string, params *viper.Viper) (*gent return resp, decoded, nil } -// XGetDbaasServiceOpensearch Get a DBaaS OpenSearch service -func XGetDbaasServiceOpensearch(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-dbaas-service-opensearch" +// XUpdateDbaasServiceMysql Update a DBaaS MySQL service +func XUpdateDbaasServiceMysql(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-dbaas-service-mysql" if xSubcommand { handlerPath = "x " + handlerPath } @@ -4211,10 +4283,14 @@ func XGetDbaasServiceOpensearch(paramName string, params *viper.Viper) (*gentlem server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-opensearch/{name}" + url := server + "/dbaas-mysql/{name}" url = strings.Replace(url, "{name}", paramName, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Put().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -4241,9 +4317,9 @@ func XGetDbaasServiceOpensearch(paramName string, params *viper.Viper) (*gentlem return resp, decoded, nil } -// XUpdateDbaasServiceOpensearch Update a DBaaS OpenSearch service -func XUpdateDbaasServiceOpensearch(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "update-dbaas-service-opensearch" +// XEnableDbaasMysqlWrites Temporarily enable writes for MySQL services in read-only mode due to filled up storage +func XEnableDbaasMysqlWrites(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "enable-dbaas-mysql-writes" if xSubcommand { handlerPath = "x " + handlerPath } @@ -4253,13 +4329,13 @@ func XUpdateDbaasServiceOpensearch(paramName string, params *viper.Viper, body s server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-opensearch/{name}" + url := server + "/dbaas-mysql/{name}/enable/writes" url = strings.Replace(url, "{name}", paramName, 1) req := cli.Client.Put().URL(url) if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) + req = req.AddHeader("Content-Type", "").BodyString(body) } cli.HandleBefore(handlerPath, params, req) @@ -4287,9 +4363,9 @@ func XUpdateDbaasServiceOpensearch(paramName string, params *viper.Viper, body s return resp, decoded, nil } -// XGetDbaasOpensearchAclConfig Get DBaaS OpenSearch ACL configuration -func XGetDbaasOpensearchAclConfig(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-dbaas-opensearch-acl-config" +// XStartDbaasMysqlMaintenance Initiate MySQL maintenance update +func XStartDbaasMysqlMaintenance(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "start-dbaas-mysql-maintenance" if xSubcommand { handlerPath = "x " + handlerPath } @@ -4299,10 +4375,14 @@ func XGetDbaasOpensearchAclConfig(paramName string, params *viper.Viper) (*gentl server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-opensearch/{name}/acl-config" + url := server + "/dbaas-mysql/{name}/maintenance/start" url = strings.Replace(url, "{name}", paramName, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Put().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -4329,9 +4409,9 @@ func XGetDbaasOpensearchAclConfig(paramName string, params *viper.Viper) (*gentl return resp, decoded, nil } -// XUpdateDbaasOpensearchAclConfig Create a DBaaS OpenSearch ACL configuration -func XUpdateDbaasOpensearchAclConfig(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "update-dbaas-opensearch-acl-config" +// XStopDbaasMysqlMigration Stop a DBaaS MySQL migration +func XStopDbaasMysqlMigration(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "stop-dbaas-mysql-migration" if xSubcommand { handlerPath = "x " + handlerPath } @@ -4341,13 +4421,13 @@ func XUpdateDbaasOpensearchAclConfig(paramName string, params *viper.Viper, body server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-opensearch/{name}/acl-config" + url := server + "/dbaas-mysql/{name}/migration/stop" url = strings.Replace(url, "{name}", paramName, 1) - req := cli.Client.Put().URL(url) + req := cli.Client.Post().URL(url) if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) + req = req.AddHeader("Content-Type", "").BodyString(body) } cli.HandleBefore(handlerPath, params, req) @@ -4375,9 +4455,9 @@ func XUpdateDbaasOpensearchAclConfig(paramName string, params *viper.Viper, body return resp, decoded, nil } -// XStartDbaasOpensearchMaintenance Initiate OpenSearch maintenance update -func XStartDbaasOpensearchMaintenance(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "start-dbaas-opensearch-maintenance" +// XCreateDbaasMysqlDatabase Create a DBaaS MySQL database +func XCreateDbaasMysqlDatabase(paramServiceName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-dbaas-mysql-database" if xSubcommand { handlerPath = "x " + handlerPath } @@ -4387,13 +4467,13 @@ func XStartDbaasOpensearchMaintenance(paramName string, params *viper.Viper, bod server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-opensearch/{name}/maintenance/start" - url = strings.Replace(url, "{name}", paramName, 1) + url := server + "/dbaas-mysql/{service-name}/database" + url = strings.Replace(url, "{service-name}", paramServiceName, 1) - req := cli.Client.Put().URL(url) + req := cli.Client.Post().URL(url) if body != "" { - req = req.AddHeader("Content-Type", "").BodyString(body) + req = req.AddHeader("Content-Type", "application/json").BodyString(body) } cli.HandleBefore(handlerPath, params, req) @@ -4421,9 +4501,9 @@ func XStartDbaasOpensearchMaintenance(paramName string, params *viper.Viper, bod return resp, decoded, nil } -// XCreateDbaasOpensearchUser Create a DBaaS OpenSearch user -func XCreateDbaasOpensearchUser(paramServiceName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-dbaas-opensearch-user" +// XDeleteDbaasMysqlDatabase Delete a DBaaS MySQL database +func XDeleteDbaasMysqlDatabase(paramServiceName string, paramDatabaseName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-dbaas-mysql-database" if xSubcommand { handlerPath = "x " + handlerPath } @@ -4433,14 +4513,11 @@ func XCreateDbaasOpensearchUser(paramServiceName string, params *viper.Viper, bo server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-opensearch/{service-name}/user" + url := server + "/dbaas-mysql/{service-name}/database/{database-name}" url = strings.Replace(url, "{service-name}", paramServiceName, 1) + url = strings.Replace(url, "{database-name}", paramDatabaseName, 1) - req := cli.Client.Post().URL(url) - - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -4467,9 +4544,9 @@ func XCreateDbaasOpensearchUser(paramServiceName string, params *viper.Viper, bo return resp, decoded, nil } -// XDeleteDbaasOpensearchUser Delete a DBaaS OpenSearch user -func XDeleteDbaasOpensearchUser(paramServiceName string, paramUsername string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-dbaas-opensearch-user" +// XCreateDbaasMysqlUser Create a DBaaS MySQL user +func XCreateDbaasMysqlUser(paramServiceName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-dbaas-mysql-user" if xSubcommand { handlerPath = "x " + handlerPath } @@ -4479,7 +4556,53 @@ func XDeleteDbaasOpensearchUser(paramServiceName string, paramUsername string, p server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-opensearch/{service-name}/user/{username}" + url := server + "/dbaas-mysql/{service-name}/user" + url = strings.Replace(url, "{service-name}", paramServiceName, 1) + + req := cli.Client.Post().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XDeleteDbaasMysqlUser Delete a DBaaS MySQL user +func XDeleteDbaasMysqlUser(paramServiceName string, paramUsername string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-dbaas-mysql-user" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/dbaas-mysql/{service-name}/user/{username}" url = strings.Replace(url, "{service-name}", paramServiceName, 1) url = strings.Replace(url, "{username}", paramUsername, 1) @@ -4510,9 +4633,9 @@ func XDeleteDbaasOpensearchUser(paramServiceName string, paramUsername string, p return resp, decoded, nil } -// XResetDbaasOpensearchUserPassword Reset the credentials of a DBaaS OpenSearch user -func XResetDbaasOpensearchUserPassword(paramServiceName string, paramUsername string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "reset-dbaas-opensearch-user-password" +// XResetDbaasMysqlUserPassword Reset the credentials of a DBaaS mysql user +func XResetDbaasMysqlUserPassword(paramServiceName string, paramUsername string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "reset-dbaas-mysql-user-password" if xSubcommand { handlerPath = "x " + handlerPath } @@ -4522,7 +4645,7 @@ func XResetDbaasOpensearchUserPassword(paramServiceName string, paramUsername st server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-opensearch/{service-name}/user/{username}/password/reset" + url := server + "/dbaas-mysql/{service-name}/user/{username}/password/reset" url = strings.Replace(url, "{service-name}", paramServiceName, 1) url = strings.Replace(url, "{username}", paramUsername, 1) @@ -4557,9 +4680,9 @@ func XResetDbaasOpensearchUserPassword(paramServiceName string, paramUsername st return resp, decoded, nil } -// XRevealDbaasOpensearchUserPassword Reveal the secrets of a DBaaS OpenSearch user -func XRevealDbaasOpensearchUserPassword(paramServiceName string, paramUsername string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "reveal-dbaas-opensearch-user-password" +// XRevealDbaasMysqlUserPassword Reveal the secrets of a DBaaS MySQL user +func XRevealDbaasMysqlUserPassword(paramServiceName string, paramUsername string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "reveal-dbaas-mysql-user-password" if xSubcommand { handlerPath = "x " + handlerPath } @@ -4569,7 +4692,7 @@ func XRevealDbaasOpensearchUserPassword(paramServiceName string, paramUsername s server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-opensearch/{service-name}/user/{username}/password/reveal" + url := server + "/dbaas-mysql/{service-name}/user/{username}/password/reveal" url = strings.Replace(url, "{service-name}", paramServiceName, 1) url = strings.Replace(url, "{username}", paramUsername, 1) @@ -4600,9 +4723,9 @@ func XRevealDbaasOpensearchUserPassword(paramServiceName string, paramUsername s return resp, decoded, nil } -// XCreateDbaasServicePg Create a DBaaS PostgreSQL service -func XCreateDbaasServicePg(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-dbaas-service-pg" +// XCreateDbaasServiceOpensearch Create a DBaaS OpenSearch service +func XCreateDbaasServiceOpensearch(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-dbaas-service-opensearch" if xSubcommand { handlerPath = "x " + handlerPath } @@ -4612,7 +4735,7 @@ func XCreateDbaasServicePg(paramName string, params *viper.Viper, body string) ( server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-postgres/{name}" + url := server + "/dbaas-opensearch/{name}" url = strings.Replace(url, "{name}", paramName, 1) req := cli.Client.Post().URL(url) @@ -4646,9 +4769,9 @@ func XCreateDbaasServicePg(paramName string, params *viper.Viper, body string) ( return resp, decoded, nil } -// XDeleteDbaasServicePg Delete a Postgres service -func XDeleteDbaasServicePg(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-dbaas-service-pg" +// XDeleteDbaasServiceOpensearch Delete a OpenSearch service +func XDeleteDbaasServiceOpensearch(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-dbaas-service-opensearch" if xSubcommand { handlerPath = "x " + handlerPath } @@ -4658,7 +4781,7 @@ func XDeleteDbaasServicePg(paramName string, params *viper.Viper) (*gentleman.Re server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-postgres/{name}" + url := server + "/dbaas-opensearch/{name}" url = strings.Replace(url, "{name}", paramName, 1) req := cli.Client.Delete().URL(url) @@ -4688,9 +4811,9 @@ func XDeleteDbaasServicePg(paramName string, params *viper.Viper) (*gentleman.Re return resp, decoded, nil } -// XGetDbaasServicePg Get a DBaaS PostgreSQL service -func XGetDbaasServicePg(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-dbaas-service-pg" +// XGetDbaasServiceOpensearch Get a DBaaS OpenSearch service +func XGetDbaasServiceOpensearch(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dbaas-service-opensearch" if xSubcommand { handlerPath = "x " + handlerPath } @@ -4700,7 +4823,7 @@ func XGetDbaasServicePg(paramName string, params *viper.Viper) (*gentleman.Respo server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-postgres/{name}" + url := server + "/dbaas-opensearch/{name}" url = strings.Replace(url, "{name}", paramName, 1) req := cli.Client.Get().URL(url) @@ -4730,9 +4853,9 @@ func XGetDbaasServicePg(paramName string, params *viper.Viper) (*gentleman.Respo return resp, decoded, nil } -// XUpdateDbaasServicePg Update a DBaaS PostgreSQL service -func XUpdateDbaasServicePg(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "update-dbaas-service-pg" +// XUpdateDbaasServiceOpensearch Update a DBaaS OpenSearch service +func XUpdateDbaasServiceOpensearch(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-dbaas-service-opensearch" if xSubcommand { handlerPath = "x " + handlerPath } @@ -4742,7 +4865,7 @@ func XUpdateDbaasServicePg(paramName string, params *viper.Viper, body string) ( server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-postgres/{name}" + url := server + "/dbaas-opensearch/{name}" url = strings.Replace(url, "{name}", paramName, 1) req := cli.Client.Put().URL(url) @@ -4776,9 +4899,9 @@ func XUpdateDbaasServicePg(paramName string, params *viper.Viper, body string) ( return resp, decoded, nil } -// XStartDbaasPgMaintenance Initiate PostgreSQL maintenance update -func XStartDbaasPgMaintenance(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "start-dbaas-pg-maintenance" +// XGetDbaasOpensearchAclConfig Get DBaaS OpenSearch ACL configuration +func XGetDbaasOpensearchAclConfig(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dbaas-opensearch-acl-config" if xSubcommand { handlerPath = "x " + handlerPath } @@ -4788,14 +4911,10 @@ func XStartDbaasPgMaintenance(paramName string, params *viper.Viper, body string server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-postgres/{name}/maintenance/start" + url := server + "/dbaas-opensearch/{name}/acl-config" url = strings.Replace(url, "{name}", paramName, 1) - req := cli.Client.Put().URL(url) - - if body != "" { - req = req.AddHeader("Content-Type", "").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -4822,9 +4941,9 @@ func XStartDbaasPgMaintenance(paramName string, params *viper.Viper, body string return resp, decoded, nil } -// XStopDbaasPgMigration Stop a DBaaS PostgreSQL migration -func XStopDbaasPgMigration(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "stop-dbaas-pg-migration" +// XUpdateDbaasOpensearchAclConfig Create a DBaaS OpenSearch ACL configuration +func XUpdateDbaasOpensearchAclConfig(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-dbaas-opensearch-acl-config" if xSubcommand { handlerPath = "x " + handlerPath } @@ -4834,13 +4953,13 @@ func XStopDbaasPgMigration(paramName string, params *viper.Viper, body string) ( server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-postgres/{name}/migration/stop" + url := server + "/dbaas-opensearch/{name}/acl-config" url = strings.Replace(url, "{name}", paramName, 1) - req := cli.Client.Post().URL(url) + req := cli.Client.Put().URL(url) if body != "" { - req = req.AddHeader("Content-Type", "").BodyString(body) + req = req.AddHeader("Content-Type", "application/json").BodyString(body) } cli.HandleBefore(handlerPath, params, req) @@ -4868,9 +4987,9 @@ func XStopDbaasPgMigration(paramName string, params *viper.Viper, body string) ( return resp, decoded, nil } -// XCreateDbaasPgConnectionPool Create a DBaaS PostgreSQL connection pool -func XCreateDbaasPgConnectionPool(paramServiceName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-dbaas-pg-connection-pool" +// XStartDbaasOpensearchMaintenance Initiate OpenSearch maintenance update +func XStartDbaasOpensearchMaintenance(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "start-dbaas-opensearch-maintenance" if xSubcommand { handlerPath = "x " + handlerPath } @@ -4880,13 +4999,13 @@ func XCreateDbaasPgConnectionPool(paramServiceName string, params *viper.Viper, server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-postgres/{service-name}/connection-pool" - url = strings.Replace(url, "{service-name}", paramServiceName, 1) + url := server + "/dbaas-opensearch/{name}/maintenance/start" + url = strings.Replace(url, "{name}", paramName, 1) - req := cli.Client.Post().URL(url) + req := cli.Client.Put().URL(url) if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) + req = req.AddHeader("Content-Type", "").BodyString(body) } cli.HandleBefore(handlerPath, params, req) @@ -4914,9 +5033,9 @@ func XCreateDbaasPgConnectionPool(paramServiceName string, params *viper.Viper, return resp, decoded, nil } -// XDeleteDbaasPgConnectionPool Delete a DBaaS PostgreSQL connection pool -func XDeleteDbaasPgConnectionPool(paramServiceName string, paramConnectionPoolName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-dbaas-pg-connection-pool" +// XCreateDbaasOpensearchUser Create a DBaaS OpenSearch user +func XCreateDbaasOpensearchUser(paramServiceName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-dbaas-opensearch-user" if xSubcommand { handlerPath = "x " + handlerPath } @@ -4926,11 +5045,14 @@ func XDeleteDbaasPgConnectionPool(paramServiceName string, paramConnectionPoolNa server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-postgres/{service-name}/connection-pool/{connection-pool-name}" + url := server + "/dbaas-opensearch/{service-name}/user" url = strings.Replace(url, "{service-name}", paramServiceName, 1) - url = strings.Replace(url, "{connection-pool-name}", paramConnectionPoolName, 1) - req := cli.Client.Delete().URL(url) + req := cli.Client.Post().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -4957,9 +5079,9 @@ func XDeleteDbaasPgConnectionPool(paramServiceName string, paramConnectionPoolNa return resp, decoded, nil } -// XUpdateDbaasPgConnectionPool Update a DBaaS PostgreSQL connection pool -func XUpdateDbaasPgConnectionPool(paramServiceName string, paramConnectionPoolName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "update-dbaas-pg-connection-pool" +// XDeleteDbaasOpensearchUser Delete a DBaaS OpenSearch user +func XDeleteDbaasOpensearchUser(paramServiceName string, paramUsername string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-dbaas-opensearch-user" if xSubcommand { handlerPath = "x " + handlerPath } @@ -4969,15 +5091,11 @@ func XUpdateDbaasPgConnectionPool(paramServiceName string, paramConnectionPoolNa server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-postgres/{service-name}/connection-pool/{connection-pool-name}" + url := server + "/dbaas-opensearch/{service-name}/user/{username}" url = strings.Replace(url, "{service-name}", paramServiceName, 1) - url = strings.Replace(url, "{connection-pool-name}", paramConnectionPoolName, 1) - - req := cli.Client.Put().URL(url) + url = strings.Replace(url, "{username}", paramUsername, 1) - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -5004,9 +5122,9 @@ func XUpdateDbaasPgConnectionPool(paramServiceName string, paramConnectionPoolNa return resp, decoded, nil } -// XCreateDbaasPgDatabase Create a DBaaS Postgres database -func XCreateDbaasPgDatabase(paramServiceName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-dbaas-pg-database" +// XResetDbaasOpensearchUserPassword Reset the credentials of a DBaaS OpenSearch user +func XResetDbaasOpensearchUserPassword(paramServiceName string, paramUsername string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "reset-dbaas-opensearch-user-password" if xSubcommand { handlerPath = "x " + handlerPath } @@ -5016,10 +5134,11 @@ func XCreateDbaasPgDatabase(paramServiceName string, params *viper.Viper, body s server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-postgres/{service-name}/database" + url := server + "/dbaas-opensearch/{service-name}/user/{username}/password/reset" url = strings.Replace(url, "{service-name}", paramServiceName, 1) + url = strings.Replace(url, "{username}", paramUsername, 1) - req := cli.Client.Post().URL(url) + req := cli.Client.Put().URL(url) if body != "" { req = req.AddHeader("Content-Type", "application/json").BodyString(body) @@ -5050,9 +5169,9 @@ func XCreateDbaasPgDatabase(paramServiceName string, params *viper.Viper, body s return resp, decoded, nil } -// XDeleteDbaasPgDatabase Delete a DBaaS Postgres database -func XDeleteDbaasPgDatabase(paramServiceName string, paramDatabaseName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-dbaas-pg-database" +// XRevealDbaasOpensearchUserPassword Reveal the secrets of a DBaaS OpenSearch user +func XRevealDbaasOpensearchUserPassword(paramServiceName string, paramUsername string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "reveal-dbaas-opensearch-user-password" if xSubcommand { handlerPath = "x " + handlerPath } @@ -5062,11 +5181,11 @@ func XDeleteDbaasPgDatabase(paramServiceName string, paramDatabaseName string, p server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-postgres/{service-name}/database/{database-name}" + url := server + "/dbaas-opensearch/{service-name}/user/{username}/password/reveal" url = strings.Replace(url, "{service-name}", paramServiceName, 1) - url = strings.Replace(url, "{database-name}", paramDatabaseName, 1) + url = strings.Replace(url, "{username}", paramUsername, 1) - req := cli.Client.Delete().URL(url) + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -5093,9 +5212,9 @@ func XDeleteDbaasPgDatabase(paramServiceName string, paramDatabaseName string, p return resp, decoded, nil } -// XCreateDbaasPostgresUser Create a DBaaS Postgres user -func XCreateDbaasPostgresUser(paramServiceName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-dbaas-postgres-user" +// XCreateDbaasServicePg Create a DBaaS PostgreSQL service +func XCreateDbaasServicePg(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-dbaas-service-pg" if xSubcommand { handlerPath = "x " + handlerPath } @@ -5105,8 +5224,8 @@ func XCreateDbaasPostgresUser(paramServiceName string, params *viper.Viper, body server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-postgres/{service-name}/user" - url = strings.Replace(url, "{service-name}", paramServiceName, 1) + url := server + "/dbaas-postgres/{name}" + url = strings.Replace(url, "{name}", paramName, 1) req := cli.Client.Post().URL(url) @@ -5139,9 +5258,9 @@ func XCreateDbaasPostgresUser(paramServiceName string, params *viper.Viper, body return resp, decoded, nil } -// XDeleteDbaasPostgresUser Delete a DBaaS Postgres user -func XDeleteDbaasPostgresUser(paramServiceName string, paramUsername string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-dbaas-postgres-user" +// XDeleteDbaasServicePg Delete a Postgres service +func XDeleteDbaasServicePg(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-dbaas-service-pg" if xSubcommand { handlerPath = "x " + handlerPath } @@ -5151,9 +5270,8 @@ func XDeleteDbaasPostgresUser(paramServiceName string, paramUsername string, par server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-postgres/{service-name}/user/{username}" - url = strings.Replace(url, "{service-name}", paramServiceName, 1) - url = strings.Replace(url, "{username}", paramUsername, 1) + url := server + "/dbaas-postgres/{name}" + url = strings.Replace(url, "{name}", paramName, 1) req := cli.Client.Delete().URL(url) @@ -5182,9 +5300,9 @@ func XDeleteDbaasPostgresUser(paramServiceName string, paramUsername string, par return resp, decoded, nil } -// XUpdateDbaasPostgresAllowReplication Update access control for one service user -func XUpdateDbaasPostgresAllowReplication(paramServiceName string, paramUsername string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "update-dbaas-postgres-allow-replication" +// XGetDbaasServicePg Get a DBaaS PostgreSQL service +func XGetDbaasServicePg(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dbaas-service-pg" if xSubcommand { handlerPath = "x " + handlerPath } @@ -5194,15 +5312,10 @@ func XUpdateDbaasPostgresAllowReplication(paramServiceName string, paramUsername server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-postgres/{service-name}/user/{username}/allow-replication" - url = strings.Replace(url, "{service-name}", paramServiceName, 1) - url = strings.Replace(url, "{username}", paramUsername, 1) - - req := cli.Client.Put().URL(url) + url := server + "/dbaas-postgres/{name}" + url = strings.Replace(url, "{name}", paramName, 1) - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -5229,9 +5342,9 @@ func XUpdateDbaasPostgresAllowReplication(paramServiceName string, paramUsername return resp, decoded, nil } -// XResetDbaasPostgresUserPassword Reset the credentials of a DBaaS Postgres user -func XResetDbaasPostgresUserPassword(paramServiceName string, paramUsername string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "reset-dbaas-postgres-user-password" +// XUpdateDbaasServicePg Update a DBaaS PostgreSQL service +func XUpdateDbaasServicePg(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-dbaas-service-pg" if xSubcommand { handlerPath = "x " + handlerPath } @@ -5241,9 +5354,8 @@ func XResetDbaasPostgresUserPassword(paramServiceName string, paramUsername stri server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-postgres/{service-name}/user/{username}/password/reset" - url = strings.Replace(url, "{service-name}", paramServiceName, 1) - url = strings.Replace(url, "{username}", paramUsername, 1) + url := server + "/dbaas-postgres/{name}" + url = strings.Replace(url, "{name}", paramName, 1) req := cli.Client.Put().URL(url) @@ -5276,9 +5388,9 @@ func XResetDbaasPostgresUserPassword(paramServiceName string, paramUsername stri return resp, decoded, nil } -// XRevealDbaasPostgresUserPassword Reveal the secrets of a DBaaS Postgres user -func XRevealDbaasPostgresUserPassword(paramServiceName string, paramUsername string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "reveal-dbaas-postgres-user-password" +// XStartDbaasPgMaintenance Initiate PostgreSQL maintenance update +func XStartDbaasPgMaintenance(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "start-dbaas-pg-maintenance" if xSubcommand { handlerPath = "x " + handlerPath } @@ -5288,11 +5400,14 @@ func XRevealDbaasPostgresUserPassword(paramServiceName string, paramUsername str server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-postgres/{service-name}/user/{username}/password/reveal" - url = strings.Replace(url, "{service-name}", paramServiceName, 1) - url = strings.Replace(url, "{username}", paramUsername, 1) + url := server + "/dbaas-postgres/{name}/maintenance/start" + url = strings.Replace(url, "{name}", paramName, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Put().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -5319,9 +5434,9 @@ func XRevealDbaasPostgresUserPassword(paramServiceName string, paramUsername str return resp, decoded, nil } -// XCreateDbaasPgUpgradeCheck create-dbaas-pg-upgrade-check -func XCreateDbaasPgUpgradeCheck(paramService string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-dbaas-pg-upgrade-check" +// XStopDbaasPgMigration Stop a DBaaS PostgreSQL migration +func XStopDbaasPgMigration(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "stop-dbaas-pg-migration" if xSubcommand { handlerPath = "x " + handlerPath } @@ -5331,13 +5446,13 @@ func XCreateDbaasPgUpgradeCheck(paramService string, params *viper.Viper, body s server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-postgres/{service}/upgrade-check" - url = strings.Replace(url, "{service}", paramService, 1) + url := server + "/dbaas-postgres/{name}/migration/stop" + url = strings.Replace(url, "{name}", paramName, 1) req := cli.Client.Post().URL(url) if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) + req = req.AddHeader("Content-Type", "").BodyString(body) } cli.HandleBefore(handlerPath, params, req) @@ -5365,9 +5480,9 @@ func XCreateDbaasPgUpgradeCheck(paramService string, params *viper.Viper, body s return resp, decoded, nil } -// XListDbaasServices List DBaaS services -func XListDbaasServices(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "list-dbaas-services" +// XCreateDbaasPgConnectionPool Create a DBaaS PostgreSQL connection pool +func XCreateDbaasPgConnectionPool(paramServiceName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-dbaas-pg-connection-pool" if xSubcommand { handlerPath = "x " + handlerPath } @@ -5377,9 +5492,14 @@ func XListDbaasServices(params *viper.Viper) (*gentleman.Response, map[string]in server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-service" + url := server + "/dbaas-postgres/{service-name}/connection-pool" + url = strings.Replace(url, "{service-name}", paramServiceName, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Post().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -5406,9 +5526,9 @@ func XListDbaasServices(params *viper.Viper) (*gentleman.Response, map[string]in return resp, decoded, nil } -// XGetDbaasServiceLogs Get logs of DBaaS service -func XGetDbaasServiceLogs(paramServiceName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-dbaas-service-logs" +// XDeleteDbaasPgConnectionPool Delete a DBaaS PostgreSQL connection pool +func XDeleteDbaasPgConnectionPool(paramServiceName string, paramConnectionPoolName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-dbaas-pg-connection-pool" if xSubcommand { handlerPath = "x " + handlerPath } @@ -5418,14 +5538,11 @@ func XGetDbaasServiceLogs(paramServiceName string, params *viper.Viper, body str server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-service-logs/{service-name}" + url := server + "/dbaas-postgres/{service-name}/connection-pool/{connection-pool-name}" url = strings.Replace(url, "{service-name}", paramServiceName, 1) + url = strings.Replace(url, "{connection-pool-name}", paramConnectionPoolName, 1) - req := cli.Client.Post().URL(url) - - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -5452,9 +5569,9 @@ func XGetDbaasServiceLogs(paramServiceName string, params *viper.Viper, body str return resp, decoded, nil } -// XGetDbaasServiceMetrics Get metrics of DBaaS service -func XGetDbaasServiceMetrics(paramServiceName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-dbaas-service-metrics" +// XUpdateDbaasPgConnectionPool Update a DBaaS PostgreSQL connection pool +func XUpdateDbaasPgConnectionPool(paramServiceName string, paramConnectionPoolName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-dbaas-pg-connection-pool" if xSubcommand { handlerPath = "x " + handlerPath } @@ -5464,10 +5581,11 @@ func XGetDbaasServiceMetrics(paramServiceName string, params *viper.Viper, body server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-service-metrics/{service-name}" + url := server + "/dbaas-postgres/{service-name}/connection-pool/{connection-pool-name}" url = strings.Replace(url, "{service-name}", paramServiceName, 1) + url = strings.Replace(url, "{connection-pool-name}", paramConnectionPoolName, 1) - req := cli.Client.Post().URL(url) + req := cli.Client.Put().URL(url) if body != "" { req = req.AddHeader("Content-Type", "application/json").BodyString(body) @@ -5498,9 +5616,9 @@ func XGetDbaasServiceMetrics(paramServiceName string, params *viper.Viper, body return resp, decoded, nil } -// XListDbaasServiceTypes DBaaS Service Types -func XListDbaasServiceTypes(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "list-dbaas-service-types" +// XCreateDbaasPgDatabase Create a DBaaS Postgres database +func XCreateDbaasPgDatabase(paramServiceName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-dbaas-pg-database" if xSubcommand { handlerPath = "x " + handlerPath } @@ -5510,9 +5628,14 @@ func XListDbaasServiceTypes(params *viper.Viper) (*gentleman.Response, map[strin server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-service-type" + url := server + "/dbaas-postgres/{service-name}/database" + url = strings.Replace(url, "{service-name}", paramServiceName, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Post().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -5539,9 +5662,9 @@ func XListDbaasServiceTypes(params *viper.Viper) (*gentleman.Response, map[strin return resp, decoded, nil } -// XGetDbaasServiceType Get a DBaaS service type -func XGetDbaasServiceType(paramServiceTypeName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-dbaas-service-type" +// XDeleteDbaasPgDatabase Delete a DBaaS Postgres database +func XDeleteDbaasPgDatabase(paramServiceName string, paramDatabaseName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-dbaas-pg-database" if xSubcommand { handlerPath = "x " + handlerPath } @@ -5551,10 +5674,11 @@ func XGetDbaasServiceType(paramServiceTypeName string, params *viper.Viper) (*ge server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-service-type/{service-type-name}" - url = strings.Replace(url, "{service-type-name}", paramServiceTypeName, 1) + url := server + "/dbaas-postgres/{service-name}/database/{database-name}" + url = strings.Replace(url, "{service-name}", paramServiceName, 1) + url = strings.Replace(url, "{database-name}", paramDatabaseName, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -5581,9 +5705,9 @@ func XGetDbaasServiceType(paramServiceTypeName string, params *viper.Viper) (*ge return resp, decoded, nil } -// XDeleteDbaasService Delete a DBaaS service -func XDeleteDbaasService(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-dbaas-service" +// XCreateDbaasPostgresUser Create a DBaaS Postgres user +func XCreateDbaasPostgresUser(paramServiceName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-dbaas-postgres-user" if xSubcommand { handlerPath = "x " + handlerPath } @@ -5593,10 +5717,14 @@ func XDeleteDbaasService(paramName string, params *viper.Viper) (*gentleman.Resp server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-service/{name}" - url = strings.Replace(url, "{name}", paramName, 1) + url := server + "/dbaas-postgres/{service-name}/user" + url = strings.Replace(url, "{service-name}", paramServiceName, 1) - req := cli.Client.Delete().URL(url) + req := cli.Client.Post().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -5623,9 +5751,9 @@ func XDeleteDbaasService(paramName string, params *viper.Viper) (*gentleman.Resp return resp, decoded, nil } -// XGetDbaasSettingsGrafana Get DBaaS Grafana settings -func XGetDbaasSettingsGrafana(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-dbaas-settings-grafana" +// XDeleteDbaasPostgresUser Delete a DBaaS Postgres user +func XDeleteDbaasPostgresUser(paramServiceName string, paramUsername string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-dbaas-postgres-user" if xSubcommand { handlerPath = "x " + handlerPath } @@ -5635,9 +5763,11 @@ func XGetDbaasSettingsGrafana(params *viper.Viper) (*gentleman.Response, map[str server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-settings-grafana" + url := server + "/dbaas-postgres/{service-name}/user/{username}" + url = strings.Replace(url, "{service-name}", paramServiceName, 1) + url = strings.Replace(url, "{username}", paramUsername, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -5664,9 +5794,9 @@ func XGetDbaasSettingsGrafana(params *viper.Viper) (*gentleman.Response, map[str return resp, decoded, nil } -// XGetDbaasSettingsKafka Get DBaaS Kafka settings -func XGetDbaasSettingsKafka(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-dbaas-settings-kafka" +// XUpdateDbaasPostgresAllowReplication Update access control for one service user +func XUpdateDbaasPostgresAllowReplication(paramServiceName string, paramUsername string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-dbaas-postgres-allow-replication" if xSubcommand { handlerPath = "x " + handlerPath } @@ -5676,9 +5806,15 @@ func XGetDbaasSettingsKafka(params *viper.Viper) (*gentleman.Response, map[strin server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-settings-kafka" + url := server + "/dbaas-postgres/{service-name}/user/{username}/allow-replication" + url = strings.Replace(url, "{service-name}", paramServiceName, 1) + url = strings.Replace(url, "{username}", paramUsername, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Put().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -5705,9 +5841,9 @@ func XGetDbaasSettingsKafka(params *viper.Viper) (*gentleman.Response, map[strin return resp, decoded, nil } -// XGetDbaasSettingsMysql Get DBaaS MySQL settings -func XGetDbaasSettingsMysql(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-dbaas-settings-mysql" +// XResetDbaasPostgresUserPassword Reset the credentials of a DBaaS Postgres user +func XResetDbaasPostgresUserPassword(paramServiceName string, paramUsername string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "reset-dbaas-postgres-user-password" if xSubcommand { handlerPath = "x " + handlerPath } @@ -5717,9 +5853,15 @@ func XGetDbaasSettingsMysql(params *viper.Viper) (*gentleman.Response, map[strin server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-settings-mysql" + url := server + "/dbaas-postgres/{service-name}/user/{username}/password/reset" + url = strings.Replace(url, "{service-name}", paramServiceName, 1) + url = strings.Replace(url, "{username}", paramUsername, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Put().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -5746,9 +5888,9 @@ func XGetDbaasSettingsMysql(params *viper.Viper) (*gentleman.Response, map[strin return resp, decoded, nil } -// XGetDbaasSettingsOpensearch Get DBaaS OpenSearch settings -func XGetDbaasSettingsOpensearch(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-dbaas-settings-opensearch" +// XRevealDbaasPostgresUserPassword Reveal the secrets of a DBaaS Postgres user +func XRevealDbaasPostgresUserPassword(paramServiceName string, paramUsername string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "reveal-dbaas-postgres-user-password" if xSubcommand { handlerPath = "x " + handlerPath } @@ -5758,7 +5900,9 @@ func XGetDbaasSettingsOpensearch(params *viper.Viper) (*gentleman.Response, map[ server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-settings-opensearch" + url := server + "/dbaas-postgres/{service-name}/user/{username}/password/reveal" + url = strings.Replace(url, "{service-name}", paramServiceName, 1) + url = strings.Replace(url, "{username}", paramUsername, 1) req := cli.Client.Get().URL(url) @@ -5787,9 +5931,9 @@ func XGetDbaasSettingsOpensearch(params *viper.Viper) (*gentleman.Response, map[ return resp, decoded, nil } -// XGetDbaasSettingsPg Get DBaaS PostgreSQL settings -func XGetDbaasSettingsPg(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-dbaas-settings-pg" +// XCreateDbaasPgUpgradeCheck create-dbaas-pg-upgrade-check +func XCreateDbaasPgUpgradeCheck(paramService string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-dbaas-pg-upgrade-check" if xSubcommand { handlerPath = "x " + handlerPath } @@ -5799,9 +5943,14 @@ func XGetDbaasSettingsPg(params *viper.Viper) (*gentleman.Response, map[string]i server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-settings-pg" + url := server + "/dbaas-postgres/{service}/upgrade-check" + url = strings.Replace(url, "{service}", paramService, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Post().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -5828,9 +5977,9 @@ func XGetDbaasSettingsPg(params *viper.Viper) (*gentleman.Response, map[string]i return resp, decoded, nil } -// XGetDbaasSettingsValkey Get DBaaS Valkey settings -func XGetDbaasSettingsValkey(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-dbaas-settings-valkey" +// XListDbaasServices List DBaaS services +func XListDbaasServices(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-dbaas-services" if xSubcommand { handlerPath = "x " + handlerPath } @@ -5840,7 +5989,7 @@ func XGetDbaasSettingsValkey(params *viper.Viper) (*gentleman.Response, map[stri server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-settings-valkey" + url := server + "/dbaas-service" req := cli.Client.Get().URL(url) @@ -5869,9 +6018,9 @@ func XGetDbaasSettingsValkey(params *viper.Viper) (*gentleman.Response, map[stri return resp, decoded, nil } -// XCreateDbaasTaskMigrationCheck create-dbaas-task-migration-check -func XCreateDbaasTaskMigrationCheck(paramService string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-dbaas-task-migration-check" +// XGetDbaasServiceLogs Get logs of DBaaS service +func XGetDbaasServiceLogs(paramServiceName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dbaas-service-logs" if xSubcommand { handlerPath = "x " + handlerPath } @@ -5881,8 +6030,8 @@ func XCreateDbaasTaskMigrationCheck(paramService string, params *viper.Viper, bo server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-task-migration-check/{service}" - url = strings.Replace(url, "{service}", paramService, 1) + url := server + "/dbaas-service-logs/{service-name}" + url = strings.Replace(url, "{service-name}", paramServiceName, 1) req := cli.Client.Post().URL(url) @@ -5915,9 +6064,9 @@ func XCreateDbaasTaskMigrationCheck(paramService string, params *viper.Viper, bo return resp, decoded, nil } -// XGetDbaasTask Get a DBaaS task -func XGetDbaasTask(paramService string, paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-dbaas-task" +// XGetDbaasServiceMetrics Get metrics of DBaaS service +func XGetDbaasServiceMetrics(paramServiceName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dbaas-service-metrics" if xSubcommand { handlerPath = "x " + handlerPath } @@ -5927,11 +6076,14 @@ func XGetDbaasTask(paramService string, paramId string, params *viper.Viper) (*g server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-task/{service}/{id}" - url = strings.Replace(url, "{service}", paramService, 1) - url = strings.Replace(url, "{id}", paramId, 1) + url := server + "/dbaas-service-metrics/{service-name}" + url = strings.Replace(url, "{service-name}", paramServiceName, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Post().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -5958,9 +6110,9 @@ func XGetDbaasTask(paramService string, paramId string, params *viper.Viper) (*g return resp, decoded, nil } -// XCreateDbaasServiceValkey Create a DBaaS Valkey service -func XCreateDbaasServiceValkey(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-dbaas-service-valkey" +// XListDbaasServiceTypes DBaaS Service Types +func XListDbaasServiceTypes(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-dbaas-service-types" if xSubcommand { handlerPath = "x " + handlerPath } @@ -5970,14 +6122,9 @@ func XCreateDbaasServiceValkey(paramName string, params *viper.Viper, body strin server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-valkey/{name}" - url = strings.Replace(url, "{name}", paramName, 1) - - req := cli.Client.Post().URL(url) + url := server + "/dbaas-service-type" - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -6004,9 +6151,9 @@ func XCreateDbaasServiceValkey(paramName string, params *viper.Viper, body strin return resp, decoded, nil } -// XDeleteDbaasServiceValkey Delete a Valkey service -func XDeleteDbaasServiceValkey(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-dbaas-service-valkey" +// XGetDbaasServiceType Get a DBaaS service type +func XGetDbaasServiceType(paramServiceTypeName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dbaas-service-type" if xSubcommand { handlerPath = "x " + handlerPath } @@ -6016,10 +6163,10 @@ func XDeleteDbaasServiceValkey(paramName string, params *viper.Viper) (*gentlema server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-valkey/{name}" - url = strings.Replace(url, "{name}", paramName, 1) + url := server + "/dbaas-service-type/{service-type-name}" + url = strings.Replace(url, "{service-type-name}", paramServiceTypeName, 1) - req := cli.Client.Delete().URL(url) + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -6046,9 +6193,9 @@ func XDeleteDbaasServiceValkey(paramName string, params *viper.Viper) (*gentlema return resp, decoded, nil } -// XGetDbaasServiceValkey get-dbaas-service-valkey -func XGetDbaasServiceValkey(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-dbaas-service-valkey" +// XDeleteDbaasService Delete a DBaaS service +func XDeleteDbaasService(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-dbaas-service" if xSubcommand { handlerPath = "x " + handlerPath } @@ -6058,10 +6205,10 @@ func XGetDbaasServiceValkey(paramName string, params *viper.Viper) (*gentleman.R server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-valkey/{name}" + url := server + "/dbaas-service/{name}" url = strings.Replace(url, "{name}", paramName, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -6088,9 +6235,9 @@ func XGetDbaasServiceValkey(paramName string, params *viper.Viper) (*gentleman.R return resp, decoded, nil } -// XUpdateDbaasServiceValkey update-dbaas-service-valkey -func XUpdateDbaasServiceValkey(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "update-dbaas-service-valkey" +// XGetDbaasSettingsGrafana Get DBaaS Grafana settings +func XGetDbaasSettingsGrafana(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dbaas-settings-grafana" if xSubcommand { handlerPath = "x " + handlerPath } @@ -6100,14 +6247,9 @@ func XUpdateDbaasServiceValkey(paramName string, params *viper.Viper, body strin server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-valkey/{name}" - url = strings.Replace(url, "{name}", paramName, 1) + url := server + "/dbaas-settings-grafana" - req := cli.Client.Put().URL(url) - - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -6134,9 +6276,9 @@ func XUpdateDbaasServiceValkey(paramName string, params *viper.Viper, body strin return resp, decoded, nil } -// XStartDbaasValkeyMaintenance Initiate Valkey maintenance update -func XStartDbaasValkeyMaintenance(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "start-dbaas-valkey-maintenance" +// XGetDbaasSettingsKafka Get DBaaS Kafka settings +func XGetDbaasSettingsKafka(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dbaas-settings-kafka" if xSubcommand { handlerPath = "x " + handlerPath } @@ -6146,14 +6288,9 @@ func XStartDbaasValkeyMaintenance(paramName string, params *viper.Viper, body st server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-valkey/{name}/maintenance/start" - url = strings.Replace(url, "{name}", paramName, 1) - - req := cli.Client.Put().URL(url) + url := server + "/dbaas-settings-kafka" - if body != "" { - req = req.AddHeader("Content-Type", "").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -6180,9 +6317,9 @@ func XStartDbaasValkeyMaintenance(paramName string, params *viper.Viper, body st return resp, decoded, nil } -// XStopDbaasValkeyMigration Stop a DBaaS Valkey migration -func XStopDbaasValkeyMigration(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "stop-dbaas-valkey-migration" +// XGetDbaasSettingsMysql Get DBaaS MySQL settings +func XGetDbaasSettingsMysql(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dbaas-settings-mysql" if xSubcommand { handlerPath = "x " + handlerPath } @@ -6192,14 +6329,9 @@ func XStopDbaasValkeyMigration(paramName string, params *viper.Viper, body strin server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-valkey/{name}/migration/stop" - url = strings.Replace(url, "{name}", paramName, 1) - - req := cli.Client.Post().URL(url) + url := server + "/dbaas-settings-mysql" - if body != "" { - req = req.AddHeader("Content-Type", "").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -6226,9 +6358,9 @@ func XStopDbaasValkeyMigration(paramName string, params *viper.Viper, body strin return resp, decoded, nil } -// XCreateDbaasValkeyUser Create a DBaaS Valkey user -func XCreateDbaasValkeyUser(paramServiceName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-dbaas-valkey-user" +// XGetDbaasSettingsOpensearch Get DBaaS OpenSearch settings +func XGetDbaasSettingsOpensearch(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dbaas-settings-opensearch" if xSubcommand { handlerPath = "x " + handlerPath } @@ -6238,14 +6370,9 @@ func XCreateDbaasValkeyUser(paramServiceName string, params *viper.Viper, body s server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-valkey/{service-name}/user" - url = strings.Replace(url, "{service-name}", paramServiceName, 1) - - req := cli.Client.Post().URL(url) + url := server + "/dbaas-settings-opensearch" - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -6272,9 +6399,9 @@ func XCreateDbaasValkeyUser(paramServiceName string, params *viper.Viper, body s return resp, decoded, nil } -// XDeleteDbaasValkeyUser Delete a DBaaS Valkey user -func XDeleteDbaasValkeyUser(paramServiceName string, paramUsername string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-dbaas-valkey-user" +// XGetDbaasSettingsPg Get DBaaS PostgreSQL settings +func XGetDbaasSettingsPg(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dbaas-settings-pg" if xSubcommand { handlerPath = "x " + handlerPath } @@ -6284,11 +6411,9 @@ func XDeleteDbaasValkeyUser(paramServiceName string, paramUsername string, param server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-valkey/{service-name}/user/{username}" - url = strings.Replace(url, "{service-name}", paramServiceName, 1) - url = strings.Replace(url, "{username}", paramUsername, 1) + url := server + "/dbaas-settings-pg" - req := cli.Client.Delete().URL(url) + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -6315,9 +6440,9 @@ func XDeleteDbaasValkeyUser(paramServiceName string, paramUsername string, param return resp, decoded, nil } -// XResetDbaasValkeyUserPassword Reset the credentials of a DBaaS Valkey user -func XResetDbaasValkeyUserPassword(paramServiceName string, paramUsername string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "reset-dbaas-valkey-user-password" +// XGetDbaasSettingsThanos Get DBaaS Thanos settings +func XGetDbaasSettingsThanos(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dbaas-settings-thanos" if xSubcommand { handlerPath = "x " + handlerPath } @@ -6327,15 +6452,9 @@ func XResetDbaasValkeyUserPassword(paramServiceName string, paramUsername string server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-valkey/{service-name}/user/{username}/password/reset" - url = strings.Replace(url, "{service-name}", paramServiceName, 1) - url = strings.Replace(url, "{username}", paramUsername, 1) - - req := cli.Client.Put().URL(url) + url := server + "/dbaas-settings-thanos" - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -6362,9 +6481,9 @@ func XResetDbaasValkeyUserPassword(paramServiceName string, paramUsername string return resp, decoded, nil } -// XRevealDbaasValkeyUserPassword Reveal the secrets of a DBaaS Valkey user -func XRevealDbaasValkeyUserPassword(paramServiceName string, paramUsername string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "reveal-dbaas-valkey-user-password" +// XGetDbaasSettingsValkey Get DBaaS Valkey settings +func XGetDbaasSettingsValkey(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dbaas-settings-valkey" if xSubcommand { handlerPath = "x " + handlerPath } @@ -6374,9 +6493,7 @@ func XRevealDbaasValkeyUserPassword(paramServiceName string, paramUsername strin server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-valkey/{service-name}/user/{username}/password/reveal" - url = strings.Replace(url, "{service-name}", paramServiceName, 1) - url = strings.Replace(url, "{username}", paramUsername, 1) + url := server + "/dbaas-settings-valkey" req := cli.Client.Get().URL(url) @@ -6405,9 +6522,9 @@ func XRevealDbaasValkeyUserPassword(paramServiceName string, paramUsername strin return resp, decoded, nil } -// XListDeployTargets List Deploy Targets -func XListDeployTargets(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "list-deploy-targets" +// XCreateDbaasTaskMigrationCheck create-dbaas-task-migration-check +func XCreateDbaasTaskMigrationCheck(paramService string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-dbaas-task-migration-check" if xSubcommand { handlerPath = "x " + handlerPath } @@ -6417,9 +6534,14 @@ func XListDeployTargets(params *viper.Viper) (*gentleman.Response, map[string]in server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/deploy-target" + url := server + "/dbaas-task-migration-check/{service}" + url = strings.Replace(url, "{service}", paramService, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Post().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -6446,9 +6568,9 @@ func XListDeployTargets(params *viper.Viper) (*gentleman.Response, map[string]in return resp, decoded, nil } -// XGetDeployTarget Retrieve Deploy Target details -func XGetDeployTarget(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-deploy-target" +// XGetDbaasTask Get a DBaaS task +func XGetDbaasTask(paramService string, paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dbaas-task" if xSubcommand { handlerPath = "x " + handlerPath } @@ -6458,7 +6580,8 @@ func XGetDeployTarget(paramId string, params *viper.Viper) (*gentleman.Response, server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/deploy-target/{id}" + url := server + "/dbaas-task/{service}/{id}" + url = strings.Replace(url, "{service}", paramService, 1) url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Get().URL(url) @@ -6488,9 +6611,9 @@ func XGetDeployTarget(paramId string, params *viper.Viper) (*gentleman.Response, return resp, decoded, nil } -// XCreateDnsDomain Create DNS domain -func XCreateDnsDomain(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-dns-domain" +// XCreateDbaasServiceThanos Create a DBaaS Thanos service +func XCreateDbaasServiceThanos(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-dbaas-service-thanos" if xSubcommand { handlerPath = "x " + handlerPath } @@ -6500,7 +6623,8 @@ func XCreateDnsDomain(params *viper.Viper, body string) (*gentleman.Response, ma server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dns-domain" + url := server + "/dbaas-thanos/{name}" + url = strings.Replace(url, "{name}", paramName, 1) req := cli.Client.Post().URL(url) @@ -6533,9 +6657,9 @@ func XCreateDnsDomain(params *viper.Viper, body string) (*gentleman.Response, ma return resp, decoded, nil } -// XListDnsDomains List DNS domains -func XListDnsDomains(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "list-dns-domains" +// XDeleteDbaasServiceThanos Delete a Thanos service +func XDeleteDbaasServiceThanos(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-dbaas-service-thanos" if xSubcommand { handlerPath = "x " + handlerPath } @@ -6545,9 +6669,10 @@ func XListDnsDomains(params *viper.Viper) (*gentleman.Response, map[string]inter server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dns-domain" + url := server + "/dbaas-thanos/{name}" + url = strings.Replace(url, "{name}", paramName, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -6574,9 +6699,9 @@ func XListDnsDomains(params *viper.Viper) (*gentleman.Response, map[string]inter return resp, decoded, nil } -// XCreateDnsDomainRecord Create DNS domain record -func XCreateDnsDomainRecord(paramDomainId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-dns-domain-record" +// XGetDbaasServiceThanos get-dbaas-service-thanos +func XGetDbaasServiceThanos(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dbaas-service-thanos" if xSubcommand { handlerPath = "x " + handlerPath } @@ -6586,14 +6711,10 @@ func XCreateDnsDomainRecord(paramDomainId string, params *viper.Viper, body stri server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dns-domain/{domain-id}/record" - url = strings.Replace(url, "{domain-id}", paramDomainId, 1) - - req := cli.Client.Post().URL(url) + url := server + "/dbaas-thanos/{name}" + url = strings.Replace(url, "{name}", paramName, 1) - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -6620,9 +6741,9 @@ func XCreateDnsDomainRecord(paramDomainId string, params *viper.Viper, body stri return resp, decoded, nil } -// XListDnsDomainRecords List DNS domain records -func XListDnsDomainRecords(paramDomainId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "list-dns-domain-records" +// XUpdateDbaasServiceThanos update-dbaas-service-thanos +func XUpdateDbaasServiceThanos(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-dbaas-service-thanos" if xSubcommand { handlerPath = "x " + handlerPath } @@ -6632,10 +6753,14 @@ func XListDnsDomainRecords(paramDomainId string, params *viper.Viper) (*gentlema server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dns-domain/{domain-id}/record" - url = strings.Replace(url, "{domain-id}", paramDomainId, 1) + url := server + "/dbaas-thanos/{name}" + url = strings.Replace(url, "{name}", paramName, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Put().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -6662,9 +6787,9 @@ func XListDnsDomainRecords(paramDomainId string, params *viper.Viper) (*gentlema return resp, decoded, nil } -// XDeleteDnsDomainRecord Delete DNS domain record -func XDeleteDnsDomainRecord(paramDomainId string, paramRecordId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-dns-domain-record" +// XStartDbaasThanosMaintenance Initiate Thanos maintenance update +func XStartDbaasThanosMaintenance(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "start-dbaas-thanos-maintenance" if xSubcommand { handlerPath = "x " + handlerPath } @@ -6674,11 +6799,14 @@ func XDeleteDnsDomainRecord(paramDomainId string, paramRecordId string, params * server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dns-domain/{domain-id}/record/{record-id}" - url = strings.Replace(url, "{domain-id}", paramDomainId, 1) - url = strings.Replace(url, "{record-id}", paramRecordId, 1) + url := server + "/dbaas-thanos/{name}/maintenance/start" + url = strings.Replace(url, "{name}", paramName, 1) - req := cli.Client.Delete().URL(url) + req := cli.Client.Put().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -6705,9 +6833,9 @@ func XDeleteDnsDomainRecord(paramDomainId string, paramRecordId string, params * return resp, decoded, nil } -// XGetDnsDomainRecord Retrieve DNS domain record details -func XGetDnsDomainRecord(paramDomainId string, paramRecordId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-dns-domain-record" +// XRevealDbaasThanosUserPassword Reveal the secrets of a DBaaS Thanos user +func XRevealDbaasThanosUserPassword(paramServiceName string, paramUsername string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "reveal-dbaas-thanos-user-password" if xSubcommand { handlerPath = "x " + handlerPath } @@ -6717,9 +6845,9 @@ func XGetDnsDomainRecord(paramDomainId string, paramRecordId string, params *vip server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dns-domain/{domain-id}/record/{record-id}" - url = strings.Replace(url, "{domain-id}", paramDomainId, 1) - url = strings.Replace(url, "{record-id}", paramRecordId, 1) + url := server + "/dbaas-thanos/{service-name}/user/{username}/password/reveal" + url = strings.Replace(url, "{service-name}", paramServiceName, 1) + url = strings.Replace(url, "{username}", paramUsername, 1) req := cli.Client.Get().URL(url) @@ -6748,9 +6876,9 @@ func XGetDnsDomainRecord(paramDomainId string, paramRecordId string, params *vip return resp, decoded, nil } -// XUpdateDnsDomainRecord Update DNS domain record -func XUpdateDnsDomainRecord(paramDomainId string, paramRecordId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "update-dns-domain-record" +// XCreateDbaasServiceValkey Create a DBaaS Valkey service +func XCreateDbaasServiceValkey(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-dbaas-service-valkey" if xSubcommand { handlerPath = "x " + handlerPath } @@ -6760,11 +6888,10 @@ func XUpdateDnsDomainRecord(paramDomainId string, paramRecordId string, params * server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dns-domain/{domain-id}/record/{record-id}" - url = strings.Replace(url, "{domain-id}", paramDomainId, 1) - url = strings.Replace(url, "{record-id}", paramRecordId, 1) + url := server + "/dbaas-valkey/{name}" + url = strings.Replace(url, "{name}", paramName, 1) - req := cli.Client.Put().URL(url) + req := cli.Client.Post().URL(url) if body != "" { req = req.AddHeader("Content-Type", "application/json").BodyString(body) @@ -6795,9 +6922,9 @@ func XUpdateDnsDomainRecord(paramDomainId string, paramRecordId string, params * return resp, decoded, nil } -// XDeleteDnsDomain Delete DNS Domain -func XDeleteDnsDomain(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-dns-domain" +// XDeleteDbaasServiceValkey Delete a Valkey service +func XDeleteDbaasServiceValkey(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-dbaas-service-valkey" if xSubcommand { handlerPath = "x " + handlerPath } @@ -6807,8 +6934,8 @@ func XDeleteDnsDomain(paramId string, params *viper.Viper) (*gentleman.Response, server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dns-domain/{id}" - url = strings.Replace(url, "{id}", paramId, 1) + url := server + "/dbaas-valkey/{name}" + url = strings.Replace(url, "{name}", paramName, 1) req := cli.Client.Delete().URL(url) @@ -6837,9 +6964,9 @@ func XDeleteDnsDomain(paramId string, params *viper.Viper) (*gentleman.Response, return resp, decoded, nil } -// XGetDnsDomain Retrieve DNS domain details -func XGetDnsDomain(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-dns-domain" +// XGetDbaasServiceValkey get-dbaas-service-valkey +func XGetDbaasServiceValkey(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dbaas-service-valkey" if xSubcommand { handlerPath = "x " + handlerPath } @@ -6849,8 +6976,8 @@ func XGetDnsDomain(paramId string, params *viper.Viper) (*gentleman.Response, ma server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dns-domain/{id}" - url = strings.Replace(url, "{id}", paramId, 1) + url := server + "/dbaas-valkey/{name}" + url = strings.Replace(url, "{name}", paramName, 1) req := cli.Client.Get().URL(url) @@ -6879,9 +7006,9 @@ func XGetDnsDomain(paramId string, params *viper.Viper) (*gentleman.Response, ma return resp, decoded, nil } -// XGetDnsDomainZoneFile Retrieve DNS domain zone file -func XGetDnsDomainZoneFile(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-dns-domain-zone-file" +// XUpdateDbaasServiceValkey update-dbaas-service-valkey +func XUpdateDbaasServiceValkey(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-dbaas-service-valkey" if xSubcommand { handlerPath = "x " + handlerPath } @@ -6891,10 +7018,14 @@ func XGetDnsDomainZoneFile(paramId string, params *viper.Viper) (*gentleman.Resp server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dns-domain/{id}/zone" - url = strings.Replace(url, "{id}", paramId, 1) + url := server + "/dbaas-valkey/{name}" + url = strings.Replace(url, "{name}", paramName, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Put().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -6921,9 +7052,9 @@ func XGetDnsDomainZoneFile(paramId string, params *viper.Viper) (*gentleman.Resp return resp, decoded, nil } -// XCreateElasticIp Create an Elastic IP -func XCreateElasticIp(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-elastic-ip" +// XStartDbaasValkeyMaintenance Initiate Valkey maintenance update +func XStartDbaasValkeyMaintenance(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "start-dbaas-valkey-maintenance" if xSubcommand { handlerPath = "x " + handlerPath } @@ -6933,12 +7064,13 @@ func XCreateElasticIp(params *viper.Viper, body string) (*gentleman.Response, ma server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/elastic-ip" + url := server + "/dbaas-valkey/{name}/maintenance/start" + url = strings.Replace(url, "{name}", paramName, 1) - req := cli.Client.Post().URL(url) + req := cli.Client.Put().URL(url) if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) + req = req.AddHeader("Content-Type", "").BodyString(body) } cli.HandleBefore(handlerPath, params, req) @@ -6966,9 +7098,9 @@ func XCreateElasticIp(params *viper.Viper, body string) (*gentleman.Response, ma return resp, decoded, nil } -// XListElasticIps List Elastic IPs -func XListElasticIps(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "list-elastic-ips" +// XStopDbaasValkeyMigration Stop a DBaaS Valkey migration +func XStopDbaasValkeyMigration(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "stop-dbaas-valkey-migration" if xSubcommand { handlerPath = "x " + handlerPath } @@ -6978,9 +7110,14 @@ func XListElasticIps(params *viper.Viper) (*gentleman.Response, map[string]inter server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/elastic-ip" + url := server + "/dbaas-valkey/{name}/migration/stop" + url = strings.Replace(url, "{name}", paramName, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Post().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -7007,9 +7144,9 @@ func XListElasticIps(params *viper.Viper) (*gentleman.Response, map[string]inter return resp, decoded, nil } -// XDeleteElasticIp Delete an Elastic IP -func XDeleteElasticIp(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-elastic-ip" +// XCreateDbaasValkeyUser Create a DBaaS Valkey user +func XCreateDbaasValkeyUser(paramServiceName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-dbaas-valkey-user" if xSubcommand { handlerPath = "x " + handlerPath } @@ -7019,10 +7156,14 @@ func XDeleteElasticIp(paramId string, params *viper.Viper) (*gentleman.Response, server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/elastic-ip/{id}" - url = strings.Replace(url, "{id}", paramId, 1) + url := server + "/dbaas-valkey/{service-name}/user" + url = strings.Replace(url, "{service-name}", paramServiceName, 1) - req := cli.Client.Delete().URL(url) + req := cli.Client.Post().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -7049,9 +7190,9 @@ func XDeleteElasticIp(paramId string, params *viper.Viper) (*gentleman.Response, return resp, decoded, nil } -// XGetElasticIp Retrieve Elastic IP details -func XGetElasticIp(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-elastic-ip" +// XListDbaasValkeyUsers List DBaaS Valkey users with ACL configuration +func XListDbaasValkeyUsers(paramServiceName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-dbaas-valkey-users" if xSubcommand { handlerPath = "x " + handlerPath } @@ -7061,8 +7202,8 @@ func XGetElasticIp(paramId string, params *viper.Viper) (*gentleman.Response, ma server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/elastic-ip/{id}" - url = strings.Replace(url, "{id}", paramId, 1) + url := server + "/dbaas-valkey/{service-name}/user" + url = strings.Replace(url, "{service-name}", paramServiceName, 1) req := cli.Client.Get().URL(url) @@ -7091,55 +7232,9 @@ func XGetElasticIp(paramId string, params *viper.Viper) (*gentleman.Response, ma return resp, decoded, nil } -// XUpdateElasticIp Update an Elastic IP -func XUpdateElasticIp(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "update-elastic-ip" - if xSubcommand { - handlerPath = "x " + handlerPath - } - - server := viper.GetString("server") - if server == "" { - server = xServers()[viper.GetInt("server-index")]["url"] - } - - url := server + "/elastic-ip/{id}" - url = strings.Replace(url, "{id}", paramId, 1) - - req := cli.Client.Put().URL(url) - - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } - - cli.HandleBefore(handlerPath, params, req) - - resp, err := req.Do() - if err != nil { - return nil, nil, errors.Wrap(err, "Request failed") - } - - var decoded map[string]interface{} - - if resp.StatusCode < 400 { - if err := cli.UnmarshalResponse(resp, &decoded); err != nil { - return nil, nil, errors.Wrap(err, "Unmarshalling response failed") - } - } else { - return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) - } - - after := cli.HandleAfter(handlerPath, params, resp, decoded) - if after != nil { - decoded = after.(map[string]interface{}) - } - - return resp, decoded, nil -} - -// XResetElasticIpField Reset an Elastic IP field to its default value -func XResetElasticIpField(paramId string, paramField string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "reset-elastic-ip-field" +// XDeleteDbaasValkeyUser Delete a DBaaS Valkey user +func XDeleteDbaasValkeyUser(paramServiceName string, paramUsername string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-dbaas-valkey-user" if xSubcommand { handlerPath = "x " + handlerPath } @@ -7149,9 +7244,9 @@ func XResetElasticIpField(paramId string, paramField string, params *viper.Viper server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/elastic-ip/{id}/{field}" - url = strings.Replace(url, "{id}", paramId, 1) - url = strings.Replace(url, "{field}", paramField, 1) + url := server + "/dbaas-valkey/{service-name}/user/{username}" + url = strings.Replace(url, "{service-name}", paramServiceName, 1) + url = strings.Replace(url, "{username}", paramUsername, 1) req := cli.Client.Delete().URL(url) @@ -7180,9 +7275,9 @@ func XResetElasticIpField(paramId string, paramField string, params *viper.Viper return resp, decoded, nil } -// XAttachInstanceToElasticIp Attach a Compute instance to an Elastic IP -func XAttachInstanceToElasticIp(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "attach-instance-to-elastic-ip" +// XUpdateDbaasValkeyUserAccessControl Update access control for one DBaaS Valkey service user +func XUpdateDbaasValkeyUserAccessControl(paramServiceName string, paramUsername string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-dbaas-valkey-user-access-control" if xSubcommand { handlerPath = "x " + handlerPath } @@ -7192,8 +7287,9 @@ func XAttachInstanceToElasticIp(paramId string, params *viper.Viper, body string server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/elastic-ip/{id}:attach" - url = strings.Replace(url, "{id}", paramId, 1) + url := server + "/dbaas-valkey/{service-name}/user/{username}" + url = strings.Replace(url, "{service-name}", paramServiceName, 1) + url = strings.Replace(url, "{username}", paramUsername, 1) req := cli.Client.Put().URL(url) @@ -7226,9 +7322,9 @@ func XAttachInstanceToElasticIp(paramId string, params *viper.Viper, body string return resp, decoded, nil } -// XDetachInstanceFromElasticIp Detach a Compute instance from an Elastic IP -func XDetachInstanceFromElasticIp(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "detach-instance-from-elastic-ip" +// XResetDbaasValkeyUserPassword Reset the credentials of a DBaaS Valkey user +func XResetDbaasValkeyUserPassword(paramServiceName string, paramUsername string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "reset-dbaas-valkey-user-password" if xSubcommand { handlerPath = "x " + handlerPath } @@ -7238,8 +7334,9 @@ func XDetachInstanceFromElasticIp(paramId string, params *viper.Viper, body stri server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/elastic-ip/{id}:detach" - url = strings.Replace(url, "{id}", paramId, 1) + url := server + "/dbaas-valkey/{service-name}/user/{username}/password/reset" + url = strings.Replace(url, "{service-name}", paramServiceName, 1) + url = strings.Replace(url, "{username}", paramUsername, 1) req := cli.Client.Put().URL(url) @@ -7272,9 +7369,9 @@ func XDetachInstanceFromElasticIp(paramId string, params *viper.Viper, body stri return resp, decoded, nil } -// XGetEnvImpact [BETA] Retrieve organization environmental impact reports -func XGetEnvImpact(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-env-impact" +// XRevealDbaasValkeyUserPassword Reveal the secrets of a DBaaS Valkey user +func XRevealDbaasValkeyUserPassword(paramServiceName string, paramUsername string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "reveal-dbaas-valkey-user-password" if xSubcommand { handlerPath = "x " + handlerPath } @@ -7284,15 +7381,12 @@ func XGetEnvImpact(params *viper.Viper) (*gentleman.Response, map[string]interfa server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/env-impact" + url := server + "/dbaas-valkey/{service-name}/user/{username}/password/reveal" + url = strings.Replace(url, "{service-name}", paramServiceName, 1) + url = strings.Replace(url, "{username}", paramUsername, 1) req := cli.Client.Get().URL(url) - paramPeriod := params.GetString("period") - if paramPeriod != "" { - req = req.AddQuery("period", fmt.Sprintf("%v", paramPeriod)) - } - cli.HandleBefore(handlerPath, params, req) resp, err := req.Do() @@ -7318,9 +7412,9 @@ func XGetEnvImpact(params *viper.Viper) (*gentleman.Response, map[string]interfa return resp, decoded, nil } -// XListEvents List Events -func XListEvents(params *viper.Viper) (*gentleman.Response, interface{}, error) { - handlerPath := "list-events" +// XListDeployTargets List Deploy Targets +func XListDeployTargets(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-deploy-targets" if xSubcommand { handlerPath = "x " + handlerPath } @@ -7330,19 +7424,10 @@ func XListEvents(params *viper.Viper) (*gentleman.Response, interface{}, error) server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/event" + url := server + "/deploy-target" req := cli.Client.Get().URL(url) - paramFrom := params.GetString("from") - if paramFrom != "" { - req = req.AddQuery("from", fmt.Sprintf("%v", paramFrom)) - } - paramTo := params.GetString("to") - if paramTo != "" { - req = req.AddQuery("to", fmt.Sprintf("%v", paramTo)) - } - cli.HandleBefore(handlerPath, params, req) resp, err := req.Do() @@ -7350,7 +7435,7 @@ func XListEvents(params *viper.Viper) (*gentleman.Response, interface{}, error) return nil, nil, errors.Wrap(err, "Request failed") } - var decoded interface{} + var decoded map[string]interface{} if resp.StatusCode < 400 { if err := cli.UnmarshalResponse(resp, &decoded); err != nil { @@ -7362,15 +7447,15 @@ func XListEvents(params *viper.Viper) (*gentleman.Response, interface{}, error) after := cli.HandleAfter(handlerPath, params, resp, decoded) if after != nil { - decoded = after + decoded = after.(map[string]interface{}) } return resp, decoded, nil } -// XGetIamOrganizationPolicy Retrieve IAM Organization Policy -func XGetIamOrganizationPolicy(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-iam-organization-policy" +// XGetDeployTarget Retrieve Deploy Target details +func XGetDeployTarget(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-deploy-target" if xSubcommand { handlerPath = "x " + handlerPath } @@ -7380,7 +7465,8 @@ func XGetIamOrganizationPolicy(params *viper.Viper) (*gentleman.Response, map[st server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/iam-organization-policy" + url := server + "/deploy-target/{id}" + url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Get().URL(url) @@ -7409,9 +7495,9 @@ func XGetIamOrganizationPolicy(params *viper.Viper) (*gentleman.Response, map[st return resp, decoded, nil } -// XUpdateIamOrganizationPolicy Update IAM Organization Policy -func XUpdateIamOrganizationPolicy(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "update-iam-organization-policy" +// XCreateDnsDomain Create DNS domain +func XCreateDnsDomain(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-dns-domain" if xSubcommand { handlerPath = "x " + handlerPath } @@ -7421,9 +7507,9 @@ func XUpdateIamOrganizationPolicy(params *viper.Viper, body string) (*gentleman. server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/iam-organization-policy" + url := server + "/dns-domain" - req := cli.Client.Put().URL(url) + req := cli.Client.Post().URL(url) if body != "" { req = req.AddHeader("Content-Type", "application/json").BodyString(body) @@ -7454,9 +7540,9 @@ func XUpdateIamOrganizationPolicy(params *viper.Viper, body string) (*gentleman. return resp, decoded, nil } -// XResetIamOrganizationPolicy Reset IAM Organization Policy -func XResetIamOrganizationPolicy(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "reset-iam-organization-policy" +// XListDnsDomains List DNS domains +func XListDnsDomains(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-dns-domains" if xSubcommand { handlerPath = "x " + handlerPath } @@ -7466,13 +7552,9 @@ func XResetIamOrganizationPolicy(params *viper.Viper, body string) (*gentleman.R server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/iam-organization-policy:reset" - - req := cli.Client.Post().URL(url) + url := server + "/dns-domain" - if body != "" { - req = req.AddHeader("Content-Type", "").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -7499,9 +7581,9 @@ func XResetIamOrganizationPolicy(params *viper.Viper, body string) (*gentleman.R return resp, decoded, nil } -// XCreateIamRole Create IAM Role -func XCreateIamRole(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-iam-role" +// XCreateDnsDomainRecord Create DNS domain record +func XCreateDnsDomainRecord(paramDomainId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-dns-domain-record" if xSubcommand { handlerPath = "x " + handlerPath } @@ -7511,7 +7593,8 @@ func XCreateIamRole(params *viper.Viper, body string) (*gentleman.Response, map[ server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/iam-role" + url := server + "/dns-domain/{domain-id}/record" + url = strings.Replace(url, "{domain-id}", paramDomainId, 1) req := cli.Client.Post().URL(url) @@ -7544,9 +7627,9 @@ func XCreateIamRole(params *viper.Viper, body string) (*gentleman.Response, map[ return resp, decoded, nil } -// XListIamRoles List IAM Roles -func XListIamRoles(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "list-iam-roles" +// XListDnsDomainRecords List DNS domain records +func XListDnsDomainRecords(paramDomainId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-dns-domain-records" if xSubcommand { handlerPath = "x " + handlerPath } @@ -7556,7 +7639,8 @@ func XListIamRoles(params *viper.Viper) (*gentleman.Response, map[string]interfa server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/iam-role" + url := server + "/dns-domain/{domain-id}/record" + url = strings.Replace(url, "{domain-id}", paramDomainId, 1) req := cli.Client.Get().URL(url) @@ -7585,9 +7669,9 @@ func XListIamRoles(params *viper.Viper) (*gentleman.Response, map[string]interfa return resp, decoded, nil } -// XDeleteIamRole Delete IAM Role -func XDeleteIamRole(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-iam-role" +// XDeleteDnsDomainRecord Delete DNS domain record +func XDeleteDnsDomainRecord(paramDomainId string, paramRecordId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-dns-domain-record" if xSubcommand { handlerPath = "x " + handlerPath } @@ -7597,8 +7681,9 @@ func XDeleteIamRole(paramId string, params *viper.Viper) (*gentleman.Response, m server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/iam-role/{id}" - url = strings.Replace(url, "{id}", paramId, 1) + url := server + "/dns-domain/{domain-id}/record/{record-id}" + url = strings.Replace(url, "{domain-id}", paramDomainId, 1) + url = strings.Replace(url, "{record-id}", paramRecordId, 1) req := cli.Client.Delete().URL(url) @@ -7627,9 +7712,9 @@ func XDeleteIamRole(paramId string, params *viper.Viper) (*gentleman.Response, m return resp, decoded, nil } -// XGetIamRole Retrieve IAM Role -func XGetIamRole(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-iam-role" +// XGetDnsDomainRecord Retrieve DNS domain record details +func XGetDnsDomainRecord(paramDomainId string, paramRecordId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dns-domain-record" if xSubcommand { handlerPath = "x " + handlerPath } @@ -7639,8 +7724,9 @@ func XGetIamRole(paramId string, params *viper.Viper) (*gentleman.Response, map[ server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/iam-role/{id}" - url = strings.Replace(url, "{id}", paramId, 1) + url := server + "/dns-domain/{domain-id}/record/{record-id}" + url = strings.Replace(url, "{domain-id}", paramDomainId, 1) + url = strings.Replace(url, "{record-id}", paramRecordId, 1) req := cli.Client.Get().URL(url) @@ -7669,9 +7755,9 @@ func XGetIamRole(paramId string, params *viper.Viper) (*gentleman.Response, map[ return resp, decoded, nil } -// XUpdateIamRole Update IAM Role -func XUpdateIamRole(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "update-iam-role" +// XUpdateDnsDomainRecord Update DNS domain record +func XUpdateDnsDomainRecord(paramDomainId string, paramRecordId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-dns-domain-record" if xSubcommand { handlerPath = "x " + handlerPath } @@ -7681,8 +7767,9 @@ func XUpdateIamRole(paramId string, params *viper.Viper, body string) (*gentlema server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/iam-role/{id}" - url = strings.Replace(url, "{id}", paramId, 1) + url := server + "/dns-domain/{domain-id}/record/{record-id}" + url = strings.Replace(url, "{domain-id}", paramDomainId, 1) + url = strings.Replace(url, "{record-id}", paramRecordId, 1) req := cli.Client.Put().URL(url) @@ -7715,9 +7802,9 @@ func XUpdateIamRole(paramId string, params *viper.Viper, body string) (*gentlema return resp, decoded, nil } -// XUpdateIamRolePolicy Update IAM Role Policy -func XUpdateIamRolePolicy(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "update-iam-role-policy" +// XDeleteDnsDomain Delete DNS Domain +func XDeleteDnsDomain(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-dns-domain" if xSubcommand { handlerPath = "x " + handlerPath } @@ -7727,14 +7814,10 @@ func XUpdateIamRolePolicy(paramId string, params *viper.Viper, body string) (*ge server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/iam-role/{id}:policy" + url := server + "/dns-domain/{id}" url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Put().URL(url) - - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -7761,9 +7844,9 @@ func XUpdateIamRolePolicy(paramId string, params *viper.Viper, body string) (*ge return resp, decoded, nil } -// XCreateInstance Create a Compute instance -func XCreateInstance(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-instance" +// XGetDnsDomain Retrieve DNS domain details +func XGetDnsDomain(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dns-domain" if xSubcommand { handlerPath = "x " + handlerPath } @@ -7773,13 +7856,10 @@ func XCreateInstance(params *viper.Viper, body string) (*gentleman.Response, map server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance" - - req := cli.Client.Post().URL(url) + url := server + "/dns-domain/{id}" + url = strings.Replace(url, "{id}", paramId, 1) - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -7806,9 +7886,9 @@ func XCreateInstance(params *viper.Viper, body string) (*gentleman.Response, map return resp, decoded, nil } -// XListInstances List Compute instances -func XListInstances(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "list-instances" +// XGetDnsDomainZoneFile Retrieve DNS domain zone file +func XGetDnsDomainZoneFile(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dns-domain-zone-file" if xSubcommand { handlerPath = "x " + handlerPath } @@ -7818,23 +7898,11 @@ func XListInstances(params *viper.Viper) (*gentleman.Response, map[string]interf server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance" + url := server + "/dns-domain/{id}/zone" + url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Get().URL(url) - paramManagerId := params.GetString("manager-id") - if paramManagerId != "" { - req = req.AddQuery("manager-id", fmt.Sprintf("%v", paramManagerId)) - } - paramManagerType := params.GetString("manager-type") - if paramManagerType != "" { - req = req.AddQuery("manager-type", fmt.Sprintf("%v", paramManagerType)) - } - paramIpAddress := params.GetString("ip-address") - if paramIpAddress != "" { - req = req.AddQuery("ip-address", fmt.Sprintf("%v", paramIpAddress)) - } - cli.HandleBefore(handlerPath, params, req) resp, err := req.Do() @@ -7860,10 +7928,10 @@ func XListInstances(params *viper.Viper) (*gentleman.Response, map[string]interf return resp, decoded, nil } -// XCreateInstancePool Create an Instance Pool -func XCreateInstancePool(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-instance-pool" - if xSubcommand { +// XCreateElasticIp Create an Elastic IP +func XCreateElasticIp(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-elastic-ip" + if xSubcommand { handlerPath = "x " + handlerPath } @@ -7872,7 +7940,7 @@ func XCreateInstancePool(params *viper.Viper, body string) (*gentleman.Response, server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance-pool" + url := server + "/elastic-ip" req := cli.Client.Post().URL(url) @@ -7905,9 +7973,9 @@ func XCreateInstancePool(params *viper.Viper, body string) (*gentleman.Response, return resp, decoded, nil } -// XListInstancePools List Instance Pools -func XListInstancePools(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "list-instance-pools" +// XListElasticIps List Elastic IPs +func XListElasticIps(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-elastic-ips" if xSubcommand { handlerPath = "x " + handlerPath } @@ -7917,7 +7985,7 @@ func XListInstancePools(params *viper.Viper) (*gentleman.Response, map[string]in server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance-pool" + url := server + "/elastic-ip" req := cli.Client.Get().URL(url) @@ -7946,9 +8014,9 @@ func XListInstancePools(params *viper.Viper) (*gentleman.Response, map[string]in return resp, decoded, nil } -// XDeleteInstancePool Delete an Instance Pool -func XDeleteInstancePool(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-instance-pool" +// XDeleteElasticIp Delete an Elastic IP +func XDeleteElasticIp(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-elastic-ip" if xSubcommand { handlerPath = "x " + handlerPath } @@ -7958,7 +8026,7 @@ func XDeleteInstancePool(paramId string, params *viper.Viper) (*gentleman.Respon server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance-pool/{id}" + url := server + "/elastic-ip/{id}" url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Delete().URL(url) @@ -7988,9 +8056,9 @@ func XDeleteInstancePool(paramId string, params *viper.Viper) (*gentleman.Respon return resp, decoded, nil } -// XGetInstancePool Retrieve Instance Pool details -func XGetInstancePool(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-instance-pool" +// XGetElasticIp Retrieve Elastic IP details +func XGetElasticIp(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-elastic-ip" if xSubcommand { handlerPath = "x " + handlerPath } @@ -8000,7 +8068,7 @@ func XGetInstancePool(paramId string, params *viper.Viper) (*gentleman.Response, server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance-pool/{id}" + url := server + "/elastic-ip/{id}" url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Get().URL(url) @@ -8030,9 +8098,9 @@ func XGetInstancePool(paramId string, params *viper.Viper) (*gentleman.Response, return resp, decoded, nil } -// XUpdateInstancePool Update an Instance Pool -func XUpdateInstancePool(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "update-instance-pool" +// XUpdateElasticIp Update an Elastic IP +func XUpdateElasticIp(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-elastic-ip" if xSubcommand { handlerPath = "x " + handlerPath } @@ -8042,7 +8110,7 @@ func XUpdateInstancePool(paramId string, params *viper.Viper, body string) (*gen server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance-pool/{id}" + url := server + "/elastic-ip/{id}" url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Put().URL(url) @@ -8076,9 +8144,9 @@ func XUpdateInstancePool(paramId string, params *viper.Viper, body string) (*gen return resp, decoded, nil } -// XResetInstancePoolField Reset an Instance Pool field to its default value -func XResetInstancePoolField(paramId string, paramField string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "reset-instance-pool-field" +// XResetElasticIpField Reset an Elastic IP field to its default value +func XResetElasticIpField(paramId string, paramField string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "reset-elastic-ip-field" if xSubcommand { handlerPath = "x " + handlerPath } @@ -8088,7 +8156,7 @@ func XResetInstancePoolField(paramId string, paramField string, params *viper.Vi server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance-pool/{id}/{field}" + url := server + "/elastic-ip/{id}/{field}" url = strings.Replace(url, "{id}", paramId, 1) url = strings.Replace(url, "{field}", paramField, 1) @@ -8119,9 +8187,9 @@ func XResetInstancePoolField(paramId string, paramField string, params *viper.Vi return resp, decoded, nil } -// XEvictInstancePoolMembers Evict Instance Pool members -func XEvictInstancePoolMembers(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "evict-instance-pool-members" +// XAttachInstanceToElasticIp Attach a Compute instance to an Elastic IP +func XAttachInstanceToElasticIp(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "attach-instance-to-elastic-ip" if xSubcommand { handlerPath = "x " + handlerPath } @@ -8131,7 +8199,7 @@ func XEvictInstancePoolMembers(paramId string, params *viper.Viper, body string) server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance-pool/{id}:evict" + url := server + "/elastic-ip/{id}:attach" url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Put().URL(url) @@ -8165,9 +8233,9 @@ func XEvictInstancePoolMembers(paramId string, params *viper.Viper, body string) return resp, decoded, nil } -// XScaleInstancePool Scale an Instance Pool -func XScaleInstancePool(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "scale-instance-pool" +// XDetachInstanceFromElasticIp Detach a Compute instance from an Elastic IP +func XDetachInstanceFromElasticIp(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "detach-instance-from-elastic-ip" if xSubcommand { handlerPath = "x " + handlerPath } @@ -8177,7 +8245,7 @@ func XScaleInstancePool(paramId string, params *viper.Viper, body string) (*gent server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance-pool/{id}:scale" + url := server + "/elastic-ip/{id}:detach" url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Put().URL(url) @@ -8211,9 +8279,9 @@ func XScaleInstancePool(paramId string, params *viper.Viper, body string) (*gent return resp, decoded, nil } -// XListInstanceTypes List Compute instance Types -func XListInstanceTypes(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "list-instance-types" +// XGetEnvImpact [BETA] Retrieve organization environmental impact reports +func XGetEnvImpact(paramPeriod string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-env-impact" if xSubcommand { handlerPath = "x " + handlerPath } @@ -8223,7 +8291,8 @@ func XListInstanceTypes(params *viper.Viper) (*gentleman.Response, map[string]in server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance-type" + url := server + "/env-impact/{period}" + url = strings.Replace(url, "{period}", paramPeriod, 1) req := cli.Client.Get().URL(url) @@ -8252,9 +8321,9 @@ func XListInstanceTypes(params *viper.Viper) (*gentleman.Response, map[string]in return resp, decoded, nil } -// XGetInstanceType Retrieve Instance Type details -func XGetInstanceType(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-instance-type" +// XListEvents List Events +func XListEvents(params *viper.Viper) (*gentleman.Response, interface{}, error) { + handlerPath := "list-events" if xSubcommand { handlerPath = "x " + handlerPath } @@ -8264,53 +8333,19 @@ func XGetInstanceType(paramId string, params *viper.Viper) (*gentleman.Response, server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance-type/{id}" - url = strings.Replace(url, "{id}", paramId, 1) + url := server + "/event" req := cli.Client.Get().URL(url) - cli.HandleBefore(handlerPath, params, req) - - resp, err := req.Do() - if err != nil { - return nil, nil, errors.Wrap(err, "Request failed") - } - - var decoded map[string]interface{} - - if resp.StatusCode < 400 { - if err := cli.UnmarshalResponse(resp, &decoded); err != nil { - return nil, nil, errors.Wrap(err, "Unmarshalling response failed") - } - } else { - return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) - } - - after := cli.HandleAfter(handlerPath, params, resp, decoded) - if after != nil { - decoded = after.(map[string]interface{}) - } - - return resp, decoded, nil -} - -// XDeleteInstance Delete a Compute instance -func XDeleteInstance(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-instance" - if xSubcommand { - handlerPath = "x " + handlerPath + paramFrom := params.GetString("from") + if paramFrom != "" { + req = req.AddQuery("from", fmt.Sprintf("%v", paramFrom)) } - - server := viper.GetString("server") - if server == "" { - server = xServers()[viper.GetInt("server-index")]["url"] + paramTo := params.GetString("to") + if paramTo != "" { + req = req.AddQuery("to", fmt.Sprintf("%v", paramTo)) } - url := server + "/instance/{id}" - url = strings.Replace(url, "{id}", paramId, 1) - - req := cli.Client.Delete().URL(url) - cli.HandleBefore(handlerPath, params, req) resp, err := req.Do() @@ -8318,7 +8353,7 @@ func XDeleteInstance(paramId string, params *viper.Viper) (*gentleman.Response, return nil, nil, errors.Wrap(err, "Request failed") } - var decoded map[string]interface{} + var decoded interface{} if resp.StatusCode < 400 { if err := cli.UnmarshalResponse(resp, &decoded); err != nil { @@ -8330,15 +8365,15 @@ func XDeleteInstance(paramId string, params *viper.Viper) (*gentleman.Response, after := cli.HandleAfter(handlerPath, params, resp, decoded) if after != nil { - decoded = after.(map[string]interface{}) + decoded = after } return resp, decoded, nil } -// XGetInstance Retrieve Compute instance details -func XGetInstance(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-instance" +// XGetIamOrganizationPolicy Retrieve IAM Organization Policy +func XGetIamOrganizationPolicy(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-iam-organization-policy" if xSubcommand { handlerPath = "x " + handlerPath } @@ -8348,8 +8383,7 @@ func XGetInstance(paramId string, params *viper.Viper) (*gentleman.Response, map server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance/{id}" - url = strings.Replace(url, "{id}", paramId, 1) + url := server + "/iam-organization-policy" req := cli.Client.Get().URL(url) @@ -8378,9 +8412,9 @@ func XGetInstance(paramId string, params *viper.Viper) (*gentleman.Response, map return resp, decoded, nil } -// XUpdateInstance Update a Compute instance -func XUpdateInstance(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "update-instance" +// XUpdateIamOrganizationPolicy Update IAM Organization Policy +func XUpdateIamOrganizationPolicy(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-iam-organization-policy" if xSubcommand { handlerPath = "x " + handlerPath } @@ -8390,8 +8424,7 @@ func XUpdateInstance(paramId string, params *viper.Viper, body string) (*gentlem server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance/{id}" - url = strings.Replace(url, "{id}", paramId, 1) + url := server + "/iam-organization-policy" req := cli.Client.Put().URL(url) @@ -8424,9 +8457,9 @@ func XUpdateInstance(paramId string, params *viper.Viper, body string) (*gentlem return resp, decoded, nil } -// XResetInstanceField Reset Instance field -func XResetInstanceField(paramId string, paramField string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "reset-instance-field" +// XResetIamOrganizationPolicy Reset IAM Organization Policy +func XResetIamOrganizationPolicy(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "reset-iam-organization-policy" if xSubcommand { handlerPath = "x " + handlerPath } @@ -8436,11 +8469,13 @@ func XResetInstanceField(paramId string, paramField string, params *viper.Viper) server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance/{id}/{field}" - url = strings.Replace(url, "{id}", paramId, 1) - url = strings.Replace(url, "{field}", paramField, 1) + url := server + "/iam-organization-policy:reset" - req := cli.Client.Delete().URL(url) + req := cli.Client.Post().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -8467,9 +8502,9 @@ func XResetInstanceField(paramId string, paramField string, params *viper.Viper) return resp, decoded, nil } -// XAddInstanceProtection Set instance destruction protection -func XAddInstanceProtection(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "add-instance-protection" +// XCreateIamRole Create IAM Role +func XCreateIamRole(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-iam-role" if xSubcommand { handlerPath = "x " + handlerPath } @@ -8479,13 +8514,12 @@ func XAddInstanceProtection(paramId string, params *viper.Viper, body string) (* server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance/{id}:add-protection" - url = strings.Replace(url, "{id}", paramId, 1) + url := server + "/iam-role" - req := cli.Client.Put().URL(url) + req := cli.Client.Post().URL(url) if body != "" { - req = req.AddHeader("Content-Type", "").BodyString(body) + req = req.AddHeader("Content-Type", "application/json").BodyString(body) } cli.HandleBefore(handlerPath, params, req) @@ -8513,9 +8547,9 @@ func XAddInstanceProtection(paramId string, params *viper.Viper, body string) (* return resp, decoded, nil } -// XCreateSnapshot Create a Snapshot of a Compute instance -func XCreateSnapshot(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-snapshot" +// XListIamRoles List IAM Roles +func XListIamRoles(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-iam-roles" if xSubcommand { handlerPath = "x " + handlerPath } @@ -8525,14 +8559,9 @@ func XCreateSnapshot(paramId string, params *viper.Viper, body string) (*gentlem server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance/{id}:create-snapshot" - url = strings.Replace(url, "{id}", paramId, 1) - - req := cli.Client.Post().URL(url) + url := server + "/iam-role" - if body != "" { - req = req.AddHeader("Content-Type", "").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -8559,9 +8588,9 @@ func XCreateSnapshot(paramId string, params *viper.Viper, body string) (*gentlem return resp, decoded, nil } -// XEnableTpm Enable tpm for the instance. -func XEnableTpm(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "enable-tpm" +// XDeleteIamRole Delete IAM Role +func XDeleteIamRole(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-iam-role" if xSubcommand { handlerPath = "x " + handlerPath } @@ -8571,14 +8600,10 @@ func XEnableTpm(paramId string, params *viper.Viper, body string) (*gentleman.Re server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance/{id}:enable-tpm" + url := server + "/iam-role/{id}" url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Post().URL(url) - - if body != "" { - req = req.AddHeader("Content-Type", "").BodyString(body) - } + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -8605,9 +8630,9 @@ func XEnableTpm(paramId string, params *viper.Viper, body string) (*gentleman.Re return resp, decoded, nil } -// XRevealInstancePassword Reveal the password used during instance creation or the latest password reset. -func XRevealInstancePassword(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "reveal-instance-password" +// XGetIamRole Retrieve IAM Role +func XGetIamRole(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-iam-role" if xSubcommand { handlerPath = "x " + handlerPath } @@ -8617,7 +8642,7 @@ func XRevealInstancePassword(paramId string, params *viper.Viper) (*gentleman.Re server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance/{id}:password" + url := server + "/iam-role/{id}" url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Get().URL(url) @@ -8647,9 +8672,9 @@ func XRevealInstancePassword(paramId string, params *viper.Viper) (*gentleman.Re return resp, decoded, nil } -// XRebootInstance Reboot a Compute instance -func XRebootInstance(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "reboot-instance" +// XUpdateIamRole Update IAM Role +func XUpdateIamRole(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-iam-role" if xSubcommand { handlerPath = "x " + handlerPath } @@ -8659,13 +8684,13 @@ func XRebootInstance(paramId string, params *viper.Viper, body string) (*gentlem server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance/{id}:reboot" + url := server + "/iam-role/{id}" url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Put().URL(url) if body != "" { - req = req.AddHeader("Content-Type", "").BodyString(body) + req = req.AddHeader("Content-Type", "application/json").BodyString(body) } cli.HandleBefore(handlerPath, params, req) @@ -8693,9 +8718,9 @@ func XRebootInstance(paramId string, params *viper.Viper, body string) (*gentlem return resp, decoded, nil } -// XRemoveInstanceProtection Remove instance destruction protection -func XRemoveInstanceProtection(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "remove-instance-protection" +// XUpdateIamRoleAssumePolicy Update IAM Assume role Policy +func XUpdateIamRoleAssumePolicy(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-iam-role-assume-policy" if xSubcommand { handlerPath = "x " + handlerPath } @@ -8705,13 +8730,13 @@ func XRemoveInstanceProtection(paramId string, params *viper.Viper, body string) server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance/{id}:remove-protection" + url := server + "/iam-role/{id}:assume-role-policy" url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Put().URL(url) if body != "" { - req = req.AddHeader("Content-Type", "").BodyString(body) + req = req.AddHeader("Content-Type", "application/json").BodyString(body) } cli.HandleBefore(handlerPath, params, req) @@ -8739,9 +8764,9 @@ func XRemoveInstanceProtection(paramId string, params *viper.Viper, body string) return resp, decoded, nil } -// XResetInstance Reset a Compute instance to a base/target template -func XResetInstance(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "reset-instance" +// XUpdateIamRolePolicy Update IAM Role Policy +func XUpdateIamRolePolicy(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-iam-role-policy" if xSubcommand { handlerPath = "x " + handlerPath } @@ -8751,7 +8776,7 @@ func XResetInstance(paramId string, params *viper.Viper, body string) (*gentlema server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance/{id}:reset" + url := server + "/iam-role/{id}:policy" url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Put().URL(url) @@ -8785,9 +8810,9 @@ func XResetInstance(paramId string, params *viper.Viper, body string) (*gentlema return resp, decoded, nil } -// XResetInstancePassword Reset a compute instance password -func XResetInstancePassword(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "reset-instance-password" +// XAssumeIamRole [BETA] Request generation of key/secret that allow caller to assume target role +func XAssumeIamRole(paramTargetRoleId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "assume-iam-role" if xSubcommand { handlerPath = "x " + handlerPath } @@ -8797,13 +8822,13 @@ func XResetInstancePassword(paramId string, params *viper.Viper, body string) (* server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance/{id}:reset-password" - url = strings.Replace(url, "{id}", paramId, 1) + url := server + "/iam-role/{target-role-id}/assume" + url = strings.Replace(url, "{target-role-id}", paramTargetRoleId, 1) - req := cli.Client.Put().URL(url) + req := cli.Client.Post().URL(url) if body != "" { - req = req.AddHeader("Content-Type", "").BodyString(body) + req = req.AddHeader("Content-Type", "application/json").BodyString(body) } cli.HandleBefore(handlerPath, params, req) @@ -8831,9 +8856,9 @@ func XResetInstancePassword(paramId string, params *viper.Viper, body string) (* return resp, decoded, nil } -// XResizeInstanceDisk Resize a Compute instance disk -func XResizeInstanceDisk(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "resize-instance-disk" +// XCreateInstance Create a Compute instance +func XCreateInstance(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-instance" if xSubcommand { handlerPath = "x " + handlerPath } @@ -8843,10 +8868,9 @@ func XResizeInstanceDisk(paramId string, params *viper.Viper, body string) (*gen server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance/{id}:resize-disk" - url = strings.Replace(url, "{id}", paramId, 1) + url := server + "/instance" - req := cli.Client.Put().URL(url) + req := cli.Client.Post().URL(url) if body != "" { req = req.AddHeader("Content-Type", "application/json").BodyString(body) @@ -8877,9 +8901,9 @@ func XResizeInstanceDisk(paramId string, params *viper.Viper, body string) (*gen return resp, decoded, nil } -// XScaleInstance Scale a Compute instance to a new Instance Type -func XScaleInstance(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "scale-instance" +// XListInstances List Compute instances +func XListInstances(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-instances" if xSubcommand { handlerPath = "x " + handlerPath } @@ -8889,13 +8913,25 @@ func XScaleInstance(paramId string, params *viper.Viper, body string) (*gentlema server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance/{id}:scale" - url = strings.Replace(url, "{id}", paramId, 1) + url := server + "/instance" - req := cli.Client.Put().URL(url) + req := cli.Client.Get().URL(url) - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) + paramManagerId := params.GetString("manager-id") + if paramManagerId != "" { + req = req.AddQuery("manager-id", fmt.Sprintf("%v", paramManagerId)) + } + paramManagerType := params.GetString("manager-type") + if paramManagerType != "" { + req = req.AddQuery("manager-type", fmt.Sprintf("%v", paramManagerType)) + } + paramIpAddress := params.GetString("ip-address") + if paramIpAddress != "" { + req = req.AddQuery("ip-address", fmt.Sprintf("%v", paramIpAddress)) + } + paramLabels := params.GetString("labels") + if paramLabels != "" { + req = req.AddQuery("labels", fmt.Sprintf("%v", paramLabels)) } cli.HandleBefore(handlerPath, params, req) @@ -8923,9 +8959,9 @@ func XScaleInstance(paramId string, params *viper.Viper, body string) (*gentlema return resp, decoded, nil } -// XStartInstance Start a Compute instance -func XStartInstance(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "start-instance" +// XCreateInstancePool Create an Instance Pool +func XCreateInstancePool(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-instance-pool" if xSubcommand { handlerPath = "x " + handlerPath } @@ -8935,10 +8971,9 @@ func XStartInstance(paramId string, params *viper.Viper, body string) (*gentlema server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance/{id}:start" - url = strings.Replace(url, "{id}", paramId, 1) + url := server + "/instance-pool" - req := cli.Client.Put().URL(url) + req := cli.Client.Post().URL(url) if body != "" { req = req.AddHeader("Content-Type", "application/json").BodyString(body) @@ -8969,9 +9004,9 @@ func XStartInstance(paramId string, params *viper.Viper, body string) (*gentlema return resp, decoded, nil } -// XStopInstance Stop a Compute instance -func XStopInstance(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "stop-instance" +// XListInstancePools List Instance Pools +func XListInstancePools(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-instance-pools" if xSubcommand { handlerPath = "x " + handlerPath } @@ -8981,14 +9016,9 @@ func XStopInstance(paramId string, params *viper.Viper, body string) (*gentleman server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance/{id}:stop" - url = strings.Replace(url, "{id}", paramId, 1) - - req := cli.Client.Put().URL(url) + url := server + "/instance-pool" - if body != "" { - req = req.AddHeader("Content-Type", "").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -9015,9 +9045,9 @@ func XStopInstance(paramId string, params *viper.Viper, body string) (*gentleman return resp, decoded, nil } -// XRevertInstanceToSnapshot Revert a snapshot for an instance -func XRevertInstanceToSnapshot(paramInstanceId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "revert-instance-to-snapshot" +// XDeleteInstancePool Delete an Instance Pool +func XDeleteInstancePool(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-instance-pool" if xSubcommand { handlerPath = "x " + handlerPath } @@ -9027,14 +9057,10 @@ func XRevertInstanceToSnapshot(paramInstanceId string, params *viper.Viper, body server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance/{instance-id}:revert-snapshot" - url = strings.Replace(url, "{instance-id}", paramInstanceId, 1) - - req := cli.Client.Post().URL(url) + url := server + "/instance-pool/{id}" + url = strings.Replace(url, "{id}", paramId, 1) - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -9061,9 +9087,9 @@ func XRevertInstanceToSnapshot(paramInstanceId string, params *viper.Viper, body return resp, decoded, nil } -// XCreateLoadBalancer Create a Load Balancer -func XCreateLoadBalancer(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-load-balancer" +// XGetInstancePool Retrieve Instance Pool details +func XGetInstancePool(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-instance-pool" if xSubcommand { handlerPath = "x " + handlerPath } @@ -9073,13 +9099,10 @@ func XCreateLoadBalancer(params *viper.Viper, body string) (*gentleman.Response, server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/load-balancer" - - req := cli.Client.Post().URL(url) + url := server + "/instance-pool/{id}" + url = strings.Replace(url, "{id}", paramId, 1) - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -9106,9 +9129,9 @@ func XCreateLoadBalancer(params *viper.Viper, body string) (*gentleman.Response, return resp, decoded, nil } -// XListLoadBalancers List Load Balancers -func XListLoadBalancers(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "list-load-balancers" +// XUpdateInstancePool Update an Instance Pool +func XUpdateInstancePool(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-instance-pool" if xSubcommand { handlerPath = "x " + handlerPath } @@ -9118,9 +9141,14 @@ func XListLoadBalancers(params *viper.Viper) (*gentleman.Response, map[string]in server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/load-balancer" + url := server + "/instance-pool/{id}" + url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Put().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -9147,9 +9175,9 @@ func XListLoadBalancers(params *viper.Viper) (*gentleman.Response, map[string]in return resp, decoded, nil } -// XDeleteLoadBalancer Delete a Load Balancer -func XDeleteLoadBalancer(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-load-balancer" +// XResetInstancePoolField Reset an Instance Pool field to its default value +func XResetInstancePoolField(paramId string, paramField string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "reset-instance-pool-field" if xSubcommand { handlerPath = "x " + handlerPath } @@ -9159,8 +9187,9 @@ func XDeleteLoadBalancer(paramId string, params *viper.Viper) (*gentleman.Respon server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/load-balancer/{id}" + url := server + "/instance-pool/{id}/{field}" url = strings.Replace(url, "{id}", paramId, 1) + url = strings.Replace(url, "{field}", paramField, 1) req := cli.Client.Delete().URL(url) @@ -9189,9 +9218,9 @@ func XDeleteLoadBalancer(paramId string, params *viper.Viper) (*gentleman.Respon return resp, decoded, nil } -// XGetLoadBalancer Retrieve Load Balancer details -func XGetLoadBalancer(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-load-balancer" +// XEvictInstancePoolMembers Evict Instance Pool members +func XEvictInstancePoolMembers(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "evict-instance-pool-members" if xSubcommand { handlerPath = "x " + handlerPath } @@ -9201,10 +9230,14 @@ func XGetLoadBalancer(paramId string, params *viper.Viper) (*gentleman.Response, server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/load-balancer/{id}" + url := server + "/instance-pool/{id}:evict" url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Put().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -9231,9 +9264,9 @@ func XGetLoadBalancer(paramId string, params *viper.Viper) (*gentleman.Response, return resp, decoded, nil } -// XUpdateLoadBalancer Update a Load Balancer -func XUpdateLoadBalancer(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "update-load-balancer" +// XScaleInstancePool Scale an Instance Pool +func XScaleInstancePool(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "scale-instance-pool" if xSubcommand { handlerPath = "x " + handlerPath } @@ -9243,7 +9276,7 @@ func XUpdateLoadBalancer(paramId string, params *viper.Viper, body string) (*gen server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/load-balancer/{id}" + url := server + "/instance-pool/{id}:scale" url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Put().URL(url) @@ -9277,9 +9310,9 @@ func XUpdateLoadBalancer(paramId string, params *viper.Viper, body string) (*gen return resp, decoded, nil } -// XAddServiceToLoadBalancer Add a Load Balancer Service -func XAddServiceToLoadBalancer(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "add-service-to-load-balancer" +// XListInstanceTypes List Compute instance Types +func XListInstanceTypes(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-instance-types" if xSubcommand { handlerPath = "x " + handlerPath } @@ -9289,14 +9322,9 @@ func XAddServiceToLoadBalancer(paramId string, params *viper.Viper, body string) server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/load-balancer/{id}/service" - url = strings.Replace(url, "{id}", paramId, 1) - - req := cli.Client.Post().URL(url) + url := server + "/instance-type" - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -9323,9 +9351,9 @@ func XAddServiceToLoadBalancer(paramId string, params *viper.Viper, body string) return resp, decoded, nil } -// XDeleteLoadBalancerService Delete a Load Balancer Service -func XDeleteLoadBalancerService(paramId string, paramServiceId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-load-balancer-service" +// XGetInstanceType Retrieve Instance Type details +func XGetInstanceType(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-instance-type" if xSubcommand { handlerPath = "x " + handlerPath } @@ -9335,11 +9363,10 @@ func XDeleteLoadBalancerService(paramId string, paramServiceId string, params *v server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/load-balancer/{id}/service/{service-id}" + url := server + "/instance-type/{id}" url = strings.Replace(url, "{id}", paramId, 1) - url = strings.Replace(url, "{service-id}", paramServiceId, 1) - req := cli.Client.Delete().URL(url) + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -9366,9 +9393,9 @@ func XDeleteLoadBalancerService(paramId string, paramServiceId string, params *v return resp, decoded, nil } -// XGetLoadBalancerService Retrieve Load Balancer Service details -func XGetLoadBalancerService(paramId string, paramServiceId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-load-balancer-service" +// XDeleteInstance Delete a Compute instance +func XDeleteInstance(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-instance" if xSubcommand { handlerPath = "x " + handlerPath } @@ -9378,11 +9405,10 @@ func XGetLoadBalancerService(paramId string, paramServiceId string, params *vipe server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/load-balancer/{id}/service/{service-id}" + url := server + "/instance/{id}" url = strings.Replace(url, "{id}", paramId, 1) - url = strings.Replace(url, "{service-id}", paramServiceId, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -9409,9 +9435,9 @@ func XGetLoadBalancerService(paramId string, paramServiceId string, params *vipe return resp, decoded, nil } -// XUpdateLoadBalancerService Update a Load Balancer Service -func XUpdateLoadBalancerService(paramId string, paramServiceId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "update-load-balancer-service" +// XGetInstance Retrieve Compute instance details +func XGetInstance(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-instance" if xSubcommand { handlerPath = "x " + handlerPath } @@ -9421,15 +9447,10 @@ func XUpdateLoadBalancerService(paramId string, paramServiceId string, params *v server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/load-balancer/{id}/service/{service-id}" + url := server + "/instance/{id}" url = strings.Replace(url, "{id}", paramId, 1) - url = strings.Replace(url, "{service-id}", paramServiceId, 1) - req := cli.Client.Put().URL(url) - - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -9456,9 +9477,9 @@ func XUpdateLoadBalancerService(paramId string, paramServiceId string, params *v return resp, decoded, nil } -// XResetLoadBalancerServiceField Reset a Load Balancer Service field to its default value -func XResetLoadBalancerServiceField(paramId string, paramServiceId string, paramField string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "reset-load-balancer-service-field" +// XUpdateInstance Update a Compute instance +func XUpdateInstance(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-instance" if xSubcommand { handlerPath = "x " + handlerPath } @@ -9468,12 +9489,14 @@ func XResetLoadBalancerServiceField(paramId string, paramServiceId string, param server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/load-balancer/{id}/service/{service-id}/{field}" + url := server + "/instance/{id}" url = strings.Replace(url, "{id}", paramId, 1) - url = strings.Replace(url, "{service-id}", paramServiceId, 1) - url = strings.Replace(url, "{field}", paramField, 1) - req := cli.Client.Delete().URL(url) + req := cli.Client.Put().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -9500,9 +9523,9 @@ func XResetLoadBalancerServiceField(paramId string, paramServiceId string, param return resp, decoded, nil } -// XResetLoadBalancerField Reset a Load Balancer field to its default value -func XResetLoadBalancerField(paramId string, paramField string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "reset-load-balancer-field" +// XResetInstanceField Reset Instance field +func XResetInstanceField(paramId string, paramField string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "reset-instance-field" if xSubcommand { handlerPath = "x " + handlerPath } @@ -9512,7 +9535,7 @@ func XResetLoadBalancerField(paramId string, paramField string, params *viper.Vi server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/load-balancer/{id}/{field}" + url := server + "/instance/{id}/{field}" url = strings.Replace(url, "{id}", paramId, 1) url = strings.Replace(url, "{field}", paramField, 1) @@ -9543,9 +9566,9 @@ func XResetLoadBalancerField(paramId string, paramField string, params *viper.Vi return resp, decoded, nil } -// XGetOperation Retrieve Operation details -func XGetOperation(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-operation" +// XAddInstanceProtection Set instance destruction protection +func XAddInstanceProtection(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "add-instance-protection" if xSubcommand { handlerPath = "x " + handlerPath } @@ -9555,10 +9578,14 @@ func XGetOperation(paramId string, params *viper.Viper) (*gentleman.Response, ma server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/operation/{id}" + url := server + "/instance/{id}:add-protection" url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Put().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -9585,9 +9612,9 @@ func XGetOperation(paramId string, params *viper.Viper) (*gentleman.Response, ma return resp, decoded, nil } -// XGetOrganization Retrieve an organization -func XGetOrganization(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-organization" +// XCreateSnapshot Create a Snapshot of a Compute instance +func XCreateSnapshot(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-snapshot" if xSubcommand { handlerPath = "x " + handlerPath } @@ -9597,9 +9624,14 @@ func XGetOrganization(params *viper.Viper) (*gentleman.Response, map[string]inte server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/organization" + url := server + "/instance/{id}:create-snapshot" + url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Post().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -9626,9 +9658,9 @@ func XGetOrganization(params *viper.Viper) (*gentleman.Response, map[string]inte return resp, decoded, nil } -// XCreatePrivateNetwork Create a Private Network -func XCreatePrivateNetwork(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-private-network" +// XEnableTpm Enable tpm for the instance. +func XEnableTpm(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "enable-tpm" if xSubcommand { handlerPath = "x " + handlerPath } @@ -9638,12 +9670,13 @@ func XCreatePrivateNetwork(params *viper.Viper, body string) (*gentleman.Respons server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/private-network" + url := server + "/instance/{id}:enable-tpm" + url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Post().URL(url) if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) + req = req.AddHeader("Content-Type", "").BodyString(body) } cli.HandleBefore(handlerPath, params, req) @@ -9671,9 +9704,9 @@ func XCreatePrivateNetwork(params *viper.Viper, body string) (*gentleman.Respons return resp, decoded, nil } -// XListPrivateNetworks List Private Networks -func XListPrivateNetworks(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "list-private-networks" +// XRevealInstancePassword Reveal the password used during instance creation or the latest password reset. +func XRevealInstancePassword(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "reveal-instance-password" if xSubcommand { handlerPath = "x " + handlerPath } @@ -9683,7 +9716,8 @@ func XListPrivateNetworks(params *viper.Viper) (*gentleman.Response, map[string] server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/private-network" + url := server + "/instance/{id}:password" + url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Get().URL(url) @@ -9712,11 +9746,11 @@ func XListPrivateNetworks(params *viper.Viper) (*gentleman.Response, map[string] return resp, decoded, nil } -// XDeletePrivateNetwork Delete a Private Network -func XDeletePrivateNetwork(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-private-network" - if xSubcommand { - handlerPath = "x " + handlerPath +// XRebootInstance Reboot a Compute instance +func XRebootInstance(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "reboot-instance" + if xSubcommand { + handlerPath = "x " + handlerPath } server := viper.GetString("server") @@ -9724,10 +9758,14 @@ func XDeletePrivateNetwork(paramId string, params *viper.Viper) (*gentleman.Resp server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/private-network/{id}" + url := server + "/instance/{id}:reboot" url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Delete().URL(url) + req := cli.Client.Put().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -9754,9 +9792,9 @@ func XDeletePrivateNetwork(paramId string, params *viper.Viper) (*gentleman.Resp return resp, decoded, nil } -// XGetPrivateNetwork Retrieve Private Network details -func XGetPrivateNetwork(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-private-network" +// XRemoveInstanceProtection Remove instance destruction protection +func XRemoveInstanceProtection(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "remove-instance-protection" if xSubcommand { handlerPath = "x " + handlerPath } @@ -9766,10 +9804,14 @@ func XGetPrivateNetwork(paramId string, params *viper.Viper) (*gentleman.Respons server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/private-network/{id}" + url := server + "/instance/{id}:remove-protection" url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Put().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -9796,9 +9838,9 @@ func XGetPrivateNetwork(paramId string, params *viper.Viper) (*gentleman.Respons return resp, decoded, nil } -// XUpdatePrivateNetwork Update a Private Network -func XUpdatePrivateNetwork(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "update-private-network" +// XResetInstance Reset a Compute instance to a base/target template +func XResetInstance(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "reset-instance" if xSubcommand { handlerPath = "x " + handlerPath } @@ -9808,7 +9850,7 @@ func XUpdatePrivateNetwork(paramId string, params *viper.Viper, body string) (*g server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/private-network/{id}" + url := server + "/instance/{id}:reset" url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Put().URL(url) @@ -9842,9 +9884,9 @@ func XUpdatePrivateNetwork(paramId string, params *viper.Viper, body string) (*g return resp, decoded, nil } -// XResetPrivateNetworkField Reset Private Network field -func XResetPrivateNetworkField(paramId string, paramField string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "reset-private-network-field" +// XResetInstancePassword Reset a compute instance password +func XResetInstancePassword(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "reset-instance-password" if xSubcommand { handlerPath = "x " + handlerPath } @@ -9854,11 +9896,14 @@ func XResetPrivateNetworkField(paramId string, paramField string, params *viper. server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/private-network/{id}/{field}" + url := server + "/instance/{id}:reset-password" url = strings.Replace(url, "{id}", paramId, 1) - url = strings.Replace(url, "{field}", paramField, 1) - req := cli.Client.Delete().URL(url) + req := cli.Client.Put().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -9885,9 +9930,9 @@ func XResetPrivateNetworkField(paramId string, paramField string, params *viper. return resp, decoded, nil } -// XAttachInstanceToPrivateNetwork Attach a Compute instance to a Private Network -func XAttachInstanceToPrivateNetwork(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "attach-instance-to-private-network" +// XResizeInstanceDisk Resize a Compute instance disk +func XResizeInstanceDisk(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "resize-instance-disk" if xSubcommand { handlerPath = "x " + handlerPath } @@ -9897,7 +9942,7 @@ func XAttachInstanceToPrivateNetwork(paramId string, params *viper.Viper, body s server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/private-network/{id}:attach" + url := server + "/instance/{id}:resize-disk" url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Put().URL(url) @@ -9931,9 +9976,9 @@ func XAttachInstanceToPrivateNetwork(paramId string, params *viper.Viper, body s return resp, decoded, nil } -// XDetachInstanceFromPrivateNetwork Detach a Compute instance from a Private Network -func XDetachInstanceFromPrivateNetwork(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "detach-instance-from-private-network" +// XScaleInstance Scale a Compute instance to a new Instance Type +func XScaleInstance(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "scale-instance" if xSubcommand { handlerPath = "x " + handlerPath } @@ -9943,7 +9988,7 @@ func XDetachInstanceFromPrivateNetwork(paramId string, params *viper.Viper, body server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/private-network/{id}:detach" + url := server + "/instance/{id}:scale" url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Put().URL(url) @@ -9977,9 +10022,9 @@ func XDetachInstanceFromPrivateNetwork(paramId string, params *viper.Viper, body return resp, decoded, nil } -// XUpdatePrivateNetworkInstanceIp Update the IP address of an instance attached to a managed private network -func XUpdatePrivateNetworkInstanceIp(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "update-private-network-instance-ip" +// XStartInstance Start a Compute instance +func XStartInstance(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "start-instance" if xSubcommand { handlerPath = "x " + handlerPath } @@ -9989,7 +10034,7 @@ func XUpdatePrivateNetworkInstanceIp(paramId string, params *viper.Viper, body s server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/private-network/{id}:update-ip" + url := server + "/instance/{id}:start" url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Put().URL(url) @@ -10023,9 +10068,9 @@ func XUpdatePrivateNetworkInstanceIp(paramId string, params *viper.Viper, body s return resp, decoded, nil } -// XListQuotas List Organization Quotas -func XListQuotas(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "list-quotas" +// XStopInstance Stop a Compute instance +func XStopInstance(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "stop-instance" if xSubcommand { handlerPath = "x " + handlerPath } @@ -10035,9 +10080,14 @@ func XListQuotas(params *viper.Viper) (*gentleman.Response, map[string]interface server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/quota" + url := server + "/instance/{id}:stop" + url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Put().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -10064,9 +10114,9 @@ func XListQuotas(params *viper.Viper) (*gentleman.Response, map[string]interface return resp, decoded, nil } -// XGetQuota Retrieve Resource Quota -func XGetQuota(paramEntity string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-quota" +// XRevertInstanceToSnapshot Revert a snapshot for an instance +func XRevertInstanceToSnapshot(paramInstanceId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "revert-instance-to-snapshot" if xSubcommand { handlerPath = "x " + handlerPath } @@ -10076,10 +10126,14 @@ func XGetQuota(paramEntity string, params *viper.Viper) (*gentleman.Response, ma server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/quota/{entity}" - url = strings.Replace(url, "{entity}", paramEntity, 1) + url := server + "/instance/{instance-id}:revert-snapshot" + url = strings.Replace(url, "{instance-id}", paramInstanceId, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Post().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -10106,9 +10160,9 @@ func XGetQuota(paramEntity string, params *viper.Viper) (*gentleman.Response, ma return resp, decoded, nil } -// XDeleteReverseDnsElasticIp Delete the PTR DNS record for an elastic IP -func XDeleteReverseDnsElasticIp(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-reverse-dns-elastic-ip" +// XCreateKmsKey [BETA] Create KMS Key +func XCreateKmsKey(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-kms-key" if xSubcommand { handlerPath = "x " + handlerPath } @@ -10118,10 +10172,13 @@ func XDeleteReverseDnsElasticIp(paramId string, params *viper.Viper) (*gentleman server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/reverse-dns/elastic-ip/{id}" - url = strings.Replace(url, "{id}", paramId, 1) + url := server + "/kms-key" - req := cli.Client.Delete().URL(url) + req := cli.Client.Post().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -10148,9 +10205,9 @@ func XDeleteReverseDnsElasticIp(paramId string, params *viper.Viper) (*gentleman return resp, decoded, nil } -// XGetReverseDnsElasticIp Query the PTR DNS records for an elastic IP -func XGetReverseDnsElasticIp(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-reverse-dns-elastic-ip" +// XListKmsKeys [BETA] List KMS Keys +func XListKmsKeys(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-kms-keys" if xSubcommand { handlerPath = "x " + handlerPath } @@ -10160,8 +10217,7 @@ func XGetReverseDnsElasticIp(paramId string, params *viper.Viper) (*gentleman.Re server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/reverse-dns/elastic-ip/{id}" - url = strings.Replace(url, "{id}", paramId, 1) + url := server + "/kms-key" req := cli.Client.Get().URL(url) @@ -10190,9 +10246,9 @@ func XGetReverseDnsElasticIp(paramId string, params *viper.Viper) (*gentleman.Re return resp, decoded, nil } -// XUpdateReverseDnsElasticIp Update/Create the PTR DNS record for an elastic IP -func XUpdateReverseDnsElasticIp(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "update-reverse-dns-elastic-ip" +// XGetKmsKey [BETA] Get KMS Key +func XGetKmsKey(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-kms-key" if xSubcommand { handlerPath = "x " + handlerPath } @@ -10202,14 +10258,10 @@ func XUpdateReverseDnsElasticIp(paramId string, params *viper.Viper, body string server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/reverse-dns/elastic-ip/{id}" + url := server + "/kms-key/{id}" url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Post().URL(url) - - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -10236,9 +10288,9 @@ func XUpdateReverseDnsElasticIp(paramId string, params *viper.Viper, body string return resp, decoded, nil } -// XDeleteReverseDnsInstance Delete the PTR DNS record for an instance -func XDeleteReverseDnsInstance(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-reverse-dns-instance" +// XCancelKmsKeyDeletion [Beta] Cancel KMS Key Deletion +func XCancelKmsKeyDeletion(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "cancel-kms-key-deletion" if xSubcommand { handlerPath = "x " + handlerPath } @@ -10248,10 +10300,14 @@ func XDeleteReverseDnsInstance(paramId string, params *viper.Viper) (*gentleman. server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/reverse-dns/instance/{id}" + url := server + "/kms-key/{id}/cancel-deletion" url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Delete().URL(url) + req := cli.Client.Post().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -10278,9 +10334,9 @@ func XDeleteReverseDnsInstance(paramId string, params *viper.Viper) (*gentleman. return resp, decoded, nil } -// XGetReverseDnsInstance Query the PTR DNS records for an instance -func XGetReverseDnsInstance(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-reverse-dns-instance" +// XDecrypt [BETA] Decrypt +func XDecrypt(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "decrypt" if xSubcommand { handlerPath = "x " + handlerPath } @@ -10290,10 +10346,14 @@ func XGetReverseDnsInstance(paramId string, params *viper.Viper) (*gentleman.Res server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/reverse-dns/instance/{id}" + url := server + "/kms-key/{id}/decrypt" url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Post().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -10320,9 +10380,9 @@ func XGetReverseDnsInstance(paramId string, params *viper.Viper) (*gentleman.Res return resp, decoded, nil } -// XUpdateReverseDnsInstance Update/Create the PTR DNS record for an instance -func XUpdateReverseDnsInstance(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "update-reverse-dns-instance" +// XDisableKmsKey [BETA] Disable KMS Key +func XDisableKmsKey(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "disable-kms-key" if xSubcommand { handlerPath = "x " + handlerPath } @@ -10332,13 +10392,13 @@ func XUpdateReverseDnsInstance(paramId string, params *viper.Viper, body string) server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/reverse-dns/instance/{id}" + url := server + "/kms-key/{id}/disable" url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Post().URL(url) if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) + req = req.AddHeader("Content-Type", "").BodyString(body) } cli.HandleBefore(handlerPath, params, req) @@ -10366,9 +10426,9 @@ func XUpdateReverseDnsInstance(paramId string, params *viper.Viper, body string) return resp, decoded, nil } -// XCreateSecurityGroup Create a Security Group -func XCreateSecurityGroup(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-security-group" +// XDisableKmsKeyRotation [BETA] Disable Key Rotation +func XDisableKmsKeyRotation(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "disable-kms-key-rotation" if xSubcommand { handlerPath = "x " + handlerPath } @@ -10378,7 +10438,8 @@ func XCreateSecurityGroup(params *viper.Viper, body string) (*gentleman.Response server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/security-group" + url := server + "/kms-key/{id}/disable-key-rotation" + url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Post().URL(url) @@ -10411,9 +10472,9 @@ func XCreateSecurityGroup(params *viper.Viper, body string) (*gentleman.Response return resp, decoded, nil } -// XListSecurityGroups List Security Groups. -func XListSecurityGroups(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "list-security-groups" +// XEnableKmsKey [BETA] Enable KMS Key +func XEnableKmsKey(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "enable-kms-key" if xSubcommand { handlerPath = "x " + handlerPath } @@ -10423,13 +10484,13 @@ func XListSecurityGroups(params *viper.Viper) (*gentleman.Response, map[string]i server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/security-group" + url := server + "/kms-key/{id}/enable" + url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Post().URL(url) - paramVisibility := params.GetString("visibility") - if paramVisibility != "" { - req = req.AddQuery("visibility", fmt.Sprintf("%v", paramVisibility)) + if body != "" { + req = req.AddHeader("Content-Type", "").BodyString(body) } cli.HandleBefore(handlerPath, params, req) @@ -10457,9 +10518,9 @@ func XListSecurityGroups(params *viper.Viper) (*gentleman.Response, map[string]i return resp, decoded, nil } -// XDeleteSecurityGroup Delete a Security Group -func XDeleteSecurityGroup(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-security-group" +// XEnableKmsKeyRotation [BETA] Enable Key Rotation +func XEnableKmsKeyRotation(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "enable-kms-key-rotation" if xSubcommand { handlerPath = "x " + handlerPath } @@ -10469,10 +10530,14 @@ func XDeleteSecurityGroup(paramId string, params *viper.Viper) (*gentleman.Respo server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/security-group/{id}" + url := server + "/kms-key/{id}/enable-key-rotation" url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Delete().URL(url) + req := cli.Client.Post().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -10499,9 +10564,9 @@ func XDeleteSecurityGroup(paramId string, params *viper.Viper) (*gentleman.Respo return resp, decoded, nil } -// XGetSecurityGroup Retrieve Security Group details -func XGetSecurityGroup(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-security-group" +// XEncrypt [BETA] Encrypt +func XEncrypt(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "encrypt" if xSubcommand { handlerPath = "x " + handlerPath } @@ -10511,10 +10576,14 @@ func XGetSecurityGroup(paramId string, params *viper.Viper) (*gentleman.Response server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/security-group/{id}" + url := server + "/kms-key/{id}/encrypt" url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Post().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -10541,9 +10610,9 @@ func XGetSecurityGroup(paramId string, params *viper.Viper) (*gentleman.Response return resp, decoded, nil } -// XAddRuleToSecurityGroup Create a Security Group rule -func XAddRuleToSecurityGroup(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "add-rule-to-security-group" +// XGenerateDataKey [BETA] Generate Data Key +func XGenerateDataKey(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "generate-data-key" if xSubcommand { handlerPath = "x " + handlerPath } @@ -10553,7 +10622,7 @@ func XAddRuleToSecurityGroup(paramId string, params *viper.Viper, body string) ( server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/security-group/{id}/rules" + url := server + "/kms-key/{id}/generate-data-key" url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Post().URL(url) @@ -10587,9 +10656,9 @@ func XAddRuleToSecurityGroup(paramId string, params *viper.Viper, body string) ( return resp, decoded, nil } -// XDeleteRuleFromSecurityGroup Delete a Security Group rule -func XDeleteRuleFromSecurityGroup(paramId string, paramRuleId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-rule-from-security-group" +// XListKmsKeyRotations [BETA] List KMS Key Rotations +func XListKmsKeyRotations(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-kms-key-rotations" if xSubcommand { handlerPath = "x " + handlerPath } @@ -10599,11 +10668,10 @@ func XDeleteRuleFromSecurityGroup(paramId string, paramRuleId string, params *vi server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/security-group/{id}/rules/{rule-id}" + url := server + "/kms-key/{id}/list-key-rotations" url = strings.Replace(url, "{id}", paramId, 1) - url = strings.Replace(url, "{rule-id}", paramRuleId, 1) - req := cli.Client.Delete().URL(url) + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -10630,9 +10698,9 @@ func XDeleteRuleFromSecurityGroup(paramId string, paramRuleId string, params *vi return resp, decoded, nil } -// XAddExternalSourceToSecurityGroup Add an external source as a member of a Security Group -func XAddExternalSourceToSecurityGroup(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "add-external-source-to-security-group" +// XReEncrypt [BETA] Re-encrypt +func XReEncrypt(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "re-encrypt" if xSubcommand { handlerPath = "x " + handlerPath } @@ -10642,10 +10710,10 @@ func XAddExternalSourceToSecurityGroup(paramId string, params *viper.Viper, body server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/security-group/{id}:add-source" + url := server + "/kms-key/{id}/re-encrypt" url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Put().URL(url) + req := cli.Client.Post().URL(url) if body != "" { req = req.AddHeader("Content-Type", "application/json").BodyString(body) @@ -10676,9 +10744,9 @@ func XAddExternalSourceToSecurityGroup(paramId string, params *viper.Viper, body return resp, decoded, nil } -// XAttachInstanceToSecurityGroup Attach a Compute instance to a Security Group -func XAttachInstanceToSecurityGroup(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "attach-instance-to-security-group" +// XReplicateKmsKey [BETA] Replicate KMS Key +func XReplicateKmsKey(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "replicate-kms-key" if xSubcommand { handlerPath = "x " + handlerPath } @@ -10688,10 +10756,10 @@ func XAttachInstanceToSecurityGroup(paramId string, params *viper.Viper, body st server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/security-group/{id}:attach" + url := server + "/kms-key/{id}/replicate" url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Put().URL(url) + req := cli.Client.Post().URL(url) if body != "" { req = req.AddHeader("Content-Type", "application/json").BodyString(body) @@ -10722,9 +10790,9 @@ func XAttachInstanceToSecurityGroup(paramId string, params *viper.Viper, body st return resp, decoded, nil } -// XDetachInstanceFromSecurityGroup Detach a Compute instance from a Security Group -func XDetachInstanceFromSecurityGroup(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "detach-instance-from-security-group" +// XRotateKmsKey [BETA] Rotate Key +func XRotateKmsKey(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "rotate-kms-key" if xSubcommand { handlerPath = "x " + handlerPath } @@ -10734,13 +10802,13 @@ func XDetachInstanceFromSecurityGroup(paramId string, params *viper.Viper, body server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/security-group/{id}:detach" + url := server + "/kms-key/{id}/rotate" url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Put().URL(url) + req := cli.Client.Post().URL(url) if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) + req = req.AddHeader("Content-Type", "").BodyString(body) } cli.HandleBefore(handlerPath, params, req) @@ -10768,9 +10836,9 @@ func XDetachInstanceFromSecurityGroup(paramId string, params *viper.Viper, body return resp, decoded, nil } -// XRemoveExternalSourceFromSecurityGroup Remove an external source from a Security Group -func XRemoveExternalSourceFromSecurityGroup(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "remove-external-source-from-security-group" +// XScheduleKmsKeyDeletion [BETA] Schedule KMS Key Deletion +func XScheduleKmsKeyDeletion(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "schedule-kms-key-deletion" if xSubcommand { handlerPath = "x " + handlerPath } @@ -10780,10 +10848,10 @@ func XRemoveExternalSourceFromSecurityGroup(paramId string, params *viper.Viper, server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/security-group/{id}:remove-source" + url := server + "/kms-key/{id}/schedule-deletion" url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Put().URL(url) + req := cli.Client.Post().URL(url) if body != "" { req = req.AddHeader("Content-Type", "application/json").BodyString(body) @@ -10814,9 +10882,9 @@ func XRemoveExternalSourceFromSecurityGroup(paramId string, params *viper.Viper, return resp, decoded, nil } -// XCreateSksCluster Create an SKS cluster -func XCreateSksCluster(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-sks-cluster" +// XCreateLoadBalancer Create a Load Balancer +func XCreateLoadBalancer(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-load-balancer" if xSubcommand { handlerPath = "x " + handlerPath } @@ -10826,7 +10894,7 @@ func XCreateSksCluster(params *viper.Viper, body string) (*gentleman.Response, m server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/sks-cluster" + url := server + "/load-balancer" req := cli.Client.Post().URL(url) @@ -10859,9 +10927,9 @@ func XCreateSksCluster(params *viper.Viper, body string) (*gentleman.Response, m return resp, decoded, nil } -// XListSksClusters List SKS clusters -func XListSksClusters(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "list-sks-clusters" +// XListLoadBalancers List Load Balancers +func XListLoadBalancers(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-load-balancers" if xSubcommand { handlerPath = "x " + handlerPath } @@ -10871,7 +10939,7 @@ func XListSksClusters(params *viper.Viper) (*gentleman.Response, map[string]inte server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/sks-cluster" + url := server + "/load-balancer" req := cli.Client.Get().URL(url) @@ -10900,9 +10968,9 @@ func XListSksClusters(params *viper.Viper) (*gentleman.Response, map[string]inte return resp, decoded, nil } -// XListSksClusterDeprecatedResources Resources that are scheduled to be removed in future kubernetes releases -func XListSksClusterDeprecatedResources(paramId string, params *viper.Viper) (*gentleman.Response, interface{}, error) { - handlerPath := "list-sks-cluster-deprecated-resources" +// XDeleteLoadBalancer Delete a Load Balancer +func XDeleteLoadBalancer(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-load-balancer" if xSubcommand { handlerPath = "x " + handlerPath } @@ -10912,10 +10980,10 @@ func XListSksClusterDeprecatedResources(paramId string, params *viper.Viper) (*g server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/sks-cluster-deprecated-resources/{id}" + url := server + "/load-balancer/{id}" url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -10924,7 +10992,7 @@ func XListSksClusterDeprecatedResources(paramId string, params *viper.Viper) (*g return nil, nil, errors.Wrap(err, "Request failed") } - var decoded interface{} + var decoded map[string]interface{} if resp.StatusCode < 400 { if err := cli.UnmarshalResponse(resp, &decoded); err != nil { @@ -10936,15 +11004,15 @@ func XListSksClusterDeprecatedResources(paramId string, params *viper.Viper) (*g after := cli.HandleAfter(handlerPath, params, resp, decoded) if after != nil { - decoded = after + decoded = after.(map[string]interface{}) } return resp, decoded, nil } -// XGenerateSksClusterKubeconfig Generate a new Kubeconfig file for a SKS cluster -func XGenerateSksClusterKubeconfig(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "generate-sks-cluster-kubeconfig" +// XGetLoadBalancer Retrieve Load Balancer details +func XGetLoadBalancer(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-load-balancer" if xSubcommand { handlerPath = "x " + handlerPath } @@ -10954,14 +11022,10 @@ func XGenerateSksClusterKubeconfig(paramId string, params *viper.Viper, body str server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/sks-cluster-kubeconfig/{id}" + url := server + "/load-balancer/{id}" url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Post().URL(url) - - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -10988,9 +11052,9 @@ func XGenerateSksClusterKubeconfig(paramId string, params *viper.Viper, body str return resp, decoded, nil } -// XListSksClusterVersions List available versions for SKS clusters -func XListSksClusterVersions(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "list-sks-cluster-versions" +// XUpdateLoadBalancer Update a Load Balancer +func XUpdateLoadBalancer(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-load-balancer" if xSubcommand { handlerPath = "x " + handlerPath } @@ -11000,13 +11064,13 @@ func XListSksClusterVersions(params *viper.Viper) (*gentleman.Response, map[stri server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/sks-cluster-version" + url := server + "/load-balancer/{id}" + url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Put().URL(url) - paramIncludeDeprecated := params.GetString("include-deprecated") - if paramIncludeDeprecated != "" { - req = req.AddQuery("include-deprecated", fmt.Sprintf("%v", paramIncludeDeprecated)) + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) } cli.HandleBefore(handlerPath, params, req) @@ -11034,9 +11098,9 @@ func XListSksClusterVersions(params *viper.Viper) (*gentleman.Response, map[stri return resp, decoded, nil } -// XDeleteSksCluster Delete an SKS cluster -func XDeleteSksCluster(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-sks-cluster" +// XAddServiceToLoadBalancer Add a Load Balancer Service +func XAddServiceToLoadBalancer(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "add-service-to-load-balancer" if xSubcommand { handlerPath = "x " + handlerPath } @@ -11046,10 +11110,14 @@ func XDeleteSksCluster(paramId string, params *viper.Viper) (*gentleman.Response server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/sks-cluster/{id}" + url := server + "/load-balancer/{id}/service" url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Delete().URL(url) + req := cli.Client.Post().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -11076,9 +11144,9 @@ func XDeleteSksCluster(paramId string, params *viper.Viper) (*gentleman.Response return resp, decoded, nil } -// XGetSksCluster Retrieve SKS cluster details -func XGetSksCluster(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-sks-cluster" +// XDeleteLoadBalancerService Delete a Load Balancer Service +func XDeleteLoadBalancerService(paramId string, paramServiceId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-load-balancer-service" if xSubcommand { handlerPath = "x " + handlerPath } @@ -11088,10 +11156,11 @@ func XGetSksCluster(paramId string, params *viper.Viper) (*gentleman.Response, m server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/sks-cluster/{id}" + url := server + "/load-balancer/{id}/service/{service-id}" url = strings.Replace(url, "{id}", paramId, 1) + url = strings.Replace(url, "{service-id}", paramServiceId, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -11118,9 +11187,9 @@ func XGetSksCluster(paramId string, params *viper.Viper) (*gentleman.Response, m return resp, decoded, nil } -// XUpdateSksCluster Update an SKS cluster -func XUpdateSksCluster(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "update-sks-cluster" +// XGetLoadBalancerService Retrieve Load Balancer Service details +func XGetLoadBalancerService(paramId string, paramServiceId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-load-balancer-service" if xSubcommand { handlerPath = "x " + handlerPath } @@ -11130,14 +11199,11 @@ func XUpdateSksCluster(paramId string, params *viper.Viper, body string) (*gentl server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/sks-cluster/{id}" + url := server + "/load-balancer/{id}/service/{service-id}" url = strings.Replace(url, "{id}", paramId, 1) + url = strings.Replace(url, "{service-id}", paramServiceId, 1) - req := cli.Client.Put().URL(url) - - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -11164,9 +11230,9 @@ func XUpdateSksCluster(paramId string, params *viper.Viper, body string) (*gentl return resp, decoded, nil } -// XGetSksClusterAuthorityCert Get the certificate for a SKS cluster authority -func XGetSksClusterAuthorityCert(paramId string, paramAuthority string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-sks-cluster-authority-cert" +// XUpdateLoadBalancerService Update a Load Balancer Service +func XUpdateLoadBalancerService(paramId string, paramServiceId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-load-balancer-service" if xSubcommand { handlerPath = "x " + handlerPath } @@ -11176,11 +11242,15 @@ func XGetSksClusterAuthorityCert(paramId string, paramAuthority string, params * server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/sks-cluster/{id}/authority/{authority}/cert" + url := server + "/load-balancer/{id}/service/{service-id}" url = strings.Replace(url, "{id}", paramId, 1) - url = strings.Replace(url, "{authority}", paramAuthority, 1) + url = strings.Replace(url, "{service-id}", paramServiceId, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Put().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -11207,9 +11277,9 @@ func XGetSksClusterAuthorityCert(paramId string, paramAuthority string, params * return resp, decoded, nil } -// XGetSksClusterInspection Get the latest inspection result -func XGetSksClusterInspection(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-sks-cluster-inspection" +// XResetLoadBalancerServiceField Reset a Load Balancer Service field to its default value +func XResetLoadBalancerServiceField(paramId string, paramServiceId string, paramField string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "reset-load-balancer-service-field" if xSubcommand { handlerPath = "x " + handlerPath } @@ -11219,10 +11289,12 @@ func XGetSksClusterInspection(paramId string, params *viper.Viper) (*gentleman.R server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/sks-cluster/{id}/inspection" + url := server + "/load-balancer/{id}/service/{service-id}/{field}" url = strings.Replace(url, "{id}", paramId, 1) + url = strings.Replace(url, "{service-id}", paramServiceId, 1) + url = strings.Replace(url, "{field}", paramField, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -11249,9 +11321,9 @@ func XGetSksClusterInspection(paramId string, params *viper.Viper) (*gentleman.R return resp, decoded, nil } -// XCreateSksNodepool Create a new SKS Nodepool -func XCreateSksNodepool(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-sks-nodepool" +// XResetLoadBalancerField Reset a Load Balancer field to its default value +func XResetLoadBalancerField(paramId string, paramField string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "reset-load-balancer-field" if xSubcommand { handlerPath = "x " + handlerPath } @@ -11261,14 +11333,11 @@ func XCreateSksNodepool(paramId string, params *viper.Viper, body string) (*gent server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/sks-cluster/{id}/nodepool" + url := server + "/load-balancer/{id}/{field}" url = strings.Replace(url, "{id}", paramId, 1) + url = strings.Replace(url, "{field}", paramField, 1) - req := cli.Client.Post().URL(url) - - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -11295,9 +11364,9 @@ func XCreateSksNodepool(paramId string, params *viper.Viper, body string) (*gent return resp, decoded, nil } -// XDeleteSksNodepool Delete an SKS Nodepool -func XDeleteSksNodepool(paramId string, paramSksNodepoolId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-sks-nodepool" +// XGetOperation Retrieve Operation details +func XGetOperation(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-operation" if xSubcommand { handlerPath = "x " + handlerPath } @@ -11307,11 +11376,10 @@ func XDeleteSksNodepool(paramId string, paramSksNodepoolId string, params *viper server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/sks-cluster/{id}/nodepool/{sks-nodepool-id}" + url := server + "/operation/{id}" url = strings.Replace(url, "{id}", paramId, 1) - url = strings.Replace(url, "{sks-nodepool-id}", paramSksNodepoolId, 1) - req := cli.Client.Delete().URL(url) + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -11338,9 +11406,9 @@ func XDeleteSksNodepool(paramId string, paramSksNodepoolId string, params *viper return resp, decoded, nil } -// XGetSksNodepool Retrieve SKS Nodepool details -func XGetSksNodepool(paramId string, paramSksNodepoolId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-sks-nodepool" +// XGetOrganization Retrieve an organization +func XGetOrganization(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-organization" if xSubcommand { handlerPath = "x " + handlerPath } @@ -11350,9 +11418,7 @@ func XGetSksNodepool(paramId string, paramSksNodepoolId string, params *viper.Vi server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/sks-cluster/{id}/nodepool/{sks-nodepool-id}" - url = strings.Replace(url, "{id}", paramId, 1) - url = strings.Replace(url, "{sks-nodepool-id}", paramSksNodepoolId, 1) + url := server + "/organization" req := cli.Client.Get().URL(url) @@ -11381,9 +11447,9 @@ func XGetSksNodepool(paramId string, paramSksNodepoolId string, params *viper.Vi return resp, decoded, nil } -// XUpdateSksNodepool Update an SKS Nodepool -func XUpdateSksNodepool(paramId string, paramSksNodepoolId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "update-sks-nodepool" +// XCreatePrivateNetwork Create a Private Network +func XCreatePrivateNetwork(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-private-network" if xSubcommand { handlerPath = "x " + handlerPath } @@ -11393,11 +11459,9 @@ func XUpdateSksNodepool(paramId string, paramSksNodepoolId string, params *viper server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/sks-cluster/{id}/nodepool/{sks-nodepool-id}" - url = strings.Replace(url, "{id}", paramId, 1) - url = strings.Replace(url, "{sks-nodepool-id}", paramSksNodepoolId, 1) + url := server + "/private-network" - req := cli.Client.Put().URL(url) + req := cli.Client.Post().URL(url) if body != "" { req = req.AddHeader("Content-Type", "application/json").BodyString(body) @@ -11428,9 +11492,9 @@ func XUpdateSksNodepool(paramId string, paramSksNodepoolId string, params *viper return resp, decoded, nil } -// XResetSksNodepoolField Reset an SKS Nodepool field to its default value -func XResetSksNodepoolField(paramId string, paramSksNodepoolId string, paramField string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "reset-sks-nodepool-field" +// XListPrivateNetworks List Private Networks +func XListPrivateNetworks(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-private-networks" if xSubcommand { handlerPath = "x " + handlerPath } @@ -11440,12 +11504,9 @@ func XResetSksNodepoolField(paramId string, paramSksNodepoolId string, paramFiel server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/sks-cluster/{id}/nodepool/{sks-nodepool-id}/{field}" - url = strings.Replace(url, "{id}", paramId, 1) - url = strings.Replace(url, "{sks-nodepool-id}", paramSksNodepoolId, 1) - url = strings.Replace(url, "{field}", paramField, 1) + url := server + "/private-network" - req := cli.Client.Delete().URL(url) + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -11472,9 +11533,9 @@ func XResetSksNodepoolField(paramId string, paramSksNodepoolId string, paramFiel return resp, decoded, nil } -// XEvictSksNodepoolMembers Evict Nodepool members -func XEvictSksNodepoolMembers(paramId string, paramSksNodepoolId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "evict-sks-nodepool-members" +// XDeletePrivateNetwork Delete a Private Network +func XDeletePrivateNetwork(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-private-network" if xSubcommand { handlerPath = "x " + handlerPath } @@ -11484,15 +11545,10 @@ func XEvictSksNodepoolMembers(paramId string, paramSksNodepoolId string, params server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/sks-cluster/{id}/nodepool/{sks-nodepool-id}:evict" + url := server + "/private-network/{id}" url = strings.Replace(url, "{id}", paramId, 1) - url = strings.Replace(url, "{sks-nodepool-id}", paramSksNodepoolId, 1) - - req := cli.Client.Put().URL(url) - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -11519,9 +11575,9 @@ func XEvictSksNodepoolMembers(paramId string, paramSksNodepoolId string, params return resp, decoded, nil } -// XScaleSksNodepool Scale a SKS Nodepool -func XScaleSksNodepool(paramId string, paramSksNodepoolId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "scale-sks-nodepool" +// XGetPrivateNetwork Retrieve Private Network details +func XGetPrivateNetwork(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-private-network" if xSubcommand { handlerPath = "x " + handlerPath } @@ -11531,15 +11587,10 @@ func XScaleSksNodepool(paramId string, paramSksNodepoolId string, params *viper. server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/sks-cluster/{id}/nodepool/{sks-nodepool-id}:scale" + url := server + "/private-network/{id}" url = strings.Replace(url, "{id}", paramId, 1) - url = strings.Replace(url, "{sks-nodepool-id}", paramSksNodepoolId, 1) - req := cli.Client.Put().URL(url) - - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -11566,9 +11617,9 @@ func XScaleSksNodepool(paramId string, paramSksNodepoolId string, params *viper. return resp, decoded, nil } -// XRotateSksCcmCredentials Rotate Exoscale CCM credentials -func XRotateSksCcmCredentials(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "rotate-sks-ccm-credentials" +// XUpdatePrivateNetwork Update a Private Network +func XUpdatePrivateNetwork(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-private-network" if xSubcommand { handlerPath = "x " + handlerPath } @@ -11578,13 +11629,13 @@ func XRotateSksCcmCredentials(paramId string, params *viper.Viper, body string) server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/sks-cluster/{id}/rotate-ccm-credentials" + url := server + "/private-network/{id}" url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Put().URL(url) if body != "" { - req = req.AddHeader("Content-Type", "").BodyString(body) + req = req.AddHeader("Content-Type", "application/json").BodyString(body) } cli.HandleBefore(handlerPath, params, req) @@ -11612,9 +11663,9 @@ func XRotateSksCcmCredentials(paramId string, params *viper.Viper, body string) return resp, decoded, nil } -// XRotateSksCsiCredentials Rotate Exoscale CSI credentials -func XRotateSksCsiCredentials(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "rotate-sks-csi-credentials" +// XResetPrivateNetworkField Reset Private Network field +func XResetPrivateNetworkField(paramId string, paramField string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "reset-private-network-field" if xSubcommand { handlerPath = "x " + handlerPath } @@ -11624,14 +11675,11 @@ func XRotateSksCsiCredentials(paramId string, params *viper.Viper, body string) server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/sks-cluster/{id}/rotate-csi-credentials" + url := server + "/private-network/{id}/{field}" url = strings.Replace(url, "{id}", paramId, 1) + url = strings.Replace(url, "{field}", paramField, 1) - req := cli.Client.Put().URL(url) - - if body != "" { - req = req.AddHeader("Content-Type", "").BodyString(body) - } + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -11658,9 +11706,9 @@ func XRotateSksCsiCredentials(paramId string, params *viper.Viper, body string) return resp, decoded, nil } -// XRotateSksOperatorsCa Rotate operators certificate authority -func XRotateSksOperatorsCa(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "rotate-sks-operators-ca" +// XAttachInstanceToPrivateNetwork Attach a Compute instance to a Private Network +func XAttachInstanceToPrivateNetwork(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "attach-instance-to-private-network" if xSubcommand { handlerPath = "x " + handlerPath } @@ -11670,13 +11718,13 @@ func XRotateSksOperatorsCa(paramId string, params *viper.Viper, body string) (*g server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/sks-cluster/{id}/rotate-operators-ca" + url := server + "/private-network/{id}:attach" url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Put().URL(url) if body != "" { - req = req.AddHeader("Content-Type", "").BodyString(body) + req = req.AddHeader("Content-Type", "application/json").BodyString(body) } cli.HandleBefore(handlerPath, params, req) @@ -11704,9 +11752,9 @@ func XRotateSksOperatorsCa(paramId string, params *viper.Viper, body string) (*g return resp, decoded, nil } -// XUpgradeSksCluster Upgrade an SKS cluster -func XUpgradeSksCluster(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "upgrade-sks-cluster" +// XDetachInstanceFromPrivateNetwork Detach a Compute instance from a Private Network +func XDetachInstanceFromPrivateNetwork(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "detach-instance-from-private-network" if xSubcommand { handlerPath = "x " + handlerPath } @@ -11716,7 +11764,7 @@ func XUpgradeSksCluster(paramId string, params *viper.Viper, body string) (*gent server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/sks-cluster/{id}/upgrade" + url := server + "/private-network/{id}:detach" url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Put().URL(url) @@ -11750,9 +11798,9 @@ func XUpgradeSksCluster(paramId string, params *viper.Viper, body string) (*gent return resp, decoded, nil } -// XUpgradeSksClusterServiceLevel Upgrade a SKS cluster to pro -func XUpgradeSksClusterServiceLevel(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "upgrade-sks-cluster-service-level" +// XUpdatePrivateNetworkInstanceIp Update the IP address of an instance attached to a managed private network +func XUpdatePrivateNetworkInstanceIp(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-private-network-instance-ip" if xSubcommand { handlerPath = "x " + handlerPath } @@ -11762,13 +11810,13 @@ func XUpgradeSksClusterServiceLevel(paramId string, params *viper.Viper, body st server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/sks-cluster/{id}/upgrade-service-level" + url := server + "/private-network/{id}:update-ip" url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Put().URL(url) if body != "" { - req = req.AddHeader("Content-Type", "").BodyString(body) + req = req.AddHeader("Content-Type", "application/json").BodyString(body) } cli.HandleBefore(handlerPath, params, req) @@ -11796,9 +11844,9 @@ func XUpgradeSksClusterServiceLevel(paramId string, params *viper.Viper, body st return resp, decoded, nil } -// XResetSksClusterField Reset an SKS cluster field to its default value -func XResetSksClusterField(paramId string, paramField string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "reset-sks-cluster-field" +// XListQuotas List Organization Quotas +func XListQuotas(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-quotas" if xSubcommand { handlerPath = "x " + handlerPath } @@ -11808,11 +11856,9 @@ func XResetSksClusterField(paramId string, paramField string, params *viper.Vipe server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/sks-cluster/{id}/{field}" - url = strings.Replace(url, "{id}", paramId, 1) - url = strings.Replace(url, "{field}", paramField, 1) + url := server + "/quota" - req := cli.Client.Delete().URL(url) + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -11839,11 +11885,11 @@ func XResetSksClusterField(paramId string, paramField string, params *viper.Vipe return resp, decoded, nil } -// XListSnapshots List Snapshots -func XListSnapshots(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "list-snapshots" - if xSubcommand { - handlerPath = "x " + handlerPath +// XGetQuota Retrieve Resource Quota +func XGetQuota(paramEntity string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-quota" + if xSubcommand { + handlerPath = "x " + handlerPath } server := viper.GetString("server") @@ -11851,7 +11897,8 @@ func XListSnapshots(params *viper.Viper) (*gentleman.Response, map[string]interf server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/snapshot" + url := server + "/quota/{entity}" + url = strings.Replace(url, "{entity}", paramEntity, 1) req := cli.Client.Get().URL(url) @@ -11880,9 +11927,9 @@ func XListSnapshots(params *viper.Viper) (*gentleman.Response, map[string]interf return resp, decoded, nil } -// XDeleteSnapshot Delete a Snapshot -func XDeleteSnapshot(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-snapshot" +// XDeleteReverseDnsElasticIp Delete the PTR DNS record for an elastic IP +func XDeleteReverseDnsElasticIp(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-reverse-dns-elastic-ip" if xSubcommand { handlerPath = "x " + handlerPath } @@ -11892,7 +11939,7 @@ func XDeleteSnapshot(paramId string, params *viper.Viper) (*gentleman.Response, server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/snapshot/{id}" + url := server + "/reverse-dns/elastic-ip/{id}" url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Delete().URL(url) @@ -11922,9 +11969,9 @@ func XDeleteSnapshot(paramId string, params *viper.Viper) (*gentleman.Response, return resp, decoded, nil } -// XGetSnapshot Retrieve Snapshot details -func XGetSnapshot(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-snapshot" +// XGetReverseDnsElasticIp Query the PTR DNS records for an elastic IP +func XGetReverseDnsElasticIp(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-reverse-dns-elastic-ip" if xSubcommand { handlerPath = "x " + handlerPath } @@ -11934,7 +11981,7 @@ func XGetSnapshot(paramId string, params *viper.Viper) (*gentleman.Response, map server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/snapshot/{id}" + url := server + "/reverse-dns/elastic-ip/{id}" url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Get().URL(url) @@ -11964,9 +12011,9 @@ func XGetSnapshot(paramId string, params *viper.Viper) (*gentleman.Response, map return resp, decoded, nil } -// XExportSnapshot Export a Snapshot -func XExportSnapshot(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "export-snapshot" +// XUpdateReverseDnsElasticIp Update/Create the PTR DNS record for an elastic IP +func XUpdateReverseDnsElasticIp(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-reverse-dns-elastic-ip" if xSubcommand { handlerPath = "x " + handlerPath } @@ -11976,13 +12023,13 @@ func XExportSnapshot(paramId string, params *viper.Viper, body string) (*gentlem server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/snapshot/{id}:export" + url := server + "/reverse-dns/elastic-ip/{id}" url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Post().URL(url) if body != "" { - req = req.AddHeader("Content-Type", "").BodyString(body) + req = req.AddHeader("Content-Type", "application/json").BodyString(body) } cli.HandleBefore(handlerPath, params, req) @@ -12010,9 +12057,9 @@ func XExportSnapshot(paramId string, params *viper.Viper, body string) (*gentlem return resp, decoded, nil } -// XPromoteSnapshotToTemplate Promote a Snapshot to a Template -func XPromoteSnapshotToTemplate(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "promote-snapshot-to-template" +// XDeleteReverseDnsInstance Delete the PTR DNS record for an instance +func XDeleteReverseDnsInstance(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-reverse-dns-instance" if xSubcommand { handlerPath = "x " + handlerPath } @@ -12022,14 +12069,10 @@ func XPromoteSnapshotToTemplate(paramId string, params *viper.Viper, body string server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/snapshot/{id}:promote" + url := server + "/reverse-dns/instance/{id}" url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Post().URL(url) - - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -12056,9 +12099,9 @@ func XPromoteSnapshotToTemplate(paramId string, params *viper.Viper, body string return resp, decoded, nil } -// XListSosBucketsUsage List SOS Buckets Usage -func XListSosBucketsUsage(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "list-sos-buckets-usage" +// XGetReverseDnsInstance Query the PTR DNS records for an instance +func XGetReverseDnsInstance(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-reverse-dns-instance" if xSubcommand { handlerPath = "x " + handlerPath } @@ -12068,7 +12111,8 @@ func XListSosBucketsUsage(params *viper.Viper) (*gentleman.Response, map[string] server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/sos-buckets-usage" + url := server + "/reverse-dns/instance/{id}" + url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Get().URL(url) @@ -12097,9 +12141,9 @@ func XListSosBucketsUsage(params *viper.Viper) (*gentleman.Response, map[string] return resp, decoded, nil } -// XGetSosPresignedUrl Retrieve Presigned Download URL for SOS object -func XGetSosPresignedUrl(paramBucket string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-sos-presigned-url" +// XUpdateReverseDnsInstance Update/Create the PTR DNS record for an instance +func XUpdateReverseDnsInstance(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-reverse-dns-instance" if xSubcommand { handlerPath = "x " + handlerPath } @@ -12109,14 +12153,13 @@ func XGetSosPresignedUrl(paramBucket string, params *viper.Viper) (*gentleman.Re server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/sos/{bucket}/presigned-url" - url = strings.Replace(url, "{bucket}", paramBucket, 1) + url := server + "/reverse-dns/instance/{id}" + url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Post().URL(url) - paramKey := params.GetString("key") - if paramKey != "" { - req = req.AddQuery("key", fmt.Sprintf("%v", paramKey)) + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) } cli.HandleBefore(handlerPath, params, req) @@ -12144,9 +12187,9 @@ func XGetSosPresignedUrl(paramBucket string, params *viper.Viper) (*gentleman.Re return resp, decoded, nil } -// XListSshKeys List SSH keys -func XListSshKeys(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "list-ssh-keys" +// XCreateSecurityGroup Create a Security Group +func XCreateSecurityGroup(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-security-group" if xSubcommand { handlerPath = "x " + handlerPath } @@ -12156,9 +12199,13 @@ func XListSshKeys(params *viper.Viper) (*gentleman.Response, map[string]interfac server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/ssh-key" + url := server + "/security-group" - req := cli.Client.Get().URL(url) + req := cli.Client.Post().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -12185,9 +12232,9 @@ func XListSshKeys(params *viper.Viper) (*gentleman.Response, map[string]interfac return resp, decoded, nil } -// XRegisterSshKey Import SSH key -func XRegisterSshKey(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "register-ssh-key" +// XListSecurityGroups List Security Groups. +func XListSecurityGroups(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-security-groups" if xSubcommand { handlerPath = "x " + handlerPath } @@ -12197,12 +12244,13 @@ func XRegisterSshKey(params *viper.Viper, body string) (*gentleman.Response, map server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/ssh-key" + url := server + "/security-group" - req := cli.Client.Post().URL(url) + req := cli.Client.Get().URL(url) - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) + paramVisibility := params.GetString("visibility") + if paramVisibility != "" { + req = req.AddQuery("visibility", fmt.Sprintf("%v", paramVisibility)) } cli.HandleBefore(handlerPath, params, req) @@ -12230,9 +12278,9 @@ func XRegisterSshKey(params *viper.Viper, body string) (*gentleman.Response, map return resp, decoded, nil } -// XDeleteSshKey Delete a SSH key -func XDeleteSshKey(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-ssh-key" +// XDeleteSecurityGroup Delete a Security Group +func XDeleteSecurityGroup(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-security-group" if xSubcommand { handlerPath = "x " + handlerPath } @@ -12242,8 +12290,8 @@ func XDeleteSshKey(paramName string, params *viper.Viper) (*gentleman.Response, server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/ssh-key/{name}" - url = strings.Replace(url, "{name}", paramName, 1) + url := server + "/security-group/{id}" + url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Delete().URL(url) @@ -12272,9 +12320,9 @@ func XDeleteSshKey(paramName string, params *viper.Viper) (*gentleman.Response, return resp, decoded, nil } -// XGetSshKey Retrieve SSH key details -func XGetSshKey(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-ssh-key" +// XGetSecurityGroup Retrieve Security Group details +func XGetSecurityGroup(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-security-group" if xSubcommand { handlerPath = "x " + handlerPath } @@ -12284,8 +12332,8 @@ func XGetSshKey(paramName string, params *viper.Viper) (*gentleman.Response, map server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/ssh-key/{name}" - url = strings.Replace(url, "{name}", paramName, 1) + url := server + "/security-group/{id}" + url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Get().URL(url) @@ -12314,9 +12362,9 @@ func XGetSshKey(paramName string, params *viper.Viper) (*gentleman.Response, map return resp, decoded, nil } -// XListTemplates List Templates -func XListTemplates(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "list-templates" +// XAddRuleToSecurityGroup Create a Security Group rule +func XAddRuleToSecurityGroup(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "add-rule-to-security-group" if xSubcommand { handlerPath = "x " + handlerPath } @@ -12326,17 +12374,13 @@ func XListTemplates(params *viper.Viper) (*gentleman.Response, map[string]interf server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/template" + url := server + "/security-group/{id}/rules" + url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Post().URL(url) - paramVisibility := params.GetString("visibility") - if paramVisibility != "" { - req = req.AddQuery("visibility", fmt.Sprintf("%v", paramVisibility)) - } - paramFamily := params.GetString("family") - if paramFamily != "" { - req = req.AddQuery("family", fmt.Sprintf("%v", paramFamily)) + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) } cli.HandleBefore(handlerPath, params, req) @@ -12364,9 +12408,9 @@ func XListTemplates(params *viper.Viper) (*gentleman.Response, map[string]interf return resp, decoded, nil } -// XRegisterTemplate Register a Template -func XRegisterTemplate(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "register-template" +// XDeleteRuleFromSecurityGroup Delete a Security Group rule +func XDeleteRuleFromSecurityGroup(paramId string, paramRuleId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-rule-from-security-group" if xSubcommand { handlerPath = "x " + handlerPath } @@ -12376,13 +12420,11 @@ func XRegisterTemplate(params *viper.Viper, body string) (*gentleman.Response, m server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/template" - - req := cli.Client.Post().URL(url) + url := server + "/security-group/{id}/rules/{rule-id}" + url = strings.Replace(url, "{id}", paramId, 1) + url = strings.Replace(url, "{rule-id}", paramRuleId, 1) - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -12409,9 +12451,9 @@ func XRegisterTemplate(params *viper.Viper, body string) (*gentleman.Response, m return resp, decoded, nil } -// XCopyTemplate Copy a Template from a zone to another -func XCopyTemplate(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "copy-template" +// XAddExternalSourceToSecurityGroup Add an external source as a member of a Security Group +func XAddExternalSourceToSecurityGroup(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "add-external-source-to-security-group" if xSubcommand { handlerPath = "x " + handlerPath } @@ -12421,10 +12463,10 @@ func XCopyTemplate(paramId string, params *viper.Viper, body string) (*gentleman server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/template/{id}" + url := server + "/security-group/{id}:add-source" url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Post().URL(url) + req := cli.Client.Put().URL(url) if body != "" { req = req.AddHeader("Content-Type", "application/json").BodyString(body) @@ -12455,9 +12497,9 @@ func XCopyTemplate(paramId string, params *viper.Viper, body string) (*gentleman return resp, decoded, nil } -// XDeleteTemplate Delete a Template -func XDeleteTemplate(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-template" +// XAttachInstanceToSecurityGroup Attach a Compute instance to a Security Group +func XAttachInstanceToSecurityGroup(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "attach-instance-to-security-group" if xSubcommand { handlerPath = "x " + handlerPath } @@ -12467,10 +12509,14 @@ func XDeleteTemplate(paramId string, params *viper.Viper) (*gentleman.Response, server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/template/{id}" + url := server + "/security-group/{id}:attach" url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Delete().URL(url) + req := cli.Client.Put().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -12497,9 +12543,9 @@ func XDeleteTemplate(paramId string, params *viper.Viper) (*gentleman.Response, return resp, decoded, nil } -// XGetTemplate Retrieve Template details -func XGetTemplate(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-template" +// XDetachInstanceFromSecurityGroup Detach a Compute instance from a Security Group +func XDetachInstanceFromSecurityGroup(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "detach-instance-from-security-group" if xSubcommand { handlerPath = "x " + handlerPath } @@ -12509,10 +12555,14 @@ func XGetTemplate(paramId string, params *viper.Viper) (*gentleman.Response, map server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/template/{id}" + url := server + "/security-group/{id}:detach" url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Put().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -12539,9 +12589,9 @@ func XGetTemplate(paramId string, params *viper.Viper) (*gentleman.Response, map return resp, decoded, nil } -// XUpdateTemplate Update template attributes -func XUpdateTemplate(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "update-template" +// XRemoveExternalSourceFromSecurityGroup Remove an external source from a Security Group +func XRemoveExternalSourceFromSecurityGroup(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "remove-external-source-from-security-group" if xSubcommand { handlerPath = "x " + handlerPath } @@ -12551,7 +12601,7 @@ func XUpdateTemplate(paramId string, params *viper.Viper, body string) (*gentlem server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/template/{id}" + url := server + "/security-group/{id}:remove-source" url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Put().URL(url) @@ -12585,9 +12635,9 @@ func XUpdateTemplate(paramId string, params *viper.Viper, body string) (*gentlem return resp, decoded, nil } -// XGetUsageReport Retrieve organization usage reports -func XGetUsageReport(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-usage-report" +// XCreateSksCluster Create an SKS cluster +func XCreateSksCluster(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-sks-cluster" if xSubcommand { handlerPath = "x " + handlerPath } @@ -12597,13 +12647,12 @@ func XGetUsageReport(params *viper.Viper) (*gentleman.Response, map[string]inter server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/usage-report" + url := server + "/sks-cluster" - req := cli.Client.Get().URL(url) + req := cli.Client.Post().URL(url) - paramPeriod := params.GetString("period") - if paramPeriod != "" { - req = req.AddQuery("period", fmt.Sprintf("%v", paramPeriod)) + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) } cli.HandleBefore(handlerPath, params, req) @@ -12631,9 +12680,9 @@ func XGetUsageReport(params *viper.Viper) (*gentleman.Response, map[string]inter return resp, decoded, nil } -// XCreateUser Create a User -func XCreateUser(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-user" +// XListSksClusters List SKS clusters +func XListSksClusters(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-sks-clusters" if xSubcommand { handlerPath = "x " + handlerPath } @@ -12643,13 +12692,9 @@ func XCreateUser(params *viper.Viper, body string) (*gentleman.Response, map[str server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/user" - - req := cli.Client.Post().URL(url) + url := server + "/sks-cluster" - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -12676,9 +12721,9 @@ func XCreateUser(params *viper.Viper, body string) (*gentleman.Response, map[str return resp, decoded, nil } -// XListUsers List Users -func XListUsers(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "list-users" +// XListSksClusterDeprecatedResources Resources that are scheduled to be removed in future kubernetes releases +func XListSksClusterDeprecatedResources(paramId string, params *viper.Viper) (*gentleman.Response, interface{}, error) { + handlerPath := "list-sks-cluster-deprecated-resources" if xSubcommand { handlerPath = "x " + handlerPath } @@ -12688,7 +12733,8 @@ func XListUsers(params *viper.Viper) (*gentleman.Response, map[string]interface{ server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/user" + url := server + "/sks-cluster-deprecated-resources/{id}" + url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Get().URL(url) @@ -12699,7 +12745,7 @@ func XListUsers(params *viper.Viper) (*gentleman.Response, map[string]interface{ return nil, nil, errors.Wrap(err, "Request failed") } - var decoded map[string]interface{} + var decoded interface{} if resp.StatusCode < 400 { if err := cli.UnmarshalResponse(resp, &decoded); err != nil { @@ -12711,15 +12757,15 @@ func XListUsers(params *viper.Viper) (*gentleman.Response, map[string]interface{ after := cli.HandleAfter(handlerPath, params, resp, decoded) if after != nil { - decoded = after.(map[string]interface{}) + decoded = after } return resp, decoded, nil } -// XDeleteUser Delete User -func XDeleteUser(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-user" +// XGenerateSksClusterKubeconfig Generate a new Kubeconfig file for a SKS cluster +func XGenerateSksClusterKubeconfig(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "generate-sks-cluster-kubeconfig" if xSubcommand { handlerPath = "x " + handlerPath } @@ -12729,10 +12775,14 @@ func XDeleteUser(paramId string, params *viper.Viper) (*gentleman.Response, map[ server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/user/{id}" + url := server + "/sks-cluster-kubeconfig/{id}" url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Delete().URL(url) + req := cli.Client.Post().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -12759,107 +12809,3343 @@ func XDeleteUser(paramId string, params *viper.Viper) (*gentleman.Response, map[ return resp, decoded, nil } -// XUpdateUserRole Update a User's IAM role -func XUpdateUserRole(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "update-user-role" +// XListSksClusterVersions List available versions for SKS clusters +func XListSksClusterVersions(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-sks-cluster-versions" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/sks-cluster-version" + + req := cli.Client.Get().URL(url) + + paramIncludeDeprecated := params.GetString("include-deprecated") + if paramIncludeDeprecated != "" { + req = req.AddQuery("include-deprecated", fmt.Sprintf("%v", paramIncludeDeprecated)) + } + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XDeleteSksCluster Delete an SKS cluster +func XDeleteSksCluster(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-sks-cluster" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/sks-cluster/{id}" + url = strings.Replace(url, "{id}", paramId, 1) + + req := cli.Client.Delete().URL(url) + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XGetSksCluster Retrieve SKS cluster details +func XGetSksCluster(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-sks-cluster" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/sks-cluster/{id}" + url = strings.Replace(url, "{id}", paramId, 1) + + req := cli.Client.Get().URL(url) + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XUpdateSksCluster Update an SKS cluster +func XUpdateSksCluster(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-sks-cluster" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/sks-cluster/{id}" + url = strings.Replace(url, "{id}", paramId, 1) + + req := cli.Client.Put().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XGetSksClusterAuthorityCert Get the certificate for a SKS cluster authority +func XGetSksClusterAuthorityCert(paramId string, paramAuthority string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-sks-cluster-authority-cert" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/sks-cluster/{id}/authority/{authority}/cert" + url = strings.Replace(url, "{id}", paramId, 1) + url = strings.Replace(url, "{authority}", paramAuthority, 1) + + req := cli.Client.Get().URL(url) + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XGetSksClusterInspection Get the latest inspection result +func XGetSksClusterInspection(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-sks-cluster-inspection" if xSubcommand { handlerPath = "x " + handlerPath } - server := viper.GetString("server") - if server == "" { - server = xServers()[viper.GetInt("server-index")]["url"] - } + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/sks-cluster/{id}/inspection" + url = strings.Replace(url, "{id}", paramId, 1) + + req := cli.Client.Get().URL(url) + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XCreateSksNodepool Create a new SKS Nodepool +func XCreateSksNodepool(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-sks-nodepool" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/sks-cluster/{id}/nodepool" + url = strings.Replace(url, "{id}", paramId, 1) + + req := cli.Client.Post().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XDeleteSksNodepool Delete an SKS Nodepool +func XDeleteSksNodepool(paramId string, paramSksNodepoolId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-sks-nodepool" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/sks-cluster/{id}/nodepool/{sks-nodepool-id}" + url = strings.Replace(url, "{id}", paramId, 1) + url = strings.Replace(url, "{sks-nodepool-id}", paramSksNodepoolId, 1) + + req := cli.Client.Delete().URL(url) + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XGetSksNodepool Retrieve SKS Nodepool details +func XGetSksNodepool(paramId string, paramSksNodepoolId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-sks-nodepool" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/sks-cluster/{id}/nodepool/{sks-nodepool-id}" + url = strings.Replace(url, "{id}", paramId, 1) + url = strings.Replace(url, "{sks-nodepool-id}", paramSksNodepoolId, 1) + + req := cli.Client.Get().URL(url) + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XUpdateSksNodepool Update an SKS Nodepool +func XUpdateSksNodepool(paramId string, paramSksNodepoolId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-sks-nodepool" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/sks-cluster/{id}/nodepool/{sks-nodepool-id}" + url = strings.Replace(url, "{id}", paramId, 1) + url = strings.Replace(url, "{sks-nodepool-id}", paramSksNodepoolId, 1) + + req := cli.Client.Put().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XEvictSksNodepoolMembers Evict Nodepool members +func XEvictSksNodepoolMembers(paramId string, paramSksNodepoolId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "evict-sks-nodepool-members" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/sks-cluster/{id}/nodepool/{sks-nodepool-id}:evict" + url = strings.Replace(url, "{id}", paramId, 1) + url = strings.Replace(url, "{sks-nodepool-id}", paramSksNodepoolId, 1) + + req := cli.Client.Put().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XScaleSksNodepool Scale a SKS Nodepool +func XScaleSksNodepool(paramId string, paramSksNodepoolId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "scale-sks-nodepool" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/sks-cluster/{id}/nodepool/{sks-nodepool-id}:scale" + url = strings.Replace(url, "{id}", paramId, 1) + url = strings.Replace(url, "{sks-nodepool-id}", paramSksNodepoolId, 1) + + req := cli.Client.Put().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XRotateSksCcmCredentials Rotate Exoscale CCM credentials +func XRotateSksCcmCredentials(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "rotate-sks-ccm-credentials" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/sks-cluster/{id}/rotate-ccm-credentials" + url = strings.Replace(url, "{id}", paramId, 1) + + req := cli.Client.Put().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "").BodyString(body) + } + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XRotateSksCsiCredentials Rotate Exoscale CSI credentials +func XRotateSksCsiCredentials(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "rotate-sks-csi-credentials" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/sks-cluster/{id}/rotate-csi-credentials" + url = strings.Replace(url, "{id}", paramId, 1) + + req := cli.Client.Put().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "").BodyString(body) + } + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XRotateSksKarpenterCredentials Rotate Exoscale Karpenter credentials +func XRotateSksKarpenterCredentials(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "rotate-sks-karpenter-credentials" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/sks-cluster/{id}/rotate-karpenter-credentials" + url = strings.Replace(url, "{id}", paramId, 1) + + req := cli.Client.Put().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "").BodyString(body) + } + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XRotateSksOperatorsCa Rotate operators certificate authority +func XRotateSksOperatorsCa(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "rotate-sks-operators-ca" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/sks-cluster/{id}/rotate-operators-ca" + url = strings.Replace(url, "{id}", paramId, 1) + + req := cli.Client.Put().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "").BodyString(body) + } + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XUpgradeSksCluster Upgrade an SKS cluster +func XUpgradeSksCluster(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "upgrade-sks-cluster" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/sks-cluster/{id}/upgrade" + url = strings.Replace(url, "{id}", paramId, 1) + + req := cli.Client.Put().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XUpgradeSksClusterServiceLevel Upgrade a SKS cluster to pro +func XUpgradeSksClusterServiceLevel(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "upgrade-sks-cluster-service-level" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/sks-cluster/{id}/upgrade-service-level" + url = strings.Replace(url, "{id}", paramId, 1) + + req := cli.Client.Put().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "").BodyString(body) + } + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XGetActiveNodepoolTemplate get-active-nodepool-template +func XGetActiveNodepoolTemplate(paramKubeVersion string, paramVariant string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-active-nodepool-template" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/sks-template/{kube-version}/{variant}" + url = strings.Replace(url, "{kube-version}", paramKubeVersion, 1) + url = strings.Replace(url, "{variant}", paramVariant, 1) + + req := cli.Client.Get().URL(url) + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XListSnapshots List Snapshots +func XListSnapshots(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-snapshots" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/snapshot" + + req := cli.Client.Get().URL(url) + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XDeleteSnapshot Delete a Snapshot +func XDeleteSnapshot(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-snapshot" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/snapshot/{id}" + url = strings.Replace(url, "{id}", paramId, 1) + + req := cli.Client.Delete().URL(url) + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XGetSnapshot Retrieve Snapshot details +func XGetSnapshot(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-snapshot" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/snapshot/{id}" + url = strings.Replace(url, "{id}", paramId, 1) + + req := cli.Client.Get().URL(url) + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XExportSnapshot Export a Snapshot +func XExportSnapshot(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "export-snapshot" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/snapshot/{id}:export" + url = strings.Replace(url, "{id}", paramId, 1) + + req := cli.Client.Post().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "").BodyString(body) + } + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XPromoteSnapshotToTemplate Promote a Snapshot to a Template +func XPromoteSnapshotToTemplate(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "promote-snapshot-to-template" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/snapshot/{id}:promote" + url = strings.Replace(url, "{id}", paramId, 1) + + req := cli.Client.Post().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XListSosBucketsUsage List SOS Buckets Usage +func XListSosBucketsUsage(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-sos-buckets-usage" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/sos-buckets-usage" + + req := cli.Client.Get().URL(url) + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XGetSosPresignedUrl Retrieve Presigned Download URL for SOS object +func XGetSosPresignedUrl(paramBucket string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-sos-presigned-url" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/sos/{bucket}/presigned-url" + url = strings.Replace(url, "{bucket}", paramBucket, 1) + + req := cli.Client.Get().URL(url) + + paramKey := params.GetString("key") + if paramKey != "" { + req = req.AddQuery("key", fmt.Sprintf("%v", paramKey)) + } + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XListSshKeys List SSH keys +func XListSshKeys(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-ssh-keys" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/ssh-key" + + req := cli.Client.Get().URL(url) + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XRegisterSshKey Import SSH key +func XRegisterSshKey(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "register-ssh-key" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/ssh-key" + + req := cli.Client.Post().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XDeleteSshKey Delete a SSH key +func XDeleteSshKey(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-ssh-key" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/ssh-key/{name}" + url = strings.Replace(url, "{name}", paramName, 1) + + req := cli.Client.Delete().URL(url) + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XGetSshKey Retrieve SSH key details +func XGetSshKey(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-ssh-key" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/ssh-key/{name}" + url = strings.Replace(url, "{name}", paramName, 1) + + req := cli.Client.Get().URL(url) + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XListTemplates List Templates +func XListTemplates(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-templates" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/template" + + req := cli.Client.Get().URL(url) + + paramVisibility := params.GetString("visibility") + if paramVisibility != "" { + req = req.AddQuery("visibility", fmt.Sprintf("%v", paramVisibility)) + } + paramFamily := params.GetString("family") + if paramFamily != "" { + req = req.AddQuery("family", fmt.Sprintf("%v", paramFamily)) + } + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XRegisterTemplate Register a Template +func XRegisterTemplate(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "register-template" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/template" + + req := cli.Client.Post().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XCopyTemplate Copy a Template from a zone to another +func XCopyTemplate(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "copy-template" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/template/{id}" + url = strings.Replace(url, "{id}", paramId, 1) + + req := cli.Client.Post().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XDeleteTemplate Delete a Template +func XDeleteTemplate(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-template" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/template/{id}" + url = strings.Replace(url, "{id}", paramId, 1) + + req := cli.Client.Delete().URL(url) + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XGetTemplate Retrieve Template details +func XGetTemplate(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-template" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/template/{id}" + url = strings.Replace(url, "{id}", paramId, 1) + + req := cli.Client.Get().URL(url) + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XUpdateTemplate Update template attributes +func XUpdateTemplate(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-template" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/template/{id}" + url = strings.Replace(url, "{id}", paramId, 1) + + req := cli.Client.Put().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XGetUsageReport Retrieve organization usage reports +func XGetUsageReport(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-usage-report" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/usage-report" + + req := cli.Client.Get().URL(url) + + paramPeriod := params.GetString("period") + if paramPeriod != "" { + req = req.AddQuery("period", fmt.Sprintf("%v", paramPeriod)) + } + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XCreateUser Create a User +func XCreateUser(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-user" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/user" + + req := cli.Client.Post().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XListUsers List Users +func XListUsers(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-users" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/user" + + req := cli.Client.Get().URL(url) + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XDeleteUser Delete User +func XDeleteUser(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-user" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/user/{id}" + url = strings.Replace(url, "{id}", paramId, 1) + + req := cli.Client.Delete().URL(url) + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XUpdateUserRole Update a User's IAM role +func XUpdateUserRole(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-user-role" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/user/{id}" + url = strings.Replace(url, "{id}", paramId, 1) + + req := cli.Client.Put().URL(url) + + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) + } + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +// XListZones List Zones +func XListZones(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-zones" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/zone" + + req := cli.Client.Get().URL(url) + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") + } + + var decoded map[string]interface{} + + if resp.StatusCode < 400 { + if err := cli.UnmarshalResponse(resp, &decoded); err != nil { + return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + } + } else { + return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) + } + + after := cli.HandleAfter(handlerPath, params, resp, decoded) + if after != nil { + decoded = after.(map[string]interface{}) + } + + return resp, decoded, nil +} + +func xRegister(subcommand bool) { + root := cli.Root + + if subcommand { + root = &cobra.Command{ + Use: "x", + Short: "Exoscale API", + Long: cli.Markdown("Infrastructure automation API, allowing programmatic access to all Exoscale products and services."), + } + xSubcommand = true + } else { + cli.Root.Short = "Exoscale API" + cli.Root.Long = cli.Markdown("Infrastructure automation API, allowing programmatic access to all Exoscale products and services.") + } + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "create-deployment", + Short: "[BETA] Create Deployment", + Long: cli.Markdown("Deploy a model on an inference server\n## Request Schema (application/json)\n\ndescription: Deployment an AI model onto a set of GPUs\nproperties:\n gpu-count:\n description: Number of GPUs (1-8)\n format: int64\n minimum: 1\n type: integer\n gpu-type:\n description: GPU type family (e.g., gpua5000, gpu3080ti)\n type: string\n inference-engine-parameters:\n description: Optional extra inference engine server CLI args\n items:\n type: string\n type: array\n inference-engine-version:\n $ref: '#/components/schemas/inference-engine-version'\n model:\n $ref: '#/components/schemas/model-ref'\n name:\n description: Deployment name\n minLength: 1\n type: string\n replicas:\n description: Number of replicas (>=1)\n format: int64\n minimum: 1\n type: integer\nrequired:\n- model\n- name\n- gpu-type\n- gpu-count\n- replicas\ntype: object\n"), + Example: examples, + Args: cobra.MinimumNArgs(0), + Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[0:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } + + _, decoded, err := XCreateDeployment(params, body) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, + } + + root.AddCommand(cmd) + + cli.SetCustomFlags(cmd) + + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } + + }() + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "list-deployments", + Short: "[BETA] List Deployments", + Long: cli.Markdown("List Deployments"), + Example: examples, + Args: cobra.MinimumNArgs(0), + Run: func(cmd *cobra.Command, args []string) { + + _, decoded, err := XListDeployments(params) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, + } + + root.AddCommand(cmd) + + cli.SetCustomFlags(cmd) + + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } + + }() + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "delete-deployment id", + Short: "[BETA] Delete Deployment", + Long: cli.Markdown("Delete Deployment"), + Example: examples, + Args: cobra.MinimumNArgs(1), + Run: func(cmd *cobra.Command, args []string) { + + _, decoded, err := XDeleteDeployment(args[0], params) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, + } + + root.AddCommand(cmd) + + cli.SetCustomFlags(cmd) + + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } + + }() + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "get-deployment id", + Short: "[BETA] Get Deployment", + Long: cli.Markdown("Get Deployment details"), + Example: examples, + Args: cobra.MinimumNArgs(1), + Run: func(cmd *cobra.Command, args []string) { + + _, decoded, err := XGetDeployment(args[0], params) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, + } + + root.AddCommand(cmd) + + cli.SetCustomFlags(cmd) + + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } + + }() + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "update-deployment id", + Short: "update-deployment", + Long: cli.Markdown("Update AI deployment\n## Request Schema (application/json)\n\ndescription: Update AI deployment\nproperties:\n inference-engine-parameters:\n description: Optional extra inference engine server CLI args\n items:\n type: string\n type: array\n inference-engine-version:\n $ref: '#/components/schemas/inference-engine-version'\n name:\n description: Deployment name\n minLength: 1\n type: string\ntype: object\n"), + Example: examples, + Args: cobra.MinimumNArgs(1), + Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } + + _, decoded, err := XUpdateDeployment(args[0], params, body) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, + } + + root.AddCommand(cmd) + + cli.SetCustomFlags(cmd) + + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } + + }() + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "reveal-deployment-api-key id", + Short: "[BETA] Reveal Deployment API Key", + Long: cli.Markdown("Get Deployment API Key"), + Example: examples, + Args: cobra.MinimumNArgs(1), + Run: func(cmd *cobra.Command, args []string) { + + _, decoded, err := XRevealDeploymentApiKey(args[0], params) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, + } + + root.AddCommand(cmd) + + cli.SetCustomFlags(cmd) + + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } + + }() + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "get-deployment-logs id", + Short: "[BETA] Get Deployment Logs", + Long: cli.Markdown("Return logs for the vLLM deployment (deploy/--deployment-vllm). Optional ?stream=true to request streaming (may not be supported)."), + Example: examples, + Args: cobra.MinimumNArgs(1), + Run: func(cmd *cobra.Command, args []string) { + + _, decoded, err := XGetDeploymentLogs(args[0], params) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, + } + + root.AddCommand(cmd) + + cmd.Flags().String("stream", "", "") + cmd.Flags().Int64("tail", 0, "") + + cli.SetCustomFlags(cmd) + + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } + + }() + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "scale-deployment id", + Short: "[BETA] Scale Deployment", + Long: cli.Markdown("Scale Deployment\n## Request Schema (application/json)\n\ndescription: Scale AI deployment\nproperties:\n replicas:\n description: Number of replicas (>=0)\n format: int64\n minimum: 0\n type: integer\nrequired:\n- replicas\ntype: object\n"), + Example: examples, + Args: cobra.MinimumNArgs(1), + Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } + + _, decoded, err := XScaleDeployment(args[0], params, body) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, + } + + root.AddCommand(cmd) + + cli.SetCustomFlags(cmd) + + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } + + }() + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "get-inference-engine-help", + Short: "[BETA] Get inference-engine Help", + Long: cli.Markdown("Get list of allowed inference engine parameters with their descriptions and allowed values"), + Example: examples, + Args: cobra.MinimumNArgs(0), + Run: func(cmd *cobra.Command, args []string) { + + _, decoded, err := XGetInferenceEngineHelp(params) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, + } + + root.AddCommand(cmd) + + cmd.Flags().String("version", "", "") + + cli.SetCustomFlags(cmd) + + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } + + }() + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "list-ai-instance-types", + Short: "List Instance Types", + Long: cli.Markdown("List available instance types with authorization status based on GPU availability"), + Example: examples, + Args: cobra.MinimumNArgs(0), + Run: func(cmd *cobra.Command, args []string) { + + _, decoded, err := XListAiInstanceTypes(params) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, + } + + root.AddCommand(cmd) + + cli.SetCustomFlags(cmd) + + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } + + }() + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "create-model", + Short: "[BETA] Create Model", + Long: cli.Markdown("Model files will be downloaded from Huggingface.\n\nName must be the exact name of the model on huggingface (ex: openai/gpt-oss-120b or ggml-org/gpt-oss-120b-GGUF).\n\nIf the model is under a license then you must provide a Huggingface access token for an account that signed the license agreement\n## Request Schema (application/json)\n\ndescription: AI model\nproperties:\n huggingface-token:\n description: Huggingface Token\n type: string\n name:\n description: Model name\n minLength: 1\n type: string\nrequired:\n- name\ntype: object\n"), + Example: examples, + Args: cobra.MinimumNArgs(0), + Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[0:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } + + _, decoded, err := XCreateModel(params, body) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, + } + + root.AddCommand(cmd) + + cli.SetCustomFlags(cmd) + + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } + + }() + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "list-models", + Short: "[BETA] List Models", + Long: cli.Markdown("List Models"), + Example: examples, + Args: cobra.MinimumNArgs(0), + Run: func(cmd *cobra.Command, args []string) { + + _, decoded, err := XListModels(params) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, + } + + root.AddCommand(cmd) + + cli.SetCustomFlags(cmd) + + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } + + }() + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "delete-model id", + Short: "[BETA] Delete Model", + Long: cli.Markdown("Delete Model"), + Example: examples, + Args: cobra.MinimumNArgs(1), + Run: func(cmd *cobra.Command, args []string) { + + _, decoded, err := XDeleteModel(args[0], params) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, + } + + root.AddCommand(cmd) + + cli.SetCustomFlags(cmd) + + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } + + }() + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "get-model id", + Short: "[BETA] Get Model", + Long: cli.Markdown("Get Model details"), + Example: examples, + Args: cobra.MinimumNArgs(1), + Run: func(cmd *cobra.Command, args []string) { + + _, decoded, err := XGetModel(args[0], params) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, + } + + root.AddCommand(cmd) + + cli.SetCustomFlags(cmd) + + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } + + }() + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "create-anti-affinity-group", + Short: "Create an Anti-affinity Group", + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n description:\n description: Anti-affinity Group description\n maxLength: 255\n type: string\n name:\n description: Anti-affinity Group name\n maxLength: 255\n minLength: 1\n type: string\nrequired:\n- name\ntype: object\n"), + Example: examples, + Args: cobra.MinimumNArgs(0), + Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[0:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } + + _, decoded, err := XCreateAntiAffinityGroup(params, body) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, + } + + root.AddCommand(cmd) + + cli.SetCustomFlags(cmd) + + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } + + }() + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "list-anti-affinity-groups", + Short: "List Anti-affinity Groups", + Long: cli.Markdown(""), + Example: examples, + Args: cobra.MinimumNArgs(0), + Run: func(cmd *cobra.Command, args []string) { + + _, decoded, err := XListAntiAffinityGroups(params) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, + } + + root.AddCommand(cmd) + + cli.SetCustomFlags(cmd) + + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } + + }() + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "delete-anti-affinity-group id", + Short: "Delete an Anti-affinity Group", + Long: cli.Markdown(""), + Example: examples, + Args: cobra.MinimumNArgs(1), + Run: func(cmd *cobra.Command, args []string) { + + _, decoded, err := XDeleteAntiAffinityGroup(args[0], params) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, + } + + root.AddCommand(cmd) + + cli.SetCustomFlags(cmd) + + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } + + }() + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "get-anti-affinity-group id", + Short: "Retrieve Anti-affinity Group details", + Long: cli.Markdown(""), + Example: examples, + Args: cobra.MinimumNArgs(1), + Run: func(cmd *cobra.Command, args []string) { + + _, decoded, err := XGetAntiAffinityGroup(args[0], params) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, + } + + root.AddCommand(cmd) + + cli.SetCustomFlags(cmd) + + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } + + }() + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "create-api-key", + Short: "Create a new API key", + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n name:\n description: IAM API Key Name\n maxLength: 255\n minLength: 1\n type: string\n role-id:\n description: IAM API Key Role ID\n format: uuid\n type: string\nrequired:\n- role-id\n- name\ntype: object\n"), + Example: examples, + Args: cobra.MinimumNArgs(0), + Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[0:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } + + _, decoded, err := XCreateApiKey(params, body) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, + } + + root.AddCommand(cmd) + + cli.SetCustomFlags(cmd) + + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } + + }() + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "list-api-keys", + Short: "List API keys", + Long: cli.Markdown(""), + Example: examples, + Args: cobra.MinimumNArgs(0), + Run: func(cmd *cobra.Command, args []string) { + + _, decoded, err := XListApiKeys(params) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, + } + + root.AddCommand(cmd) + + cli.SetCustomFlags(cmd) + + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } + + }() + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "delete-api-key id", + Short: "Delete an API key", + Long: cli.Markdown(""), + Example: examples, + Args: cobra.MinimumNArgs(1), + Run: func(cmd *cobra.Command, args []string) { + + _, decoded, err := XDeleteApiKey(args[0], params) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, + } + + root.AddCommand(cmd) + + cli.SetCustomFlags(cmd) + + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } + + }() + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "get-api-key id", + Short: "Get API key", + Long: cli.Markdown(""), + Example: examples, + Args: cobra.MinimumNArgs(1), + Run: func(cmd *cobra.Command, args []string) { + + _, decoded, err := XGetApiKey(args[0], params) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, + } + + root.AddCommand(cmd) + + cli.SetCustomFlags(cmd) + + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } + + }() + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "create-block-storage-volume", + Short: "Create a block storage volume", + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n block-storage-snapshot:\n $ref: '#/components/schemas/block-storage-snapshot-ref'\n labels:\n $ref: '#/components/schemas/labels'\n name:\n description: Volume name\n maxLength: 255\n type: string\n size:\n description: |-\n Volume size in GiB.\n When a snapshot ID is supplied, this defaults to the size of the source volume, but can be set to a larger value.\n format: int64\n minimum: 1\n type: integer\ntype: object\n"), + Example: examples, + Args: cobra.MinimumNArgs(0), + Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[0:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } + + _, decoded, err := XCreateBlockStorageVolume(params, body) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, + } + + root.AddCommand(cmd) + + cli.SetCustomFlags(cmd) + + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } + + }() + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "list-block-storage-volumes", + Short: "List block storage volumes", + Long: cli.Markdown(""), + Example: examples, + Args: cobra.MinimumNArgs(0), + Run: func(cmd *cobra.Command, args []string) { + + _, decoded, err := XListBlockStorageVolumes(params) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, + } + + root.AddCommand(cmd) + + cmd.Flags().String("instance-id", "", "") + + cli.SetCustomFlags(cmd) + + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } + + }() + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "list-block-storage-snapshots", + Short: "List block storage snapshots", + Long: cli.Markdown(""), + Example: examples, + Args: cobra.MinimumNArgs(0), + Run: func(cmd *cobra.Command, args []string) { + + _, decoded, err := XListBlockStorageSnapshots(params) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, + } + + root.AddCommand(cmd) + + cli.SetCustomFlags(cmd) + + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } + + }() + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "delete-block-storage-snapshot id", + Short: "Delete a block storage snapshot, data will be unrecoverable", + Long: cli.Markdown(""), + Example: examples, + Args: cobra.MinimumNArgs(1), + Run: func(cmd *cobra.Command, args []string) { + + _, decoded, err := XDeleteBlockStorageSnapshot(args[0], params) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, + } + + root.AddCommand(cmd) + + cli.SetCustomFlags(cmd) + + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } + + }() + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "get-block-storage-snapshot id", + Short: "Retrieve block storage snapshot details", + Long: cli.Markdown(""), + Example: examples, + Args: cobra.MinimumNArgs(1), + Run: func(cmd *cobra.Command, args []string) { + + _, decoded, err := XGetBlockStorageSnapshot(args[0], params) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, + } + + root.AddCommand(cmd) + + cli.SetCustomFlags(cmd) + + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } + + }() + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "update-block-storage-snapshot id", + Short: "Update block storage volume snapshot", + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n labels:\n $ref: '#/components/schemas/labels'\n name:\n description: Snapshot name\n maxLength: 255\n nullable: true\n type: string\ntype: object\n"), + Example: examples, + Args: cobra.MinimumNArgs(1), + Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } + + _, decoded, err := XUpdateBlockStorageSnapshot(args[0], params, body) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, + } + + root.AddCommand(cmd) + + cli.SetCustomFlags(cmd) + + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } + + }() + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "delete-block-storage-volume id", + Short: "Delete a block storage volume, data will be unrecoverable", + Long: cli.Markdown(""), + Example: examples, + Args: cobra.MinimumNArgs(1), + Run: func(cmd *cobra.Command, args []string) { + + _, decoded, err := XDeleteBlockStorageVolume(args[0], params) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, + } + + root.AddCommand(cmd) + + cli.SetCustomFlags(cmd) + + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } + + }() + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "get-block-storage-volume id", + Short: "Retrieve block storage volume details", + Long: cli.Markdown(""), + Example: examples, + Args: cobra.MinimumNArgs(1), + Run: func(cmd *cobra.Command, args []string) { + + _, decoded, err := XGetBlockStorageVolume(args[0], params) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, + } + + root.AddCommand(cmd) + + cli.SetCustomFlags(cmd) + + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } + + }() + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "update-block-storage-volume id", + Short: "Update block storage volume", + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n labels:\n $ref: '#/components/schemas/labels'\n name:\n description: Volume name\n maxLength: 255\n nullable: true\n type: string\ntype: object\n"), + Example: examples, + Args: cobra.MinimumNArgs(1), + Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } + + _, decoded, err := XUpdateBlockStorageVolume(args[0], params, body) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, + } + + root.AddCommand(cmd) + + cli.SetCustomFlags(cmd) + + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } + + }() + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "attach-block-storage-volume-to-instance id", + Short: "Attach block storage volume to an instance", + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n instance:\n $ref: '#/components/schemas/instance-ref'\nrequired:\n- instance\ntype: object\n"), + Example: examples, + Args: cobra.MinimumNArgs(1), + Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } + + _, decoded, err := XAttachBlockStorageVolumeToInstance(args[0], params, body) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, + } + + root.AddCommand(cmd) + + cli.SetCustomFlags(cmd) + + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } + + }() + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "create-block-storage-snapshot id", + Short: "Create a block storage snapshot", + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n labels:\n $ref: '#/components/schemas/labels'\n name:\n description: Snapshot name\n maxLength: 255\n minLength: 1\n type: string\ntype: object\n"), + Example: examples, + Args: cobra.MinimumNArgs(1), + Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } + + _, decoded, err := XCreateBlockStorageSnapshot(args[0], params, body) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, + } + + root.AddCommand(cmd) + + cli.SetCustomFlags(cmd) + + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } + + }() + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "detach-block-storage-volume id", + Short: "Detach block storage volume", + Long: cli.Markdown(""), + Example: examples, + Args: cobra.MinimumNArgs(1), + Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } + + _, decoded, err := XDetachBlockStorageVolume(args[0], params, body) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, + } + + root.AddCommand(cmd) + + cli.SetCustomFlags(cmd) + + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } + + }() + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "resize-block-storage-volume id", + Short: "Resize a block storage volume", + Long: cli.Markdown("This operation resizes a Block storage volume. Note: the volume can only grow, cannot be shrunk. Only detached volumes or volumes attached to stopped instances can be resized.\n## Request Schema (application/json)\n\nproperties:\n size:\n description: Volume size in GiB\n exclusiveMinimum: true\n format: int64\n minimum: 0\n type: integer\nrequired:\n- size\ntype: object\n"), + Example: examples, + Args: cobra.MinimumNArgs(1), + Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } + + _, decoded, err := XResizeBlockStorageVolume(args[0], params, body) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, + } + + root.AddCommand(cmd) + + cli.SetCustomFlags(cmd) + + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } + + }() + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "get-console-proxy-url id", + Short: "Retrieve signed url valid for 60 seconds to connect via console-proxy websocket to VM VNC console.", + Long: cli.Markdown(""), + Example: examples, + Args: cobra.MinimumNArgs(1), + Run: func(cmd *cobra.Command, args []string) { + + _, decoded, err := XGetConsoleProxyUrl(args[0], params) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, + } + + root.AddCommand(cmd) + + cli.SetCustomFlags(cmd) + + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } + + }() + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "get-dbaas-ca-certificate", + Short: "Get DBaaS CA Certificate", + Long: cli.Markdown("Returns a CA Certificate required to reach a DBaaS service through a TLS-protected connection."), + Example: examples, + Args: cobra.MinimumNArgs(0), + Run: func(cmd *cobra.Command, args []string) { + + _, decoded, err := XGetDbaasCaCertificate(params) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, + } + + root.AddCommand(cmd) + + cli.SetCustomFlags(cmd) + + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } + + }() + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "delete-dbaas-external-endpoint-datadog endpoint-id", + Short: "delete-dbaas-external-endpoint-datadog", + Long: cli.Markdown("[BETA] Delete DataDog external integration endpoint"), + Example: examples, + Args: cobra.MinimumNArgs(1), + Run: func(cmd *cobra.Command, args []string) { + + _, decoded, err := XDeleteDbaasExternalEndpointDatadog(args[0], params) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, + } + + root.AddCommand(cmd) - url := server + "/user/{id}" - url = strings.Replace(url, "{id}", paramId, 1) + cli.SetCustomFlags(cmd) - req := cli.Client.Put().URL(url) + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + }() - cli.HandleBefore(handlerPath, params, req) + func() { + params := viper.New() - resp, err := req.Do() - if err != nil { - return nil, nil, errors.Wrap(err, "Request failed") - } + var examples string - var decoded map[string]interface{} + cmd := &cobra.Command{ + Use: "get-dbaas-external-endpoint-datadog endpoint-id", + Short: "get-dbaas-external-endpoint-datadog", + Long: cli.Markdown("[BETA] Get DataDog external endpoint settings"), + Example: examples, + Args: cobra.MinimumNArgs(1), + Run: func(cmd *cobra.Command, args []string) { - if resp.StatusCode < 400 { - if err := cli.UnmarshalResponse(resp, &decoded); err != nil { - return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + _, decoded, err := XGetDbaasExternalEndpointDatadog(args[0], params) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, } - } else { - return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) - } - after := cli.HandleAfter(handlerPath, params, resp, decoded) - if after != nil { - decoded = after.(map[string]interface{}) - } + root.AddCommand(cmd) - return resp, decoded, nil -} + cli.SetCustomFlags(cmd) -// XListZones List Zones -func XListZones(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "list-zones" - if xSubcommand { - handlerPath = "x " + handlerPath - } + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } - server := viper.GetString("server") - if server == "" { - server = xServers()[viper.GetInt("server-index")]["url"] - } + }() - url := server + "/zone" + func() { + params := viper.New() - req := cli.Client.Get().URL(url) + var examples string - cli.HandleBefore(handlerPath, params, req) + cmd := &cobra.Command{ + Use: "update-dbaas-external-endpoint-datadog endpoint-id", + Short: "update-dbaas-external-endpoint-datadog", + Long: cli.Markdown("[BETA] Update DataDog external integration endpoint\n## Request Schema (application/json)\n\nproperties:\n settings:\n properties:\n datadog-api-key:\n description: Datadog API key\n maxLength: 256\n minLength: 1\n pattern: ^[A-Za-z0-9]{1,256}$\n type: string\n datadog-tags:\n description: Custom tags provided by user\n items:\n $ref: '#/components/schemas/dbaas-datadog-tag'\n type: array\n disable-consumer-stats:\n description: Disable kafka consumer group metrics. Applies only when attached to kafka services.\n type: boolean\n kafka-consumer-check-instances:\n description: Number of separate instances to fetch kafka consumer statistics with. Applies only when attached to kafka services.\n format: int64\n maximum: 100\n minimum: 1\n type: integer\n kafka-consumer-stats-timeout:\n description: Number of seconds that datadog will wait to get consumer statistics from brokers. Applies only when attached to kafka services.\n format: int64\n maximum: 300\n minimum: 2\n type: integer\n max-partition-contexts:\n description: Maximum number of partition contexts to send. Applies only when attached to kafka services.\n format: int64\n maximum: 200000\n minimum: 200\n type: integer\n site:\n $ref: '#/components/schemas/enum-datadog-site'\n required:\n - datadog-api-key\n type: object\ntype: object\n"), + Example: examples, + Args: cobra.MinimumNArgs(1), + Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - resp, err := req.Do() - if err != nil { - return nil, nil, errors.Wrap(err, "Request failed") - } + _, decoded, err := XUpdateDbaasExternalEndpointDatadog(args[0], params, body) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } - var decoded map[string]interface{} + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } - if resp.StatusCode < 400 { - if err := cli.UnmarshalResponse(resp, &decoded); err != nil { - return nil, nil, errors.Wrap(err, "Unmarshalling response failed") + }, } - } else { - return nil, nil, errors.Errorf("HTTP %d: %s", resp.StatusCode, resp.String()) - } - - after := cli.HandleAfter(handlerPath, params, resp, decoded) - if after != nil { - decoded = after.(map[string]interface{}) - } - return resp, decoded, nil -} + root.AddCommand(cmd) -func xRegister(subcommand bool) { - root := cli.Root + cli.SetCustomFlags(cmd) - if subcommand { - root = &cobra.Command{ - Use: "x", - Short: "Exoscale Public API", - Long: cli.Markdown("\nInfrastructure automation API, allowing programmatic access to all Exoscale products and services.\n\nThe [OpenAPI Specification](http://spec.openapis.org/oas/v3.0.3.html) source of this documentation can be obtained here:\n\n* [JSON format](https://openapi-v2.exoscale.com/source.json)\n* [YAML format](https://openapi-v2.exoscale.com/source.yaml)"), + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) } - xSubcommand = true - } else { - cli.Root.Short = "Exoscale Public API" - cli.Root.Long = cli.Markdown("\nInfrastructure automation API, allowing programmatic access to all Exoscale products and services.\n\nThe [OpenAPI Specification](http://spec.openapis.org/oas/v3.0.3.html) source of this documentation can be obtained here:\n\n* [JSON format](https://openapi-v2.exoscale.com/source.json)\n* [YAML format](https://openapi-v2.exoscale.com/source.yaml)") - } + + }() func() { params := viper.New() @@ -12867,18 +16153,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "create-anti-affinity-group", - Short: "Create an Anti-affinity Group", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n description:\n description: Anti-affinity Group description\n maxLength: 255\n type: string\n name:\n description: Anti-affinity Group name\n maxLength: 255\n minLength: 1\n type: string\nrequired:\n- name\ntype: object\n"), + Use: "create-dbaas-external-endpoint-datadog name", + Short: "create-dbaas-external-endpoint-datadog", + Long: cli.Markdown("[BETA] Create DataDog external integration endpoint\n## Request Schema (application/json)\n\nproperties:\n settings:\n properties:\n datadog-api-key:\n description: Datadog API key\n maxLength: 256\n minLength: 1\n pattern: ^[A-Za-z0-9]{1,256}$\n type: string\n datadog-tags:\n description: Custom tags provided by user\n items:\n $ref: '#/components/schemas/dbaas-datadog-tag'\n type: array\n disable-consumer-stats:\n description: Disable kafka consumer group metrics. Applies only when attached to kafka services.\n type: boolean\n kafka-consumer-check-instances:\n description: Number of separate instances to fetch kafka consumer statistics with. Applies only when attached to kafka services.\n format: int64\n maximum: 100\n minimum: 1\n type: integer\n kafka-consumer-stats-timeout:\n description: Number of seconds that datadog will wait to get consumer statistics from brokers. Applies only when attached to kafka services.\n format: int64\n maximum: 300\n minimum: 2\n type: integer\n max-partition-contexts:\n description: Maximum number of partition contexts to send. Applies only when attached to kafka services.\n format: int64\n maximum: 200000\n minimum: 200\n type: integer\n site:\n $ref: '#/components/schemas/enum-datadog-site'\n required:\n - datadog-api-key\n - site\n type: object\ntype: object\n"), Example: examples, - Args: cobra.MinimumNArgs(0), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[0:]) + body, err := cli.GetBody("application/json", args[1:]) if err != nil { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XCreateAntiAffinityGroup(params, body) + _, decoded, err := XCreateDbaasExternalEndpointDatadog(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -12906,14 +16192,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "list-anti-affinity-groups", - Short: "List Anti-affinity Groups", - Long: cli.Markdown(""), + Use: "delete-dbaas-external-endpoint-elasticsearch endpoint-id", + Short: "delete-dbaas-external-endpoint-elasticsearch", + Long: cli.Markdown("[BETA] Delete ElasticSearch logs external integration endpoint"), Example: examples, - Args: cobra.MinimumNArgs(0), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XListAntiAffinityGroups(params) + _, decoded, err := XDeleteDbaasExternalEndpointElasticsearch(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -12941,14 +16227,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "delete-anti-affinity-group id", - Short: "Delete an Anti-affinity Group", - Long: cli.Markdown(""), + Use: "get-dbaas-external-endpoint-elasticsearch endpoint-id", + Short: "get-dbaas-external-endpoint-elasticsearch", + Long: cli.Markdown("[BETA] Get ElasticSearch Logs external integration endpoint settings"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XDeleteAntiAffinityGroup(args[0], params) + _, decoded, err := XGetDbaasExternalEndpointElasticsearch(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -12976,14 +16262,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-anti-affinity-group id", - Short: "Retrieve Anti-affinity Group details", - Long: cli.Markdown(""), + Use: "update-dbaas-external-endpoint-elasticsearch endpoint-id", + Short: "update-dbaas-external-endpoint-elasticsearch", + Long: cli.Markdown("[BETA] Update ElasticSearch Logs external integration endpoint\n## Request Schema (application/json)\n\nproperties:\n settings:\n properties:\n ca:\n description: PEM encoded CA certificate\n maxLength: 16384\n type: string\n index-days-max:\n description: Maximum number of days of logs to keep\n format: int64\n maximum: 10000\n minimum: 1\n type: integer\n index-prefix:\n description: Elasticsearch index prefix\n maxLength: 1000\n minLength: 1\n pattern: ^[a-z0-9][a-z0-9-_.]+$\n type: string\n timeout:\n description: Elasticsearch request timeout limit\n format: int64\n maximum: 120\n minimum: 10\n type: integer\n url:\n description: Elasticsearch connection URL\n maxLength: 2048\n minLength: 12\n type: string\n type: object\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XGetAntiAffinityGroup(args[0], params) + _, decoded, err := XUpdateDbaasExternalEndpointElasticsearch(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -13011,18 +16301,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "create-api-key", - Short: "Create a new API key", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n name:\n description: IAM API Key Name\n maxLength: 255\n minLength: 1\n type: string\n role-id:\n description: IAM API Key Role ID\n format: uuid\n type: string\nrequired:\n- role-id\n- name\ntype: object\n"), + Use: "create-dbaas-external-endpoint-elasticsearch name", + Short: "create-dbaas-external-endpoint-elasticsearch", + Long: cli.Markdown("[BETA] Create ElasticSearch Logs external integration endpoint\n## Request Schema (application/json)\n\nproperties:\n settings:\n properties:\n ca:\n description: PEM encoded CA certificate\n maxLength: 16384\n type: string\n index-days-max:\n description: Maximum number of days of logs to keep\n format: int64\n maximum: 10000\n minimum: 1\n type: integer\n index-prefix:\n description: Elasticsearch index prefix\n maxLength: 1000\n minLength: 1\n pattern: ^[a-z0-9][a-z0-9-_.]+$\n type: string\n timeout:\n description: Elasticsearch request timeout limit\n format: int64\n maximum: 120\n minimum: 10\n type: integer\n url:\n description: Elasticsearch connection URL\n maxLength: 2048\n minLength: 12\n type: string\n required:\n - url\n - index-prefix\n type: object\ntype: object\n"), Example: examples, - Args: cobra.MinimumNArgs(0), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[0:]) + body, err := cli.GetBody("application/json", args[1:]) if err != nil { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XCreateApiKey(params, body) + _, decoded, err := XCreateDbaasExternalEndpointElasticsearch(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -13050,14 +16340,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "list-api-keys", - Short: "List API keys", - Long: cli.Markdown(""), + Use: "delete-dbaas-external-endpoint-opensearch endpoint-id", + Short: "delete-dbaas-external-endpoint-opensearch", + Long: cli.Markdown("[BETA] Delete OpenSearch logs external integration endpoint"), Example: examples, - Args: cobra.MinimumNArgs(0), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XListApiKeys(params) + _, decoded, err := XDeleteDbaasExternalEndpointOpensearch(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -13085,14 +16375,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "delete-api-key id", - Short: "Delete an API key", - Long: cli.Markdown(""), + Use: "get-dbaas-external-endpoint-opensearch endpoint-id", + Short: "get-dbaas-external-endpoint-opensearch", + Long: cli.Markdown("[BETA] Get OpenSearch Logs external integration endpoint settings"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XDeleteApiKey(args[0], params) + _, decoded, err := XGetDbaasExternalEndpointOpensearch(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -13120,14 +16410,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-api-key id", - Short: "Get API key", - Long: cli.Markdown(""), + Use: "update-dbaas-external-endpoint-opensearch endpoint-id", + Short: "update-dbaas-external-endpoint-opensearch", + Long: cli.Markdown("[BETA] Update OpenSearch Logs external integration endpoint\n## Request Schema (application/json)\n\nproperties:\n settings:\n properties:\n ca:\n description: PEM encoded CA certificate\n maxLength: 16384\n type: string\n index-days-max:\n description: Maximum number of days of logs to keep\n format: int64\n maximum: 10000\n minimum: 1\n type: integer\n index-prefix:\n description: OpenSearch index prefix\n maxLength: 1000\n minLength: 1\n pattern: ^[a-z0-9][a-z0-9-_.]+$\n type: string\n timeout:\n description: OpenSearch request timeout limit\n format: int64\n maximum: 120\n minimum: 10\n type: integer\n url:\n description: OpenSearch connection URL\n maxLength: 2048\n minLength: 12\n type: string\n type: object\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XGetApiKey(args[0], params) + _, decoded, err := XUpdateDbaasExternalEndpointOpensearch(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -13155,18 +16449,53 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "create-block-storage-volume", - Short: "Create a block storage volume", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n block-storage-snapshot:\n $ref: '#/components/schemas/block-storage-snapshot-target'\n labels:\n $ref: '#/components/schemas/labels'\n name:\n description: Volume name\n maxLength: 255\n type: string\n size:\n description: |-\n Volume size in GiB.\n When a snapshot ID is supplied, this defaults to the size of the source volume, but can be set to a larger value.\n format: int64\n minimum: 1\n type: integer\ntype: object\n"), + Use: "create-dbaas-external-endpoint-opensearch name", + Short: "create-dbaas-external-endpoint-opensearch", + Long: cli.Markdown("[BETA] Create OpenSearch Logs external integration endpoint\n## Request Schema (application/json)\n\nproperties:\n settings:\n properties:\n ca:\n description: PEM encoded CA certificate\n maxLength: 16384\n type: string\n index-days-max:\n description: Maximum number of days of logs to keep\n format: int64\n maximum: 10000\n minimum: 1\n type: integer\n index-prefix:\n description: OpenSearch index prefix\n maxLength: 1000\n minLength: 1\n pattern: ^[a-z0-9][a-z0-9-_.]+$\n type: string\n timeout:\n description: OpenSearch request timeout limit\n format: int64\n maximum: 120\n minimum: 10\n type: integer\n url:\n description: OpenSearch connection URL\n maxLength: 2048\n minLength: 12\n type: string\n required:\n - url\n - index-prefix\n type: object\ntype: object\n"), Example: examples, - Args: cobra.MinimumNArgs(0), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[0:]) + body, err := cli.GetBody("application/json", args[1:]) if err != nil { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XCreateBlockStorageVolume(params, body) + _, decoded, err := XCreateDbaasExternalEndpointOpensearch(args[0], params, body) + if err != nil { + log.Fatal().Err(err).Msg("Error calling operation") + } + + if err := cli.Formatter.Format(decoded); err != nil { + log.Fatal().Err(err).Msg("Formatting failed") + } + + }, + } + + root.AddCommand(cmd) + + cli.SetCustomFlags(cmd) + + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } + + }() + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "delete-dbaas-external-endpoint-prometheus endpoint-id", + Short: "delete-dbaas-external-endpoint-prometheus", + Long: cli.Markdown("[BETA] Delete Prometheus external integration endpoint"), + Example: examples, + Args: cobra.MinimumNArgs(1), + Run: func(cmd *cobra.Command, args []string) { + + _, decoded, err := XDeleteDbaasExternalEndpointPrometheus(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -13194,14 +16523,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "list-block-storage-volumes", - Short: "List block storage volumes", - Long: cli.Markdown(""), + Use: "get-dbaas-external-endpoint-prometheus endpoint-id", + Short: "get-dbaas-external-endpoint-prometheus", + Long: cli.Markdown("[BETA] Get Prometheus external integration endpoint settings"), Example: examples, - Args: cobra.MinimumNArgs(0), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XListBlockStorageVolumes(params) + _, decoded, err := XGetDbaasExternalEndpointPrometheus(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -13215,8 +16544,6 @@ func xRegister(subcommand bool) { root.AddCommand(cmd) - cmd.Flags().String("instance-id", "", "") - cli.SetCustomFlags(cmd) if cmd.Flags().HasFlags() { @@ -13231,14 +16558,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "list-block-storage-snapshots", - Short: "List block storage snapshots", - Long: cli.Markdown(""), + Use: "update-dbaas-external-endpoint-prometheus endpoint-id", + Short: "update-dbaas-external-endpoint-prometheus", + Long: cli.Markdown("[BETA] Update Prometheus external integration endpoint\n## Request Schema (application/json)\n\nproperties:\n settings:\n properties:\n basic-auth-password:\n description: Prometheus basic authentication password\n maxLength: 64\n minLength: 8\n type: string\n basic-auth-username:\n description: Prometheus basic authentication username\n maxLength: 32\n minLength: 5\n pattern: ^[a-z0-9\\-@_]{5,32}$\n type: string\n type: object\ntype: object\n"), Example: examples, - Args: cobra.MinimumNArgs(0), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XListBlockStorageSnapshots(params) + _, decoded, err := XUpdateDbaasExternalEndpointPrometheus(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -13266,14 +16597,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "delete-block-storage-snapshot id", - Short: "Delete a block storage snapshot, data will be unrecoverable", - Long: cli.Markdown(""), + Use: "create-dbaas-external-endpoint-prometheus name", + Short: "create-dbaas-external-endpoint-prometheus", + Long: cli.Markdown("[BETA] Create Prometheus external integration endpoint\n## Request Schema (application/json)\n\nproperties:\n settings:\n properties:\n basic-auth-password:\n description: Prometheus basic authentication password\n maxLength: 64\n minLength: 8\n type: string\n basic-auth-username:\n description: Prometheus basic authentication username\n maxLength: 32\n minLength: 5\n pattern: ^[a-z0-9\\-@_]{5,32}$\n type: string\n type: object\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XDeleteBlockStorageSnapshot(args[0], params) + _, decoded, err := XCreateDbaasExternalEndpointPrometheus(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -13301,14 +16636,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-block-storage-snapshot id", - Short: "Retrieve block storage snapshot details", - Long: cli.Markdown(""), + Use: "delete-dbaas-external-endpoint-rsyslog endpoint-id", + Short: "delete-dbaas-external-endpoint-rsyslog", + Long: cli.Markdown("[BETA] Delete RSyslog external integration endpoint"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XGetBlockStorageSnapshot(args[0], params) + _, decoded, err := XDeleteDbaasExternalEndpointRsyslog(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -13336,18 +16671,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "update-block-storage-snapshot id", - Short: "Update block storage volume snapshot", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n labels:\n $ref: '#/components/schemas/labels'\n name:\n description: Snapshot name\n maxLength: 255\n nullable: true\n type: string\ntype: object\n"), + Use: "get-dbaas-external-endpoint-rsyslog endpoint-id", + Short: "get-dbaas-external-endpoint-rsyslog", + Long: cli.Markdown("[BETA] Get RSyslog external integration endpoint settings"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XUpdateBlockStorageSnapshot(args[0], params, body) + _, decoded, err := XGetDbaasExternalEndpointRsyslog(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -13375,14 +16706,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "delete-block-storage-volume id", - Short: "Delete a block storage volume, data will be unrecoverable", - Long: cli.Markdown(""), + Use: "update-dbaas-external-endpoint-rsyslog endpoint-id", + Short: "update-dbaas-external-endpoint-rsyslog", + Long: cli.Markdown("[BETA] Update RSyslog external integration endpoint\n## Request Schema (application/json)\n\nproperties:\n settings:\n properties:\n ca:\n description: PEM encoded CA certificate\n maxLength: 16384\n type: string\n cert:\n description: PEM encoded client certificate\n maxLength: 16384\n type: string\n format:\n $ref: '#/components/schemas/enum-rsyslog-format'\n key:\n description: PEM encoded client key\n maxLength: 16384\n type: string\n logline:\n description: Custom syslog message format\n maxLength: 512\n minLength: 1\n pattern: ^[ -~\\t]+$\n type: string\n max-message-size:\n description: Rsyslog max message size\n format: int64\n maximum: 2.147483647e+09\n minimum: 2048\n type: integer\n port:\n description: Rsyslog server port\n format: int64\n maximum: 65535\n minimum: 1\n type: integer\n sd:\n description: Structured data block for log message\n maxLength: 1024\n type: string\n server:\n description: Rsyslog server IP address or hostname\n maxLength: 255\n minLength: 4\n type: string\n tls:\n description: Require TLS\n type: boolean\n type: object\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XDeleteBlockStorageVolume(args[0], params) + _, decoded, err := XUpdateDbaasExternalEndpointRsyslog(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -13410,14 +16745,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-block-storage-volume id", - Short: "Retrieve block storage volume details", - Long: cli.Markdown(""), + Use: "create-dbaas-external-endpoint-rsyslog name", + Short: "create-dbaas-external-endpoint-rsyslog", + Long: cli.Markdown("[BETA] Create RSyslog external integration endpoint\n## Request Schema (application/json)\n\nproperties:\n settings:\n properties:\n ca:\n description: PEM encoded CA certificate\n maxLength: 16384\n type: string\n cert:\n description: PEM encoded client certificate\n maxLength: 16384\n type: string\n format:\n $ref: '#/components/schemas/enum-rsyslog-format'\n key:\n description: PEM encoded client key\n maxLength: 16384\n type: string\n logline:\n description: Custom syslog message format\n maxLength: 512\n minLength: 1\n pattern: ^[ -~\\t]+$\n type: string\n max-message-size:\n description: Rsyslog max message size\n format: int64\n maximum: 2.147483647e+09\n minimum: 2048\n type: integer\n port:\n description: Rsyslog server port\n format: int64\n maximum: 65535\n minimum: 1\n type: integer\n sd:\n description: Structured data block for log message\n maxLength: 1024\n type: string\n server:\n description: Rsyslog server IP address or hostname\n maxLength: 255\n minLength: 4\n type: string\n tls:\n description: Require TLS\n type: boolean\n required:\n - server\n - port\n - tls\n - format\n type: object\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XGetBlockStorageVolume(args[0], params) + _, decoded, err := XCreateDbaasExternalEndpointRsyslog(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -13445,18 +16784,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "update-block-storage-volume id", - Short: "Update block storage volume", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n labels:\n $ref: '#/components/schemas/labels'\n name:\n description: Volume name\n maxLength: 255\n nullable: true\n type: string\ntype: object\n"), + Use: "list-dbaas-external-endpoint-types", + Short: "list-dbaas-external-endpoint-types", + Long: cli.Markdown("[BETA] List available external endpoint types and their schemas for DBaaS external integrations"), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(0), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XUpdateBlockStorageVolume(args[0], params, body) + _, decoded, err := XListDbaasExternalEndpointTypes(params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -13484,9 +16819,9 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "attach-block-storage-volume-to-instance id", - Short: "Attach block storage volume to an instance", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n instance:\n $ref: '#/components/schemas/instance-target'\nrequired:\n- instance\ntype: object\n"), + Use: "attach-dbaas-service-to-endpoint source-service-name", + Short: "attach-dbaas-service-to-endpoint", + Long: cli.Markdown("[BETA] Create a new DBaaS connection between a DBaaS service and an external service\n## Request Schema (application/json)\n\nproperties:\n dest-endpoint-id:\n description: External endpoint id\n format: uuid\n type: string\n type:\n $ref: '#/components/schemas/enum-external-endpoint-types'\nrequired:\n- dest-endpoint-id\n- type\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { @@ -13495,7 +16830,7 @@ func xRegister(subcommand bool) { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XAttachBlockStorageVolumeToInstance(args[0], params, body) + _, decoded, err := XAttachDbaasServiceToEndpoint(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -13523,9 +16858,9 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "create-block-storage-snapshot id", - Short: "Create a block storage snapshot", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n labels:\n $ref: '#/components/schemas/labels'\n name:\n description: Snapshot name\n maxLength: 255\n minLength: 1\n type: string\ntype: object\n"), + Use: "detach-dbaas-service-from-endpoint source-service-name", + Short: "detach-dbaas-service-from-endpoint", + Long: cli.Markdown("[BETA] Detach a DBaaS external integration from a service\n## Request Schema (application/json)\n\nproperties:\n integration-id:\n description: External Integration ID\n format: uuid\n type: string\nrequired:\n- integration-id\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { @@ -13534,7 +16869,7 @@ func xRegister(subcommand bool) { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XCreateBlockStorageSnapshot(args[0], params, body) + _, decoded, err := XDetachDbaasServiceFromEndpoint(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -13562,18 +16897,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "detach-block-storage-volume id", - Short: "Detach block storage volume", - Long: cli.Markdown(""), + Use: "list-dbaas-external-endpoints", + Short: "list-dbaas-external-endpoints", + Long: cli.Markdown("[BETA] List available external endpoints for integrations"), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(0), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XDetachBlockStorageVolume(args[0], params, body) + _, decoded, err := XListDbaasExternalEndpoints(params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -13601,18 +16932,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "resize-block-storage-volume id", - Short: "Resize a block storage volume", - Long: cli.Markdown("This operation resizes a Block storage volume. Note: the volume can only grow, cannot be shrunk.\n## Request Schema (application/json)\n\nproperties:\n size:\n description: Volume size in GiB\n exclusiveMinimum: true\n format: int64\n minimum: 0\n type: integer\nrequired:\n- size\ntype: object\n"), + Use: "get-dbaas-external-integration-settings-datadog integration-id", + Short: "get-dbaas-external-integration-settings-datadog", + Long: cli.Markdown("[BETA] Get Datadog integration settings"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XResizeBlockStorageVolume(args[0], params, body) + _, decoded, err := XGetDbaasExternalIntegrationSettingsDatadog(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -13640,14 +16967,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-console-proxy-url id", - Short: "Retrieve signed url valid for 60 seconds to connect via console-proxy websocket to VM VNC console.", - Long: cli.Markdown(""), + Use: "update-dbaas-external-integration-settings-datadog integration-id", + Short: "update-dbaas-external-integration-settings-datadog", + Long: cli.Markdown("[BETA] Manage Datadog integration settings\n## Request Schema (application/json)\n\nproperties:\n settings:\n $ref: '#/components/schemas/dbaas-integration-settings-datadog'\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XGetConsoleProxyUrl(args[0], params) + _, decoded, err := XUpdateDbaasExternalIntegrationSettingsDatadog(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -13675,14 +17006,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-dbaas-ca-certificate", - Short: "Get DBaaS CA Certificate", - Long: cli.Markdown("Returns a CA Certificate required to reach a DBaaS service through a TLS-protected connection."), + Use: "get-dbaas-external-integration integration-id", + Short: "get-dbaas-external-integration", + Long: cli.Markdown("[BETA] Get a DBaaS external integration"), Example: examples, - Args: cobra.MinimumNArgs(0), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XGetDbaasCaCertificate(params) + _, decoded, err := XGetDbaasExternalIntegration(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -13710,14 +17041,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "delete-dbaas-external-endpoint-datadog endpoint-id", - Short: "delete-dbaas-external-endpoint-datadog", - Long: cli.Markdown("[BETA] Delete DataDog external integration endpoint"), + Use: "list-dbaas-external-integrations service-name", + Short: "list-dbaas-external-integrations", + Long: cli.Markdown("[BETA] List all DBaaS connections between services and external endpoints"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XDeleteDbaasExternalEndpointDatadog(args[0], params) + _, decoded, err := XListDbaasExternalIntegrations(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -13745,14 +17076,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-dbaas-external-endpoint-datadog endpoint-id", - Short: "get-dbaas-external-endpoint-datadog", - Long: cli.Markdown("[BETA] Get DataDog external endpoint settings"), + Use: "create-dbaas-service-grafana name", + Short: "create-dbaas-service-grafana", + Long: cli.Markdown("Create a DBaaS Grafana service\n## Request Schema (application/json)\n\nproperties:\n fork-from-service:\n $ref: '#/components/schemas/dbaas-service-name'\n grafana-settings:\n $ref: '#/components/schemas/json-schema-grafana'\n ip-filter:\n description: Allowed CIDR address blocks for incoming connections\n items:\n type: string\n type: array\n maintenance:\n description: Automatic maintenance settings\n properties:\n dow:\n description: Day of week for installing updates\n enum:\n - saturday\n - tuesday\n - never\n - wednesday\n - sunday\n - friday\n - monday\n - thursday\n type: string\n time:\n description: Time for installing updates, UTC\n maxLength: 8\n minLength: 8\n type: string\n required:\n - dow\n - time\n type: object\n plan:\n description: Subscription plan\n maxLength: 128\n minLength: 1\n type: string\n termination-protection:\n description: Service is protected against termination and powering off\n type: boolean\nrequired:\n- plan\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XGetDbaasExternalEndpointDatadog(args[0], params) + _, decoded, err := XCreateDbaasServiceGrafana(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -13780,18 +17115,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "update-dbaas-external-endpoint-datadog endpoint-id", - Short: "update-dbaas-external-endpoint-datadog", - Long: cli.Markdown("[BETA] Update DataDog external integration endpoint\n## Request Schema (application/json)\n\nproperties:\n settings:\n properties:\n datadog-api-key:\n description: Datadog API key\n maxLength: 256\n minLength: 1\n pattern: ^[A-Za-z0-9]{1,256}$\n type: string\n datadog-tags:\n description: Custom tags provided by user\n items:\n $ref: '#/components/schemas/dbaas-datadog-tag'\n type: array\n disable-consumer-stats:\n description: Disable kafka consumer group metrics. Applies only when attached to kafka services.\n type: boolean\n kafka-consumer-check-instances:\n description: Number of separate instances to fetch kafka consumer statistics with. Applies only when attached to kafka services.\n format: int64\n maximum: 100\n minimum: 1\n type: integer\n kafka-consumer-stats-timeout:\n description: Number of seconds that datadog will wait to get consumer statistics from brokers. Applies only when attached to kafka services.\n format: int64\n maximum: 300\n minimum: 2\n type: integer\n max-partition-contexts:\n description: Maximum number of partition contexts to send. Applies only when attached to kafka services.\n format: int64\n maximum: 200000\n minimum: 200\n type: integer\n site:\n $ref: '#/components/schemas/enum-datadog-site'\n required:\n - datadog-api-key\n type: object\ntype: object\n"), + Use: "delete-dbaas-service-grafana name", + Short: "Delete a Grafana service", + Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XUpdateDbaasExternalEndpointDatadog(args[0], params, body) + _, decoded, err := XDeleteDbaasServiceGrafana(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -13819,18 +17150,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "create-dbaas-external-endpoint-datadog name", - Short: "create-dbaas-external-endpoint-datadog", - Long: cli.Markdown("[BETA] Create DataDog external integration endpoint\n## Request Schema (application/json)\n\nproperties:\n settings:\n properties:\n datadog-api-key:\n description: Datadog API key\n maxLength: 256\n minLength: 1\n pattern: ^[A-Za-z0-9]{1,256}$\n type: string\n datadog-tags:\n description: Custom tags provided by user\n items:\n $ref: '#/components/schemas/dbaas-datadog-tag'\n type: array\n disable-consumer-stats:\n description: Disable kafka consumer group metrics. Applies only when attached to kafka services.\n type: boolean\n kafka-consumer-check-instances:\n description: Number of separate instances to fetch kafka consumer statistics with. Applies only when attached to kafka services.\n format: int64\n maximum: 100\n minimum: 1\n type: integer\n kafka-consumer-stats-timeout:\n description: Number of seconds that datadog will wait to get consumer statistics from brokers. Applies only when attached to kafka services.\n format: int64\n maximum: 300\n minimum: 2\n type: integer\n max-partition-contexts:\n description: Maximum number of partition contexts to send. Applies only when attached to kafka services.\n format: int64\n maximum: 200000\n minimum: 200\n type: integer\n site:\n $ref: '#/components/schemas/enum-datadog-site'\n required:\n - datadog-api-key\n - site\n type: object\ntype: object\n"), + Use: "get-dbaas-service-grafana name", + Short: "Get a DBaaS Grafana service", + Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XCreateDbaasExternalEndpointDatadog(args[0], params, body) + _, decoded, err := XGetDbaasServiceGrafana(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -13858,14 +17185,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "delete-dbaas-external-endpoint-elasticsearch endpoint-id", - Short: "delete-dbaas-external-endpoint-elasticsearch", - Long: cli.Markdown("[BETA] Delete ElasticSearch logs external integration endpoint"), + Use: "update-dbaas-service-grafana name", + Short: "Update a DBaaS Grafana service", + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n grafana-settings:\n $ref: '#/components/schemas/json-schema-grafana'\n ip-filter:\n description: Allowed CIDR address blocks for incoming connections\n items:\n type: string\n type: array\n maintenance:\n description: Automatic maintenance settings\n properties:\n dow:\n description: Day of week for installing updates\n enum:\n - saturday\n - tuesday\n - never\n - wednesday\n - sunday\n - friday\n - monday\n - thursday\n type: string\n time:\n description: Time for installing updates, UTC\n maxLength: 8\n minLength: 8\n type: string\n required:\n - dow\n - time\n type: object\n plan:\n description: Subscription plan\n maxLength: 128\n minLength: 1\n type: string\n termination-protection:\n description: Service is protected against termination and powering off\n type: boolean\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XDeleteDbaasExternalEndpointElasticsearch(args[0], params) + _, decoded, err := XUpdateDbaasServiceGrafana(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -13893,14 +17224,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-dbaas-external-endpoint-elasticsearch endpoint-id", - Short: "get-dbaas-external-endpoint-elasticsearch", - Long: cli.Markdown("[BETA] Get ElasticSearch Logs external integration endpoint settings"), + Use: "start-dbaas-grafana-maintenance name", + Short: "Initiate Grafana maintenance update", + Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XGetDbaasExternalEndpointElasticsearch(args[0], params) + _, decoded, err := XStartDbaasGrafanaMaintenance(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -13928,18 +17263,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "update-dbaas-external-endpoint-elasticsearch endpoint-id", - Short: "update-dbaas-external-endpoint-elasticsearch", - Long: cli.Markdown("[BETA] Update ElasticSearch Logs external integration endpoint\n## Request Schema (application/json)\n\nproperties:\n settings:\n properties:\n ca:\n description: PEM encoded CA certificate\n maxLength: 16384\n type: string\n index-days-max:\n description: Maximum number of days of logs to keep\n format: int64\n maximum: 10000\n minimum: 1\n type: integer\n index-prefix:\n description: Elasticsearch index prefix\n maxLength: 1000\n minLength: 1\n pattern: ^[a-z0-9][a-z0-9-_.]+$\n type: string\n timeout:\n description: Elasticsearch request timeout limit\n format: int64\n maximum: 120\n minimum: 10\n type: integer\n url:\n description: Elasticsearch connection URL\n maxLength: 2048\n minLength: 12\n type: string\n type: object\ntype: object\n"), + Use: "reset-dbaas-grafana-user-password service-name username", + Short: "Reset the credentials of a DBaaS Grafana user", + Long: cli.Markdown("If no password is provided one will be generated automatically.\n## Request Schema (application/json)\n\nproperties:\n password:\n $ref: '#/components/schemas/dbaas-user-password'\ntype: object\n"), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) + body, err := cli.GetBody("application/json", args[2:]) if err != nil { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XUpdateDbaasExternalEndpointElasticsearch(args[0], params, body) + _, decoded, err := XResetDbaasGrafanaUserPassword(args[0], args[1], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -13967,18 +17302,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "create-dbaas-external-endpoint-elasticsearch name", - Short: "create-dbaas-external-endpoint-elasticsearch", - Long: cli.Markdown("[BETA] Create ElasticSearch Logs external integration endpoint\n## Request Schema (application/json)\n\nproperties:\n settings:\n properties:\n ca:\n description: PEM encoded CA certificate\n maxLength: 16384\n type: string\n index-days-max:\n description: Maximum number of days of logs to keep\n format: int64\n maximum: 10000\n minimum: 1\n type: integer\n index-prefix:\n description: Elasticsearch index prefix\n maxLength: 1000\n minLength: 1\n pattern: ^[a-z0-9][a-z0-9-_.]+$\n type: string\n timeout:\n description: Elasticsearch request timeout limit\n format: int64\n maximum: 120\n minimum: 10\n type: integer\n url:\n description: Elasticsearch connection URL\n maxLength: 2048\n minLength: 12\n type: string\n required:\n - url\n - index-prefix\n type: object\ntype: object\n"), + Use: "reveal-dbaas-grafana-user-password service-name username", + Short: "Reveal the secrets of a DBaaS Grafana user", + Long: cli.Markdown(""), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XCreateDbaasExternalEndpointElasticsearch(args[0], params, body) + _, decoded, err := XRevealDbaasGrafanaUserPassword(args[0], args[1], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -14006,14 +17337,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "delete-dbaas-external-endpoint-opensearch endpoint-id", - Short: "delete-dbaas-external-endpoint-opensearch", - Long: cli.Markdown("[BETA] Delete OpenSearch logs external integration endpoint"), + Use: "create-dbaas-integration", + Short: "create-dbaas-integration", + Long: cli.Markdown("[BETA] Create a new DBaaS integration between two services\n## Request Schema (application/json)\n\nproperties:\n dest-service:\n $ref: '#/components/schemas/dbaas-service-name'\n integration-type:\n $ref: '#/components/schemas/enum-integration-types'\n settings:\n description: Integration settings\n type: object\n source-service:\n $ref: '#/components/schemas/dbaas-service-name'\nrequired:\n- integration-type\n- source-service\n- dest-service\ntype: object\n"), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(0), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[0:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XDeleteDbaasExternalEndpointOpensearch(args[0], params) + _, decoded, err := XCreateDbaasIntegration(params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -14041,14 +17376,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-dbaas-external-endpoint-opensearch endpoint-id", - Short: "get-dbaas-external-endpoint-opensearch", - Long: cli.Markdown("[BETA] Get OpenSearch Logs external integration endpoint settings"), + Use: "list-dbaas-integration-settings integration-type source-type dest-type", + Short: "list-dbaas-integration-settings", + Long: cli.Markdown("[BETA] Get DBaaS integration settings"), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(3), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XGetDbaasExternalEndpointOpensearch(args[0], params) + _, decoded, err := XListDbaasIntegrationSettings(args[0], args[1], args[2], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -14076,18 +17411,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "update-dbaas-external-endpoint-opensearch endpoint-id", - Short: "update-dbaas-external-endpoint-opensearch", - Long: cli.Markdown("[BETA] Update OpenSearch Logs external integration endpoint\n## Request Schema (application/json)\n\nproperties:\n settings:\n properties:\n ca:\n description: PEM encoded CA certificate\n maxLength: 16384\n type: string\n index-days-max:\n description: Maximum number of days of logs to keep\n format: int64\n maximum: 10000\n minimum: 1\n type: integer\n index-prefix:\n description: OpenSearch index prefix\n maxLength: 1000\n minLength: 1\n pattern: ^[a-z0-9][a-z0-9-_.]+$\n type: string\n timeout:\n description: OpenSearch request timeout limit\n format: int64\n maximum: 120\n minimum: 10\n type: integer\n url:\n description: OpenSearch connection URL\n maxLength: 2048\n minLength: 12\n type: string\n type: object\ntype: object\n"), + Use: "list-dbaas-integration-types", + Short: "list-dbaas-integration-types", + Long: cli.Markdown("[BETA] Get DBaaS integration types"), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(0), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XUpdateDbaasExternalEndpointOpensearch(args[0], params, body) + _, decoded, err := XListDbaasIntegrationTypes(params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -14115,18 +17446,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "create-dbaas-external-endpoint-opensearch name", - Short: "create-dbaas-external-endpoint-opensearch", - Long: cli.Markdown("[BETA] Create OpenSearch Logs external integration endpoint\n## Request Schema (application/json)\n\nproperties:\n settings:\n properties:\n ca:\n description: PEM encoded CA certificate\n maxLength: 16384\n type: string\n index-days-max:\n description: Maximum number of days of logs to keep\n format: int64\n maximum: 10000\n minimum: 1\n type: integer\n index-prefix:\n description: OpenSearch index prefix\n maxLength: 1000\n minLength: 1\n pattern: ^[a-z0-9][a-z0-9-_.]+$\n type: string\n timeout:\n description: OpenSearch request timeout limit\n format: int64\n maximum: 120\n minimum: 10\n type: integer\n url:\n description: OpenSearch connection URL\n maxLength: 2048\n minLength: 12\n type: string\n required:\n - url\n - index-prefix\n type: object\ntype: object\n"), + Use: "delete-dbaas-integration id", + Short: "delete-dbaas-integration", + Long: cli.Markdown("[BETA] Delete a DBaaS Integration"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XCreateDbaasExternalEndpointOpensearch(args[0], params, body) + _, decoded, err := XDeleteDbaasIntegration(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -14154,14 +17481,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "delete-dbaas-external-endpoint-prometheus endpoint-id", - Short: "delete-dbaas-external-endpoint-prometheus", - Long: cli.Markdown("[BETA] Delete Prometheus external integration endpoint"), + Use: "get-dbaas-integration id", + Short: "get-dbaas-integration", + Long: cli.Markdown("[BETA] Get a DBaaS Integration"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XDeleteDbaasExternalEndpointPrometheus(args[0], params) + _, decoded, err := XGetDbaasIntegration(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -14189,14 +17516,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-dbaas-external-endpoint-prometheus endpoint-id", - Short: "get-dbaas-external-endpoint-prometheus", - Long: cli.Markdown("[BETA] Get Prometheus external integration endpoint settings"), + Use: "update-dbaas-integration id", + Short: "update-dbaas-integration", + Long: cli.Markdown("[BETA] Update a existing DBaaS integration\n## Request Schema (application/json)\n\nproperties:\n settings:\n description: Integration settings\n type: object\nrequired:\n- settings\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XGetDbaasExternalEndpointPrometheus(args[0], params) + _, decoded, err := XUpdateDbaasIntegration(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -14224,9 +17555,9 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "update-dbaas-external-endpoint-prometheus endpoint-id", - Short: "update-dbaas-external-endpoint-prometheus", - Long: cli.Markdown("[BETA] Update Prometheus external integration endpoint\n## Request Schema (application/json)\n\nproperties:\n settings:\n properties:\n basic-auth-password:\n description: Prometheus basic authentication password\n maxLength: 64\n minLength: 8\n type: string\n basic-auth-username:\n description: Prometheus basic authentication username\n maxLength: 32\n minLength: 5\n type: string\n type: object\ntype: object\n"), + Use: "create-dbaas-service-kafka name", + Short: "Create a DBaaS Kafka service", + Long: cli.Markdown("Create a DBaaS Kafka service\n## Request Schema (application/json)\n\nproperties:\n authentication-methods:\n description: Kafka authentication methods\n properties:\n certificate:\n description: Enable certificate/SSL authentication\n type: boolean\n sasl:\n description: Enable SASL authentication\n type: boolean\n type: object\n ip-filter:\n description: Allow incoming connections from CIDR address block, e.g. '10.20.0.0/16'\n items:\n type: string\n type: array\n kafka-connect-enabled:\n description: Allow clients to connect to kafka_connect from the public internet for service nodes that are in a project VPC or another type of private network\n type: boolean\n kafka-connect-settings:\n $ref: '#/components/schemas/json-schema-kafka-connect'\n kafka-rest-enabled:\n description: Enable Kafka-REST service\n type: boolean\n kafka-rest-settings:\n $ref: '#/components/schemas/json-schema-kafka-rest'\n kafka-settings:\n $ref: '#/components/schemas/json-schema-kafka'\n maintenance:\n description: Automatic maintenance settings\n properties:\n dow:\n description: Day of week for installing updates\n enum:\n - saturday\n - tuesday\n - never\n - wednesday\n - sunday\n - friday\n - monday\n - thursday\n type: string\n time:\n description: Time for installing updates, UTC\n maxLength: 8\n minLength: 8\n type: string\n required:\n - dow\n - time\n type: object\n plan:\n description: Subscription plan\n maxLength: 128\n minLength: 1\n type: string\n schema-registry-enabled:\n description: Enable Schema-Registry service\n type: boolean\n schema-registry-settings:\n $ref: '#/components/schemas/json-schema-schema-registry'\n termination-protection:\n description: Service is protected against termination and powering off\n type: boolean\n version:\n description: Kafka major version\n minLength: 1\n type: string\nrequired:\n- plan\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { @@ -14235,7 +17566,7 @@ func xRegister(subcommand bool) { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XUpdateDbaasExternalEndpointPrometheus(args[0], params, body) + _, decoded, err := XCreateDbaasServiceKafka(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -14263,18 +17594,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "create-dbaas-external-endpoint-prometheus name", - Short: "create-dbaas-external-endpoint-prometheus", - Long: cli.Markdown("[BETA] Create Prometheus external integration endpoint\n## Request Schema (application/json)\n\nproperties:\n settings:\n properties:\n basic-auth-password:\n description: Prometheus basic authentication password\n maxLength: 64\n minLength: 8\n type: string\n basic-auth-username:\n description: Prometheus basic authentication username\n maxLength: 32\n minLength: 5\n type: string\n type: object\ntype: object\n"), + Use: "delete-dbaas-service-kafka name", + Short: "Delete a Kafka service", + Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XCreateDbaasExternalEndpointPrometheus(args[0], params, body) + _, decoded, err := XDeleteDbaasServiceKafka(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -14302,14 +17629,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "delete-dbaas-external-endpoint-rsyslog endpoint-id", - Short: "delete-dbaas-external-endpoint-rsyslog", - Long: cli.Markdown("[BETA] Delete RSyslog external integration endpoint"), + Use: "get-dbaas-service-kafka name", + Short: "Get a DBaaS Kafka service", + Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XDeleteDbaasExternalEndpointRsyslog(args[0], params) + _, decoded, err := XGetDbaasServiceKafka(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -14337,14 +17664,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-dbaas-external-endpoint-rsyslog endpoint-id", - Short: "get-dbaas-external-endpoint-rsyslog", - Long: cli.Markdown("[BETA] Get RSyslog external integration endpoint settings"), + Use: "update-dbaas-service-kafka name", + Short: "Update a DBaaS Kafka service", + Long: cli.Markdown("Update a DBaaS Kafka service\n## Request Schema (application/json)\n\nproperties:\n authentication-methods:\n description: Kafka authentication methods\n properties:\n certificate:\n description: Enable certificate/SSL authentication\n type: boolean\n sasl:\n description: Enable SASL authentication\n type: boolean\n type: object\n ip-filter:\n description: Allow incoming connections from CIDR address block, e.g. '10.20.0.0/16'\n items:\n type: string\n type: array\n kafka-connect-enabled:\n description: Allow clients to connect to kafka_connect from the public internet for service nodes that are in a project VPC or another type of private network\n type: boolean\n kafka-connect-settings:\n $ref: '#/components/schemas/json-schema-kafka-connect'\n kafka-rest-enabled:\n description: Enable Kafka-REST service\n type: boolean\n kafka-rest-settings:\n $ref: '#/components/schemas/json-schema-kafka-rest'\n kafka-settings:\n $ref: '#/components/schemas/json-schema-kafka'\n maintenance:\n description: Automatic maintenance settings\n properties:\n dow:\n description: Day of week for installing updates\n enum:\n - saturday\n - tuesday\n - never\n - wednesday\n - sunday\n - friday\n - monday\n - thursday\n type: string\n time:\n description: Time for installing updates, UTC\n maxLength: 8\n minLength: 8\n type: string\n required:\n - dow\n - time\n type: object\n plan:\n description: Subscription plan\n maxLength: 128\n minLength: 1\n type: string\n schema-registry-enabled:\n description: Enable Schema-Registry service\n type: boolean\n schema-registry-settings:\n $ref: '#/components/schemas/json-schema-schema-registry'\n termination-protection:\n description: Service is protected against termination and powering off\n type: boolean\n version:\n description: Kafka major version\n minLength: 1\n type: string\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XGetDbaasExternalEndpointRsyslog(args[0], params) + _, decoded, err := XUpdateDbaasServiceKafka(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -14372,18 +17703,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "update-dbaas-external-endpoint-rsyslog endpoint-id", - Short: "update-dbaas-external-endpoint-rsyslog", - Long: cli.Markdown("[BETA] Update RSyslog external integration endpoint\n## Request Schema (application/json)\n\nproperties:\n settings:\n properties:\n ca:\n description: PEM encoded CA certificate\n maxLength: 16384\n type: string\n cert:\n description: PEM encoded client certificate\n maxLength: 16384\n type: string\n format:\n $ref: '#/components/schemas/enum-rsyslog-format'\n key:\n description: PEM encoded client key\n maxLength: 16384\n type: string\n logline:\n description: Custom syslog message format\n maxLength: 512\n minLength: 1\n pattern: ^[ -~\t]+$\n type: string\n max-message-size:\n description: Rsyslog max message size\n format: int64\n maximum: 2.147483647e+09\n minimum: 2048\n type: integer\n port:\n description: Rsyslog server port\n format: int64\n maximum: 65535\n minimum: 1\n type: integer\n sd:\n description: Structured data block for log message\n maxLength: 1024\n type: string\n server:\n description: Rsyslog server IP address or hostname\n maxLength: 255\n minLength: 4\n type: string\n tls:\n description: Require TLS\n type: boolean\n type: object\ntype: object\n"), + Use: "get-dbaas-kafka-acl-config name", + Short: "Get DBaaS kafka ACL configuration", + Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XUpdateDbaasExternalEndpointRsyslog(args[0], params, body) + _, decoded, err := XGetDbaasKafkaAclConfig(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -14411,18 +17738,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "create-dbaas-external-endpoint-rsyslog name", - Short: "create-dbaas-external-endpoint-rsyslog", - Long: cli.Markdown("[BETA] Create RSyslog external integration endpoint\n## Request Schema (application/json)\n\nproperties:\n settings:\n properties:\n ca:\n description: PEM encoded CA certificate\n maxLength: 16384\n type: string\n cert:\n description: PEM encoded client certificate\n maxLength: 16384\n type: string\n format:\n $ref: '#/components/schemas/enum-rsyslog-format'\n key:\n description: PEM encoded client key\n maxLength: 16384\n type: string\n logline:\n description: Custom syslog message format\n maxLength: 512\n minLength: 1\n pattern: ^[ -~\t]+$\n type: string\n max-message-size:\n description: Rsyslog max message size\n format: int64\n maximum: 2.147483647e+09\n minimum: 2048\n type: integer\n port:\n description: Rsyslog server port\n format: int64\n maximum: 65535\n minimum: 1\n type: integer\n sd:\n description: Structured data block for log message\n maxLength: 1024\n type: string\n server:\n description: Rsyslog server IP address or hostname\n maxLength: 255\n minLength: 4\n type: string\n tls:\n description: Require TLS\n type: boolean\n required:\n - server\n - port\n - tls\n - format\n type: object\ntype: object\n"), + Use: "start-dbaas-kafka-maintenance name", + Short: "Initiate Kafka maintenance update", + Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) + body, err := cli.GetBody("", args[1:]) if err != nil { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XCreateDbaasExternalEndpointRsyslog(args[0], params, body) + _, decoded, err := XStartDbaasKafkaMaintenance(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -14450,14 +17777,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "list-dbaas-external-endpoint-types", - Short: "list-dbaas-external-endpoint-types", - Long: cli.Markdown("[BETA] List available external endpoint types and their schemas for DBaaS external integrations"), + Use: "create-dbaas-kafka-schema-registry-acl-config name", + Short: "Add a Kafka Schema Registry ACL entry", + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n id:\n $ref: '#/components/schemas/dbaas-kafka-acl-id'\n permission:\n description: Kafka Schema Registry permission\n enum:\n - schema_registry_read\n - schema_registry_write\n type: string\n resource:\n description: Kafka Schema Registry name or pattern\n maxLength: 249\n minLength: 1\n type: string\n username:\n description: Kafka username or username pattern\n maxLength: 64\n minLength: 1\n type: string\nrequired:\n- username\n- resource\n- permission\ntype: object\n"), Example: examples, - Args: cobra.MinimumNArgs(0), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XListDbaasExternalEndpointTypes(params) + _, decoded, err := XCreateDbaasKafkaSchemaRegistryAclConfig(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -14485,18 +17816,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "attach-dbaas-service-to-endpoint source-service-name", - Short: "attach-dbaas-service-to-endpoint", - Long: cli.Markdown("[BETA] Create a new DBaaS connection between a DBaaS service and an external service\n## Request Schema (application/json)\n\nproperties:\n dest-endpoint-id:\n description: External endpoint id\n format: uuid\n type: string\n type:\n $ref: '#/components/schemas/enum-external-endpoint-types'\nrequired:\n- dest-endpoint-id\n- type\ntype: object\n"), + Use: "delete-dbaas-kafka-schema-registry-acl-config name acl-id", + Short: "Delete a Kafka ACL entry", + Long: cli.Markdown(""), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XAttachDbaasServiceToEndpoint(args[0], params, body) + _, decoded, err := XDeleteDbaasKafkaSchemaRegistryAclConfig(args[0], args[1], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -14524,9 +17851,9 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "detach-dbaas-service-from-endpoint source-service-name", - Short: "detach-dbaas-service-from-endpoint", - Long: cli.Markdown("[BETA] Detach a DBaaS external integration from a service\n## Request Schema (application/json)\n\nproperties:\n integration-id:\n description: External Integration ID\n format: uuid\n type: string\nrequired:\n- integration-id\ntype: object\n"), + Use: "create-dbaas-kafka-topic-acl-config name", + Short: "Add a Kafka topic ACL entry", + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n id:\n $ref: '#/components/schemas/dbaas-kafka-acl-id'\n permission:\n description: Kafka permission\n enum:\n - admin\n - read\n - readwrite\n - write\n type: string\n topic:\n description: Kafka topic name or pattern\n maxLength: 249\n minLength: 1\n type: string\n username:\n description: Kafka username or username pattern\n maxLength: 64\n minLength: 1\n type: string\nrequired:\n- username\n- topic\n- permission\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { @@ -14535,7 +17862,7 @@ func xRegister(subcommand bool) { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XDetachDbaasServiceFromEndpoint(args[0], params, body) + _, decoded, err := XCreateDbaasKafkaTopicAclConfig(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -14563,14 +17890,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "list-dbaas-external-endpoints", - Short: "list-dbaas-external-endpoints", - Long: cli.Markdown("[BETA] List available external endpoints for integrations"), + Use: "delete-dbaas-kafka-topic-acl-config name acl-id", + Short: "Delete a Kafka ACL entry", + Long: cli.Markdown(""), Example: examples, - Args: cobra.MinimumNArgs(0), + Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XListDbaasExternalEndpoints(params) + _, decoded, err := XDeleteDbaasKafkaTopicAclConfig(args[0], args[1], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -14598,14 +17925,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-dbaas-external-integration-settings-datadog integration-id", - Short: "get-dbaas-external-integration-settings-datadog", - Long: cli.Markdown("[BETA] Get Datadog integration settings"), + Use: "reveal-dbaas-kafka-connect-password service-name", + Short: "Reveal the secrets for DBaaS Kafka Connect", + Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XGetDbaasExternalIntegrationSettingsDatadog(args[0], params) + _, decoded, err := XRevealDbaasKafkaConnectPassword(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -14633,9 +17960,9 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "update-dbaas-external-integration-settings-datadog integration-id", - Short: "update-dbaas-external-integration-settings-datadog", - Long: cli.Markdown("[BETA] Manage Datadog integration settings\n## Request Schema (application/json)\n\nproperties:\n settings:\n $ref: '#/components/schemas/dbaas-integration-settings-datadog'\ntype: object\n"), + Use: "create-dbaas-kafka-user service-name", + Short: "Create a DBaaS Kafka user", + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n username:\n $ref: '#/components/schemas/dbaas-user-username'\nrequired:\n- username\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { @@ -14644,7 +17971,7 @@ func xRegister(subcommand bool) { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XUpdateDbaasExternalIntegrationSettingsDatadog(args[0], params, body) + _, decoded, err := XCreateDbaasKafkaUser(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -14672,14 +17999,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-dbaas-external-integration integration-id", - Short: "get-dbaas-external-integration", - Long: cli.Markdown("[BETA] Get a DBaaS external integration"), + Use: "delete-dbaas-kafka-user service-name username", + Short: "Delete a DBaaS kafka user", + Long: cli.Markdown(""), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XGetDbaasExternalIntegration(args[0], params) + _, decoded, err := XDeleteDbaasKafkaUser(args[0], args[1], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -14707,14 +18034,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "list-dbaas-external-integrations service-name", - Short: "list-dbaas-external-integrations", - Long: cli.Markdown("[BETA] List all DBaaS connections between services and external endpoints"), + Use: "reset-dbaas-kafka-user-password service-name username", + Short: "Reset the credentials of a DBaaS Kafka user", + Long: cli.Markdown("If no password is provided one will be generated automatically.\n## Request Schema (application/json)\n\nproperties:\n password:\n $ref: '#/components/schemas/dbaas-user-password'\ntype: object\n"), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[2:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XListDbaasExternalIntegrations(args[0], params) + _, decoded, err := XResetDbaasKafkaUserPassword(args[0], args[1], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -14742,18 +18073,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "create-dbaas-service-grafana name", - Short: "create-dbaas-service-grafana", - Long: cli.Markdown("Create a DBaaS Grafana service\n## Request Schema (application/json)\n\nproperties:\n fork-from-service:\n $ref: '#/components/schemas/dbaas-service-name'\n grafana-settings:\n $ref: '#/components/schemas/json-schema-grafana'\n ip-filter:\n description: Allowed CIDR address blocks for incoming connections\n items:\n type: string\n type: array\n maintenance:\n description: Automatic maintenance settings\n properties:\n dow:\n description: Day of week for installing updates\n enum:\n - saturday\n - tuesday\n - never\n - wednesday\n - sunday\n - friday\n - monday\n - thursday\n type: string\n time:\n description: Time for installing updates, UTC\n maxLength: 8\n minLength: 8\n type: string\n required:\n - dow\n - time\n type: object\n plan:\n description: Subscription plan\n maxLength: 128\n minLength: 1\n type: string\n termination-protection:\n description: Service is protected against termination and powering off\n type: boolean\nrequired:\n- plan\ntype: object\n"), + Use: "reveal-dbaas-kafka-user-password service-name username", + Short: "Reveal the secrets of a DBaaS Kafka user", + Long: cli.Markdown(""), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XCreateDbaasServiceGrafana(args[0], params, body) + _, decoded, err := XRevealDbaasKafkaUserPassword(args[0], args[1], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -14781,14 +18108,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "delete-dbaas-service-grafana name", - Short: "Delete a Grafana service", - Long: cli.Markdown(""), + Use: "get-dbaas-migration-status name", + Short: "Get a DBaaS migration status", + Long: cli.Markdown("Get a DBaaS migration status"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XDeleteDbaasServiceGrafana(args[0], params) + _, decoded, err := XGetDbaasMigrationStatus(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -14816,14 +18143,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-dbaas-service-grafana name", - Short: "Get a DBaaS Grafana service", - Long: cli.Markdown(""), + Use: "create-dbaas-service-mysql name", + Short: "Create a DBaaS MySQL service", + Long: cli.Markdown("Create a DBaaS MySQL service\n## Request Schema (application/json)\n\nproperties:\n admin-password:\n $ref: '#/components/schemas/dbaas-mysql-user-password'\n admin-username:\n description: Custom username for admin user. This must be set only when a new service is being created.\n maxLength: 64\n minLength: 1\n pattern: ^[_A-Za-z0-9][-._A-Za-z0-9]{0,63}$\n type: string\n backup-schedule:\n properties:\n backup-hour:\n description: The hour of day (in UTC) when backup for the service is started. New backup is only started if previous backup has already completed.\n format: int64\n maximum: 23\n minimum: 0\n nullable: true\n type: integer\n backup-minute:\n description: The minute of an hour when backup for the service is started. New backup is only started if previous backup has already completed.\n format: int64\n maximum: 59\n minimum: 0\n nullable: true\n type: integer\n type: object\n binlog-retention-period:\n description: The minimum amount of time in seconds to keep binlog entries before deletion. This may be extended for services that require binlog entries for longer than the default for example if using the MySQL Debezium Kafka connector.\n format: int64\n maximum: 86400\n minimum: 600\n type: integer\n fork-from-service:\n $ref: '#/components/schemas/dbaas-service-name'\n integrations:\n description: Service integrations to be enabled when creating the service.\n items:\n properties:\n dest-service:\n $ref: '#/components/schemas/dbaas-service-name'\n settings:\n description: Integration settings\n type: object\n source-service:\n $ref: '#/components/schemas/dbaas-service-name'\n type:\n description: Integration type\n enum:\n - read_replica\n type: string\n required:\n - type\n type: object\n type: array\n ip-filter:\n description: Allow incoming connections from CIDR address block, e.g. '10.20.0.0/16'\n items:\n type: string\n type: array\n maintenance:\n description: Automatic maintenance settings\n properties:\n dow:\n description: Day of week for installing updates\n enum:\n - saturday\n - tuesday\n - never\n - wednesday\n - sunday\n - friday\n - monday\n - thursday\n type: string\n time:\n description: Time for installing updates, UTC\n maxLength: 8\n minLength: 8\n type: string\n required:\n - dow\n - time\n type: object\n migration:\n description: Migrate data from existing server\n properties:\n dbname:\n description: Database name for bootstrapping the initial connection\n maxLength: 63\n minLength: 1\n type: string\n host:\n description: Hostname or IP address of the server where to migrate data from\n maxLength: 255\n minLength: 1\n type: string\n ignore-dbs:\n description: Comma-separated list of databases, which should be ignored during migration (supported by MySQL only at the moment)\n maxLength: 2048\n minLength: 1\n type: string\n method:\n $ref: '#/components/schemas/enum-migration-method'\n password:\n description: Password for authentication with the server where to migrate data from\n maxLength: 255\n minLength: 1\n type: string\n port:\n description: Port number of the server where to migrate data from\n format: int64\n maximum: 65535\n minimum: 1\n type: integer\n ssl:\n description: The server where to migrate data from is secured with SSL\n type: boolean\n username:\n description: User name for authentication with the server where to migrate data from\n maxLength: 255\n minLength: 1\n type: string\n required:\n - host\n - port\n type: object\n mysql-settings:\n $ref: '#/components/schemas/json-schema-mysql'\n plan:\n description: Subscription plan\n maxLength: 128\n minLength: 1\n type: string\n recovery-backup-time:\n description: ISO time of a backup to recover from for services that support arbitrary times\n minLength: 1\n type: string\n termination-protection:\n description: Service is protected against termination and powering off\n type: boolean\n version:\n description: MySQL major version\n minLength: 1\n type: string\nrequired:\n- plan\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XGetDbaasServiceGrafana(args[0], params) + _, decoded, err := XCreateDbaasServiceMysql(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -14851,18 +18182,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "update-dbaas-service-grafana name", - Short: "Update a DBaaS Grafana service", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n grafana-settings:\n $ref: '#/components/schemas/json-schema-grafana'\n ip-filter:\n description: Allowed CIDR address blocks for incoming connections\n items:\n type: string\n type: array\n maintenance:\n description: Automatic maintenance settings\n properties:\n dow:\n description: Day of week for installing updates\n enum:\n - saturday\n - tuesday\n - never\n - wednesday\n - sunday\n - friday\n - monday\n - thursday\n type: string\n time:\n description: Time for installing updates, UTC\n maxLength: 8\n minLength: 8\n type: string\n required:\n - dow\n - time\n type: object\n plan:\n description: Subscription plan\n maxLength: 128\n minLength: 1\n type: string\n termination-protection:\n description: Service is protected against termination and powering off\n type: boolean\ntype: object\n"), + Use: "delete-dbaas-service-mysql name", + Short: "Delete a MySQL service", + Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XUpdateDbaasServiceGrafana(args[0], params, body) + _, decoded, err := XDeleteDbaasServiceMysql(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -14890,18 +18217,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "start-dbaas-grafana-maintenance name", - Short: "Initiate Grafana maintenance update", - Long: cli.Markdown(""), + Use: "get-dbaas-service-mysql name", + Short: "Get a DBaaS MySQL service", + Long: cli.Markdown("Get a DBaaS MySQL service"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XStartDbaasGrafanaMaintenance(args[0], params, body) + _, decoded, err := XGetDbaasServiceMysql(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -14929,18 +18252,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "reset-dbaas-grafana-user-password service-name username", - Short: "Reset the credentials of a DBaaS Grafana user", - Long: cli.Markdown("If no password is provided one will be generated automatically.\n## Request Schema (application/json)\n\nproperties:\n password:\n $ref: '#/components/schemas/dbaas-user-password'\ntype: object\n"), + Use: "update-dbaas-service-mysql name", + Short: "Update a DBaaS MySQL service", + Long: cli.Markdown("Update a DBaaS MySQL service\n## Request Schema (application/json)\n\nproperties:\n backup-schedule:\n properties:\n backup-hour:\n description: The hour of day (in UTC) when backup for the service is started. New backup is only started if previous backup has already completed.\n format: int64\n maximum: 23\n minimum: 0\n nullable: true\n type: integer\n backup-minute:\n description: The minute of an hour when backup for the service is started. New backup is only started if previous backup has already completed.\n format: int64\n maximum: 59\n minimum: 0\n nullable: true\n type: integer\n type: object\n binlog-retention-period:\n description: The minimum amount of time in seconds to keep binlog entries before deletion. This may be extended for services that require binlog entries for longer than the default for example if using the MySQL Debezium Kafka connector.\n format: int64\n maximum: 86400\n minimum: 600\n type: integer\n ip-filter:\n description: Allow incoming connections from CIDR address block, e.g. '10.20.0.0/16'\n items:\n type: string\n type: array\n maintenance:\n description: Automatic maintenance settings\n properties:\n dow:\n description: Day of week for installing updates\n enum:\n - saturday\n - tuesday\n - never\n - wednesday\n - sunday\n - friday\n - monday\n - thursday\n type: string\n time:\n description: Time for installing updates, UTC\n maxLength: 8\n minLength: 8\n type: string\n required:\n - dow\n - time\n type: object\n migration:\n description: Migrate data from existing server\n properties:\n dbname:\n description: Database name for bootstrapping the initial connection\n maxLength: 63\n minLength: 1\n type: string\n host:\n description: Hostname or IP address of the server where to migrate data from\n maxLength: 255\n minLength: 1\n type: string\n ignore-dbs:\n description: Comma-separated list of databases, which should be ignored during migration (supported by MySQL only at the moment)\n maxLength: 2048\n minLength: 1\n type: string\n method:\n $ref: '#/components/schemas/enum-migration-method'\n password:\n description: Password for authentication with the server where to migrate data from\n maxLength: 255\n minLength: 1\n type: string\n port:\n description: Port number of the server where to migrate data from\n format: int64\n maximum: 65535\n minimum: 1\n type: integer\n ssl:\n description: The server where to migrate data from is secured with SSL\n type: boolean\n username:\n description: User name for authentication with the server where to migrate data from\n maxLength: 255\n minLength: 1\n type: string\n required:\n - host\n - port\n type: object\n mysql-settings:\n $ref: '#/components/schemas/json-schema-mysql'\n plan:\n description: Subscription plan\n maxLength: 128\n minLength: 1\n type: string\n termination-protection:\n description: Service is protected against termination and powering off\n type: boolean\ntype: object\n"), Example: examples, - Args: cobra.MinimumNArgs(2), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[2:]) + body, err := cli.GetBody("application/json", args[1:]) if err != nil { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XResetDbaasGrafanaUserPassword(args[0], args[1], params, body) + _, decoded, err := XUpdateDbaasServiceMysql(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -14968,14 +18291,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "reveal-dbaas-grafana-user-password service-name username", - Short: "Reveal the secrets of a DBaaS Grafana user", + Use: "enable-dbaas-mysql-writes name", + Short: "Temporarily enable writes for MySQL services in read-only mode due to filled up storage", Long: cli.Markdown(""), Example: examples, - Args: cobra.MinimumNArgs(2), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XRevealDbaasGrafanaUserPassword(args[0], args[1], params) + _, decoded, err := XEnableDbaasMysqlWrites(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -15003,18 +18330,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "create-dbaas-integration", - Short: "create-dbaas-integration", - Long: cli.Markdown("[BETA] Create a new DBaaS integration between two services\n## Request Schema (application/json)\n\nproperties:\n dest-service:\n $ref: '#/components/schemas/dbaas-service-name'\n integration-type:\n $ref: '#/components/schemas/enum-integration-types'\n settings:\n description: Integration settings\n type: object\n source-service:\n $ref: '#/components/schemas/dbaas-service-name'\nrequired:\n- integration-type\n- source-service\n- dest-service\ntype: object\n"), + Use: "start-dbaas-mysql-maintenance name", + Short: "Initiate MySQL maintenance update", + Long: cli.Markdown(""), Example: examples, - Args: cobra.MinimumNArgs(0), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[0:]) + body, err := cli.GetBody("", args[1:]) if err != nil { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XCreateDbaasIntegration(params, body) + _, decoded, err := XStartDbaasMysqlMaintenance(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -15042,14 +18369,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "list-dbaas-integration-settings integration-type source-type dest-type", - Short: "list-dbaas-integration-settings", - Long: cli.Markdown("[BETA] Get DBaaS integration settings"), + Use: "stop-dbaas-mysql-migration name", + Short: "Stop a DBaaS MySQL migration", + Long: cli.Markdown(""), Example: examples, - Args: cobra.MinimumNArgs(3), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XListDbaasIntegrationSettings(args[0], args[1], args[2], params) + _, decoded, err := XStopDbaasMysqlMigration(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -15077,14 +18408,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "list-dbaas-integration-types", - Short: "list-dbaas-integration-types", - Long: cli.Markdown("[BETA] Get DBaaS integration types"), + Use: "create-dbaas-mysql-database service-name", + Short: "Create a DBaaS MySQL database", + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n database-name:\n $ref: '#/components/schemas/dbaas-database-name'\nrequired:\n- database-name\ntype: object\n"), Example: examples, - Args: cobra.MinimumNArgs(0), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XListDbaasIntegrationTypes(params) + _, decoded, err := XCreateDbaasMysqlDatabase(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -15112,14 +18447,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "delete-dbaas-integration id", - Short: "delete-dbaas-integration", - Long: cli.Markdown("[BETA] Delete a DBaaS Integration"), + Use: "delete-dbaas-mysql-database service-name database-name", + Short: "Delete a DBaaS MySQL database", + Long: cli.Markdown(""), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XDeleteDbaasIntegration(args[0], params) + _, decoded, err := XDeleteDbaasMysqlDatabase(args[0], args[1], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -15147,14 +18482,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-dbaas-integration id", - Short: "get-dbaas-integration", - Long: cli.Markdown("[BETA] Get a DBaaS Integration"), + Use: "create-dbaas-mysql-user service-name", + Short: "Create a DBaaS MySQL user", + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n authentication:\n $ref: '#/components/schemas/enum-mysql-authentication-plugin'\n username:\n $ref: '#/components/schemas/dbaas-user-username'\nrequired:\n- username\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XGetDbaasIntegration(args[0], params) + _, decoded, err := XCreateDbaasMysqlUser(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -15182,18 +18521,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "update-dbaas-integration id", - Short: "update-dbaas-integration", - Long: cli.Markdown("[BETA] Update a existing DBaaS integration\n## Request Schema (application/json)\n\nproperties:\n settings:\n description: Integration settings\n type: object\nrequired:\n- settings\ntype: object\n"), + Use: "delete-dbaas-mysql-user service-name username", + Short: "Delete a DBaaS MySQL user", + Long: cli.Markdown(""), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XUpdateDbaasIntegration(args[0], params, body) + _, decoded, err := XDeleteDbaasMysqlUser(args[0], args[1], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -15221,18 +18556,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "create-dbaas-service-kafka name", - Short: "Create a DBaaS Kafka service", - Long: cli.Markdown("Create a DBaaS Kafka service\n## Request Schema (application/json)\n\nproperties:\n authentication-methods:\n description: Kafka authentication methods\n properties:\n certificate:\n description: Enable certificate/SSL authentication\n type: boolean\n sasl:\n description: Enable SASL authentication\n type: boolean\n type: object\n ip-filter:\n description: Allow incoming connections from CIDR address block, e.g. '10.20.0.0/16'\n items:\n type: string\n type: array\n kafka-connect-enabled:\n description: Allow clients to connect to kafka_connect from the public internet for service nodes that are in a project VPC or another type of private network\n type: boolean\n kafka-connect-settings:\n $ref: '#/components/schemas/json-schema-kafka-connect'\n kafka-rest-enabled:\n description: Enable Kafka-REST service\n type: boolean\n kafka-rest-settings:\n $ref: '#/components/schemas/json-schema-kafka-rest'\n kafka-settings:\n $ref: '#/components/schemas/json-schema-kafka'\n maintenance:\n description: Automatic maintenance settings\n properties:\n dow:\n description: Day of week for installing updates\n enum:\n - saturday\n - tuesday\n - never\n - wednesday\n - sunday\n - friday\n - monday\n - thursday\n type: string\n time:\n description: Time for installing updates, UTC\n maxLength: 8\n minLength: 8\n type: string\n required:\n - dow\n - time\n type: object\n plan:\n description: Subscription plan\n maxLength: 128\n minLength: 1\n type: string\n schema-registry-enabled:\n description: Enable Schema-Registry service\n type: boolean\n schema-registry-settings:\n $ref: '#/components/schemas/json-schema-schema-registry'\n termination-protection:\n description: Service is protected against termination and powering off\n type: boolean\n version:\n description: Kafka major version\n minLength: 1\n type: string\nrequired:\n- plan\ntype: object\n"), + Use: "reset-dbaas-mysql-user-password service-name username", + Short: "Reset the credentials of a DBaaS mysql user", + Long: cli.Markdown("If no password is provided one will be generated automatically.\n## Request Schema (application/json)\n\nproperties:\n authentication:\n $ref: '#/components/schemas/enum-mysql-authentication-plugin'\n password:\n $ref: '#/components/schemas/dbaas-mysql-user-password'\ntype: object\n"), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) + body, err := cli.GetBody("application/json", args[2:]) if err != nil { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XCreateDbaasServiceKafka(args[0], params, body) + _, decoded, err := XResetDbaasMysqlUserPassword(args[0], args[1], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -15260,14 +18595,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "delete-dbaas-service-kafka name", - Short: "Delete a Kafka service", + Use: "reveal-dbaas-mysql-user-password service-name username", + Short: "Reveal the secrets of a DBaaS MySQL user", Long: cli.Markdown(""), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XDeleteDbaasServiceKafka(args[0], params) + _, decoded, err := XRevealDbaasMysqlUserPassword(args[0], args[1], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -15295,14 +18630,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-dbaas-service-kafka name", - Short: "Get a DBaaS Kafka service", - Long: cli.Markdown(""), + Use: "create-dbaas-service-opensearch name", + Short: "Create a DBaaS OpenSearch service", + Long: cli.Markdown("Create a DBaaS OpenSearch service\n## Request Schema (application/json)\n\nproperties:\n fork-from-service:\n $ref: '#/components/schemas/dbaas-service-name'\n index-patterns:\n description: 'Allows you to create glob style patterns and set a max number of indexes matching this pattern you want to keep. Creating indexes exceeding this value will cause the oldest one to get deleted. You could for example create a pattern looking like ''logs.?'' and then create index logs.1, logs.2 etc, it will delete logs.1 once you create logs.6. Do note ''logs.?'' does not apply to logs.10. Note: Setting max_index_count to 0 will do nothing and the pattern gets ignored.'\n items:\n properties:\n max-index-count:\n description: Maximum number of indexes to keep\n format: int64\n minimum: 0\n nullable: true\n type: integer\n pattern:\n description: fnmatch pattern\n maxLength: 1024\n type: string\n sorting-algorithm:\n description: Deletion sorting algorithm\n enum:\n - alphabetical\n - creation_date\n type: string\n type: object\n type: array\n index-template:\n description: Template settings for all new indexes\n properties:\n mapping-nested-objects-limit:\n description: The maximum number of nested JSON objects that a single document can contain across all nested types. This limit helps to prevent out of memory errors when a document contains too many nested objects. Default is 10000.\n format: int64\n maximum: 100000\n minimum: 0\n nullable: true\n type: integer\n number-of-replicas:\n description: The number of replicas each primary shard has.\n format: int64\n maximum: 29\n minimum: 0\n nullable: true\n type: integer\n number-of-shards:\n description: The number of primary shards that an index should have.\n format: int64\n maximum: 1024\n minimum: 1\n type: integer\n type: object\n ip-filter:\n description: Allow incoming connections from CIDR address block, e.g. '10.20.0.0/16'\n items:\n type: string\n type: array\n keep-index-refresh-interval:\n description: Aiven automation resets index.refresh_interval to default value for every index to be sure that indices are always visible to search. If it doesn't fit your case, you can disable this by setting up this flag to true.\n type: boolean\n maintenance:\n description: Automatic maintenance settings\n properties:\n dow:\n description: Day of week for installing updates\n enum:\n - saturday\n - tuesday\n - never\n - wednesday\n - sunday\n - friday\n - monday\n - thursday\n type: string\n time:\n description: Time for installing updates, UTC\n maxLength: 8\n minLength: 8\n type: string\n required:\n - dow\n - time\n type: object\n max-index-count:\n description: Maximum number of indexes to keep before deleting the oldest one\n format: int64\n minimum: 0\n nullable: true\n type: integer\n opensearch-dashboards:\n description: OpenSearch Dashboards settings\n properties:\n enabled:\n description: 'Enable or disable OpenSearch Dashboards (default: true)'\n type: boolean\n max-old-space-size:\n description: 'Limits the maximum amount of memory (in MiB) the OpenSearch Dashboards process can use. This sets the max_old_space_size option of the nodejs running the OpenSearch Dashboards. Note: the memory reserved by OpenSearch Dashboards is not available for OpenSearch. (default: 128)'\n format: int64\n maximum: 1024\n minimum: 64\n type: integer\n opensearch-request-timeout:\n description: 'Timeout in milliseconds for requests made by OpenSearch Dashboards towards OpenSearch (default: 30000)'\n format: int64\n maximum: 120000\n minimum: 5000\n type: integer\n type: object\n opensearch-settings:\n $ref: '#/components/schemas/json-schema-opensearch'\n plan:\n description: Subscription plan\n maxLength: 128\n minLength: 1\n type: string\n recovery-backup-name:\n description: Name of a backup to recover from for services that support backup names\n minLength: 1\n type: string\n termination-protection:\n description: Service is protected against termination and powering off\n type: boolean\n version:\n description: OpenSearch major version\n minLength: 1\n type: string\nrequired:\n- plan\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XGetDbaasServiceKafka(args[0], params) + _, decoded, err := XCreateDbaasServiceOpensearch(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -15330,18 +18669,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "update-dbaas-service-kafka name", - Short: "Update a DBaaS Kafka service", - Long: cli.Markdown("Update a DBaaS Kafka service\n## Request Schema (application/json)\n\nproperties:\n authentication-methods:\n description: Kafka authentication methods\n properties:\n certificate:\n description: Enable certificate/SSL authentication\n type: boolean\n sasl:\n description: Enable SASL authentication\n type: boolean\n type: object\n ip-filter:\n description: Allow incoming connections from CIDR address block, e.g. '10.20.0.0/16'\n items:\n type: string\n type: array\n kafka-connect-enabled:\n description: Allow clients to connect to kafka_connect from the public internet for service nodes that are in a project VPC or another type of private network\n type: boolean\n kafka-connect-settings:\n $ref: '#/components/schemas/json-schema-kafka-connect'\n kafka-rest-enabled:\n description: Enable Kafka-REST service\n type: boolean\n kafka-rest-settings:\n $ref: '#/components/schemas/json-schema-kafka-rest'\n kafka-settings:\n $ref: '#/components/schemas/json-schema-kafka'\n maintenance:\n description: Automatic maintenance settings\n properties:\n dow:\n description: Day of week for installing updates\n enum:\n - saturday\n - tuesday\n - never\n - wednesday\n - sunday\n - friday\n - monday\n - thursday\n type: string\n time:\n description: Time for installing updates, UTC\n maxLength: 8\n minLength: 8\n type: string\n required:\n - dow\n - time\n type: object\n plan:\n description: Subscription plan\n maxLength: 128\n minLength: 1\n type: string\n schema-registry-enabled:\n description: Enable Schema-Registry service\n type: boolean\n schema-registry-settings:\n $ref: '#/components/schemas/json-schema-schema-registry'\n termination-protection:\n description: Service is protected against termination and powering off\n type: boolean\n version:\n description: Kafka major version\n minLength: 1\n type: string\ntype: object\n"), + Use: "delete-dbaas-service-opensearch name", + Short: "Delete a OpenSearch service", + Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XUpdateDbaasServiceKafka(args[0], params, body) + _, decoded, err := XDeleteDbaasServiceOpensearch(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -15369,14 +18704,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-dbaas-kafka-acl-config name", - Short: "Get DBaaS kafka ACL configuration", - Long: cli.Markdown(""), + Use: "get-dbaas-service-opensearch name", + Short: "Get a DBaaS OpenSearch service", + Long: cli.Markdown("Get a DBaaS OpenSearch service"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XGetDbaasKafkaAclConfig(args[0], params) + _, decoded, err := XGetDbaasServiceOpensearch(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -15404,18 +18739,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "start-dbaas-kafka-maintenance name", - Short: "Initiate Kafka maintenance update", - Long: cli.Markdown(""), + Use: "update-dbaas-service-opensearch name", + Short: "Update a DBaaS OpenSearch service", + Long: cli.Markdown("Update a DBaaS OpenSearch service\n## Request Schema (application/json)\n\nproperties:\n index-patterns:\n description: 'Allows you to create glob style patterns and set a max number of indexes matching this pattern you want to keep. Creating indexes exceeding this value will cause the oldest one to get deleted. You could for example create a pattern looking like ''logs.?'' and then create index logs.1, logs.2 etc, it will delete logs.1 once you create logs.6. Do note ''logs.?'' does not apply to logs.10. Note: Setting max_index_count to 0 will do nothing and the pattern gets ignored.'\n items:\n properties:\n max-index-count:\n description: Maximum number of indexes to keep\n format: int64\n minimum: 0\n nullable: true\n type: integer\n pattern:\n description: fnmatch pattern\n maxLength: 1024\n type: string\n sorting-algorithm:\n description: Deletion sorting algorithm\n enum:\n - alphabetical\n - creation_date\n type: string\n type: object\n type: array\n index-template:\n description: Template settings for all new indexes\n properties:\n mapping-nested-objects-limit:\n description: The maximum number of nested JSON objects that a single document can contain across all nested types. This limit helps to prevent out of memory errors when a document contains too many nested objects. Default is 10000.\n format: int64\n maximum: 100000\n minimum: 0\n nullable: true\n type: integer\n number-of-replicas:\n description: The number of replicas each primary shard has.\n format: int64\n maximum: 29\n minimum: 0\n nullable: true\n type: integer\n number-of-shards:\n description: The number of primary shards that an index should have.\n format: int64\n maximum: 1024\n minimum: 1\n type: integer\n type: object\n ip-filter:\n description: Allow incoming connections from CIDR address block, e.g. '10.20.0.0/16'\n items:\n type: string\n type: array\n keep-index-refresh-interval:\n description: Aiven automation resets index.refresh_interval to default value for every index to be sure that indices are always visible to search. If it doesn't fit your case, you can disable this by setting up this flag to true.\n type: boolean\n maintenance:\n description: Automatic maintenance settings\n properties:\n dow:\n description: Day of week for installing updates\n enum:\n - saturday\n - tuesday\n - never\n - wednesday\n - sunday\n - friday\n - monday\n - thursday\n type: string\n time:\n description: Time for installing updates, UTC\n maxLength: 8\n minLength: 8\n type: string\n required:\n - dow\n - time\n type: object\n max-index-count:\n description: Maximum number of indexes to keep before deleting the oldest one\n format: int64\n minimum: 0\n nullable: true\n type: integer\n opensearch-dashboards:\n description: OpenSearch Dashboards settings\n properties:\n enabled:\n description: 'Enable or disable OpenSearch Dashboards (default: true)'\n type: boolean\n max-old-space-size:\n description: 'Limits the maximum amount of memory (in MiB) the OpenSearch Dashboards process can use. This sets the max_old_space_size option of the nodejs running the OpenSearch Dashboards. Note: the memory reserved by OpenSearch Dashboards is not available for OpenSearch. (default: 128)'\n format: int64\n maximum: 1024\n minimum: 64\n type: integer\n opensearch-request-timeout:\n description: 'Timeout in milliseconds for requests made by OpenSearch Dashboards towards OpenSearch (default: 30000)'\n format: int64\n maximum: 120000\n minimum: 5000\n type: integer\n type: object\n opensearch-settings:\n $ref: '#/components/schemas/json-schema-opensearch'\n plan:\n description: Subscription plan\n maxLength: 128\n minLength: 1\n type: string\n termination-protection:\n description: Service is protected against termination and powering off\n type: boolean\n version:\n description: Version\n type: string\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("", args[1:]) + body, err := cli.GetBody("application/json", args[1:]) if err != nil { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XStartDbaasKafkaMaintenance(args[0], params, body) + _, decoded, err := XUpdateDbaasServiceOpensearch(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -15443,18 +18778,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "create-dbaas-kafka-schema-registry-acl-config name", - Short: "Add a Kafka Schema Registry ACL entry", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n id:\n $ref: '#/components/schemas/dbaas-kafka-acl-id'\n permission:\n description: Kafka Schema Registry permission\n enum:\n - schema_registry_read\n - schema_registry_write\n type: string\n resource:\n description: Kafka Schema Registry name or pattern\n maxLength: 249\n minLength: 1\n type: string\n username:\n description: Kafka username or username pattern\n maxLength: 64\n minLength: 1\n type: string\nrequired:\n- username\n- resource\n- permission\ntype: object\n"), + Use: "get-dbaas-opensearch-acl-config name", + Short: "Get DBaaS OpenSearch ACL configuration", + Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XCreateDbaasKafkaSchemaRegistryAclConfig(args[0], params, body) + _, decoded, err := XGetDbaasOpensearchAclConfig(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -15482,14 +18813,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "delete-dbaas-kafka-schema-registry-acl-config name acl-id", - Short: "Delete a Kafka ACL entry", - Long: cli.Markdown(""), + Use: "update-dbaas-opensearch-acl-config name", + Short: "Create a DBaaS OpenSearch ACL configuration", + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n acl-enabled:\n description: Enable OpenSearch ACLs. When disabled authenticated service users have unrestricted access.\n type: boolean\n acls:\n description: List of OpenSearch ACLs\n items:\n properties:\n rules:\n items:\n properties:\n index:\n description: OpenSearch index pattern\n maxLength: 249\n type: string\n permission:\n $ref: '#/components/schemas/enum-opensearch-rule-permission'\n required:\n - index\n type: object\n type: array\n username:\n $ref: '#/components/schemas/dbaas-user-username'\n type: object\n type: array\n extended-acl-enabled:\n description: Enable to enforce index rules in a limited fashion for requests that use the _mget, _msearch, and _bulk APIs\n type: boolean\ntype: object\n"), Example: examples, - Args: cobra.MinimumNArgs(2), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XDeleteDbaasKafkaSchemaRegistryAclConfig(args[0], args[1], params) + _, decoded, err := XUpdateDbaasOpensearchAclConfig(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -15517,18 +18852,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "create-dbaas-kafka-topic-acl-config name", - Short: "Add a Kafka topic ACL entry", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n id:\n $ref: '#/components/schemas/dbaas-kafka-acl-id'\n permission:\n description: Kafka permission\n enum:\n - admin\n - read\n - readwrite\n - write\n type: string\n topic:\n description: Kafka topic name or pattern\n maxLength: 249\n minLength: 1\n type: string\n username:\n description: Kafka username or username pattern\n maxLength: 64\n minLength: 1\n type: string\nrequired:\n- username\n- topic\n- permission\ntype: object\n"), + Use: "start-dbaas-opensearch-maintenance name", + Short: "Initiate OpenSearch maintenance update", + Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) + body, err := cli.GetBody("", args[1:]) if err != nil { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XCreateDbaasKafkaTopicAclConfig(args[0], params, body) + _, decoded, err := XStartDbaasOpensearchMaintenance(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -15556,14 +18891,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "delete-dbaas-kafka-topic-acl-config name acl-id", - Short: "Delete a Kafka ACL entry", - Long: cli.Markdown(""), + Use: "create-dbaas-opensearch-user service-name", + Short: "Create a DBaaS OpenSearch user", + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n username:\n $ref: '#/components/schemas/dbaas-user-username'\nrequired:\n- username\ntype: object\n"), Example: examples, - Args: cobra.MinimumNArgs(2), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XDeleteDbaasKafkaTopicAclConfig(args[0], args[1], params) + _, decoded, err := XCreateDbaasOpensearchUser(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -15591,14 +18930,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "reveal-dbaas-kafka-connect-password service-name", - Short: "Reveal the secrets for DBaaS Kafka Connect", + Use: "delete-dbaas-opensearch-user service-name username", + Short: "Delete a DBaaS OpenSearch user", Long: cli.Markdown(""), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XRevealDbaasKafkaConnectPassword(args[0], params) + _, decoded, err := XDeleteDbaasOpensearchUser(args[0], args[1], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -15626,18 +18965,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "create-dbaas-kafka-user service-name", - Short: "Create a DBaaS Kafka user", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n username:\n $ref: '#/components/schemas/dbaas-user-username'\nrequired:\n- username\ntype: object\n"), + Use: "reset-dbaas-opensearch-user-password service-name username", + Short: "Reset the credentials of a DBaaS OpenSearch user", + Long: cli.Markdown("If no password is provided one will be generated automatically.\n## Request Schema (application/json)\n\nproperties:\n password:\n $ref: '#/components/schemas/dbaas-user-password'\ntype: object\n"), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) + body, err := cli.GetBody("application/json", args[2:]) if err != nil { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XCreateDbaasKafkaUser(args[0], params, body) + _, decoded, err := XResetDbaasOpensearchUserPassword(args[0], args[1], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -15665,14 +19004,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "delete-dbaas-kafka-user service-name username", - Short: "Delete a DBaaS kafka user", + Use: "reveal-dbaas-opensearch-user-password service-name username", + Short: "Reveal the secrets of a DBaaS OpenSearch user", Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XDeleteDbaasKafkaUser(args[0], args[1], params) + _, decoded, err := XRevealDbaasOpensearchUserPassword(args[0], args[1], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -15700,18 +19039,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "reset-dbaas-kafka-user-password service-name username", - Short: "Reset the credentials of a DBaaS Kafka user", - Long: cli.Markdown("If no password is provided one will be generated automatically.\n## Request Schema (application/json)\n\nproperties:\n password:\n $ref: '#/components/schemas/dbaas-user-password'\ntype: object\n"), + Use: "create-dbaas-service-pg name", + Short: "Create a DBaaS PostgreSQL service", + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n admin-password:\n description: Custom password for admin user. Defaults to random string. This must be set only when a new service is being created.\n maxLength: 256\n minLength: 8\n pattern: ^[a-zA-Z0-9-_]+$\n type: string\n admin-username:\n description: Custom username for admin user. This must be set only when a new service is being created.\n maxLength: 64\n minLength: 1\n pattern: ^[_A-Za-z0-9][-._A-Za-z0-9]{0,63}$\n type: string\n backup-schedule:\n properties:\n backup-hour:\n description: The hour of day (in UTC) when backup for the service is started. New backup is only started if previous backup has already completed.\n format: int64\n maximum: 23\n minimum: 0\n nullable: true\n type: integer\n backup-minute:\n description: The minute of an hour when backup for the service is started. New backup is only started if previous backup has already completed.\n format: int64\n maximum: 59\n minimum: 0\n nullable: true\n type: integer\n type: object\n fork-from-service:\n $ref: '#/components/schemas/dbaas-service-name'\n integrations:\n description: Service integrations to be enabled when creating the service.\n items:\n properties:\n dest-service:\n $ref: '#/components/schemas/dbaas-service-name'\n settings:\n description: Integration settings\n type: object\n source-service:\n $ref: '#/components/schemas/dbaas-service-name'\n type:\n description: Integration type\n enum:\n - read_replica\n type: string\n required:\n - type\n type: object\n type: array\n ip-filter:\n description: Allow incoming connections from CIDR address block, e.g. '10.20.0.0/16'\n items:\n type: string\n type: array\n maintenance:\n description: Automatic maintenance settings\n properties:\n dow:\n description: Day of week for installing updates\n enum:\n - saturday\n - tuesday\n - never\n - wednesday\n - sunday\n - friday\n - monday\n - thursday\n type: string\n time:\n description: Time for installing updates, UTC\n maxLength: 8\n minLength: 8\n type: string\n required:\n - dow\n - time\n type: object\n migration:\n description: Migrate data from existing server\n properties:\n dbname:\n description: Database name for bootstrapping the initial connection\n maxLength: 63\n minLength: 1\n type: string\n host:\n description: Hostname or IP address of the server where to migrate data from\n maxLength: 255\n minLength: 1\n type: string\n ignore-dbs:\n description: Comma-separated list of databases, which should be ignored during migration (supported by MySQL only at the moment)\n maxLength: 2048\n minLength: 1\n type: string\n method:\n $ref: '#/components/schemas/enum-migration-method'\n password:\n description: Password for authentication with the server where to migrate data from\n maxLength: 255\n minLength: 1\n type: string\n port:\n description: Port number of the server where to migrate data from\n format: int64\n maximum: 65535\n minimum: 1\n type: integer\n ssl:\n description: The server where to migrate data from is secured with SSL\n type: boolean\n username:\n description: User name for authentication with the server where to migrate data from\n maxLength: 255\n minLength: 1\n type: string\n required:\n - host\n - port\n type: object\n pg-settings:\n $ref: '#/components/schemas/json-schema-pg'\n pgbouncer-settings:\n $ref: '#/components/schemas/json-schema-pgbouncer'\n pglookout-settings:\n $ref: '#/components/schemas/json-schema-pglookout'\n plan:\n description: Subscription plan\n maxLength: 128\n minLength: 1\n type: string\n recovery-backup-time:\n description: ISO time of a backup to recover from for services that support arbitrary times\n minLength: 1\n type: string\n shared-buffers-percentage:\n description: Percentage of total RAM that the database server uses for shared memory buffers. Valid range is 20-60 (float), which corresponds to 20% - 60%. This setting adjusts the shared_buffers configuration value.\n format: int64\n maximum: 60\n minimum: 20\n type: integer\n synchronous-replication:\n $ref: '#/components/schemas/enum-pg-synchronous-replication'\n termination-protection:\n description: Service is protected against termination and powering off\n type: boolean\n timescaledb-settings:\n $ref: '#/components/schemas/json-schema-timescaledb'\n variant:\n $ref: '#/components/schemas/enum-pg-variant'\n version:\n $ref: '#/components/schemas/dbaas-pg-target-versions'\n work-mem:\n description: Sets the maximum amount of memory to be used by a query operation (such as a sort or hash table) before writing to temporary disk files, in MB. Default is 1MB + 0.075% of total RAM (up to 32MB).\n format: int64\n maximum: 1024\n minimum: 1\n type: integer\nrequired:\n- plan\ntype: object\n"), Example: examples, - Args: cobra.MinimumNArgs(2), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[2:]) + body, err := cli.GetBody("application/json", args[1:]) if err != nil { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XResetDbaasKafkaUserPassword(args[0], args[1], params, body) + _, decoded, err := XCreateDbaasServicePg(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -15739,14 +19078,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "reveal-dbaas-kafka-user-password service-name username", - Short: "Reveal the secrets of a DBaaS Kafka user", + Use: "delete-dbaas-service-pg name", + Short: "Delete a Postgres service", Long: cli.Markdown(""), Example: examples, - Args: cobra.MinimumNArgs(2), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XRevealDbaasKafkaUserPassword(args[0], args[1], params) + _, decoded, err := XDeleteDbaasServicePg(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -15774,14 +19113,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-dbaas-migration-status name", - Short: "Get a DBaaS migration status", - Long: cli.Markdown("Get a DBaaS migration status"), + Use: "get-dbaas-service-pg name", + Short: "Get a DBaaS PostgreSQL service", + Long: cli.Markdown("Get a DBaaS PostgreSQL service"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XGetDbaasMigrationStatus(args[0], params) + _, decoded, err := XGetDbaasServicePg(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -15809,9 +19148,9 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "create-dbaas-service-mysql name", - Short: "Create a DBaaS MySQL service", - Long: cli.Markdown("Create a DBaaS MySQL service\n## Request Schema (application/json)\n\nproperties:\n admin-password:\n description: Custom password for admin user. Defaults to random string. This must be set only when a new service is being created.\n maxLength: 256\n minLength: 8\n pattern: ^[a-zA-Z0-9-_]+$\n type: string\n admin-username:\n description: Custom username for admin user. This must be set only when a new service is being created.\n maxLength: 64\n minLength: 1\n pattern: ^[_A-Za-z0-9][-._A-Za-z0-9]{0,63}$\n type: string\n backup-schedule:\n properties:\n backup-hour:\n description: The hour of day (in UTC) when backup for the service is started. New backup is only started if previous backup has already completed.\n format: int64\n maximum: 23\n minimum: 0\n type: integer\n backup-minute:\n description: The minute of an hour when backup for the service is started. New backup is only started if previous backup has already completed.\n format: int64\n maximum: 59\n minimum: 0\n type: integer\n type: object\n binlog-retention-period:\n description: The minimum amount of time in seconds to keep binlog entries before deletion. This may be extended for services that require binlog entries for longer than the default for example if using the MySQL Debezium Kafka connector.\n format: int64\n maximum: 86400\n minimum: 600\n type: integer\n fork-from-service:\n $ref: '#/components/schemas/dbaas-service-name'\n integrations:\n description: Service integrations to be enabled when creating the service.\n items:\n properties:\n dest-service:\n $ref: '#/components/schemas/dbaas-service-name'\n settings:\n description: Integration settings\n type: object\n source-service:\n $ref: '#/components/schemas/dbaas-service-name'\n type:\n description: Integration type\n enum:\n - read_replica\n type: string\n required:\n - type\n type: object\n type: array\n ip-filter:\n description: Allow incoming connections from CIDR address block, e.g. '10.20.0.0/16'\n items:\n type: string\n type: array\n maintenance:\n description: Automatic maintenance settings\n properties:\n dow:\n description: Day of week for installing updates\n enum:\n - saturday\n - tuesday\n - never\n - wednesday\n - sunday\n - friday\n - monday\n - thursday\n type: string\n time:\n description: Time for installing updates, UTC\n maxLength: 8\n minLength: 8\n type: string\n required:\n - dow\n - time\n type: object\n migration:\n description: Migrate data from existing server\n properties:\n dbname:\n description: Database name for bootstrapping the initial connection\n maxLength: 63\n minLength: 1\n type: string\n host:\n description: Hostname or IP address of the server where to migrate data from\n maxLength: 255\n minLength: 1\n type: string\n ignore-dbs:\n description: Comma-separated list of databases, which should be ignored during migration (supported by MySQL only at the moment)\n maxLength: 2048\n minLength: 1\n type: string\n method:\n $ref: '#/components/schemas/enum-migration-method'\n password:\n description: Password for authentication with the server where to migrate data from\n maxLength: 255\n minLength: 1\n type: string\n port:\n description: Port number of the server where to migrate data from\n format: int64\n maximum: 65535\n minimum: 1\n type: integer\n ssl:\n description: The server where to migrate data from is secured with SSL\n type: boolean\n username:\n description: User name for authentication with the server where to migrate data from\n maxLength: 255\n minLength: 1\n type: string\n required:\n - host\n - port\n type: object\n mysql-settings:\n $ref: '#/components/schemas/json-schema-mysql'\n plan:\n description: Subscription plan\n maxLength: 128\n minLength: 1\n type: string\n recovery-backup-time:\n description: ISO time of a backup to recover from for services that support arbitrary times\n minLength: 1\n type: string\n termination-protection:\n description: Service is protected against termination and powering off\n type: boolean\n version:\n description: MySQL major version\n minLength: 1\n type: string\nrequired:\n- plan\ntype: object\n"), + Use: "update-dbaas-service-pg name", + Short: "Update a DBaaS PostgreSQL service", + Long: cli.Markdown("Update a DBaaS PostgreSQL service\n## Request Schema (application/json)\n\nproperties:\n backup-schedule:\n properties:\n backup-hour:\n description: The hour of day (in UTC) when backup for the service is started. New backup is only started if previous backup has already completed.\n format: int64\n maximum: 23\n minimum: 0\n nullable: true\n type: integer\n backup-minute:\n description: The minute of an hour when backup for the service is started. New backup is only started if previous backup has already completed.\n format: int64\n maximum: 59\n minimum: 0\n nullable: true\n type: integer\n type: object\n ip-filter:\n description: Allow incoming connections from CIDR address block, e.g. '10.20.0.0/16'\n items:\n type: string\n type: array\n maintenance:\n description: Automatic maintenance settings\n properties:\n dow:\n description: Day of week for installing updates\n enum:\n - saturday\n - tuesday\n - never\n - wednesday\n - sunday\n - friday\n - monday\n - thursday\n type: string\n time:\n description: Time for installing updates, UTC\n maxLength: 8\n minLength: 8\n type: string\n required:\n - dow\n - time\n type: object\n migration:\n description: Migrate data from existing server\n properties:\n dbname:\n description: Database name for bootstrapping the initial connection\n maxLength: 63\n minLength: 1\n type: string\n host:\n description: Hostname or IP address of the server where to migrate data from\n maxLength: 255\n minLength: 1\n type: string\n ignore-dbs:\n description: Comma-separated list of databases, which should be ignored during migration (supported by MySQL only at the moment)\n maxLength: 2048\n minLength: 1\n type: string\n method:\n $ref: '#/components/schemas/enum-migration-method'\n password:\n description: Password for authentication with the server where to migrate data from\n maxLength: 255\n minLength: 1\n type: string\n port:\n description: Port number of the server where to migrate data from\n format: int64\n maximum: 65535\n minimum: 1\n type: integer\n ssl:\n description: The server where to migrate data from is secured with SSL\n type: boolean\n username:\n description: User name for authentication with the server where to migrate data from\n maxLength: 255\n minLength: 1\n type: string\n required:\n - host\n - port\n type: object\n pg-settings:\n $ref: '#/components/schemas/json-schema-pg'\n pgbouncer-settings:\n $ref: '#/components/schemas/json-schema-pgbouncer'\n pglookout-settings:\n $ref: '#/components/schemas/json-schema-pglookout'\n plan:\n description: Subscription plan\n maxLength: 128\n minLength: 1\n type: string\n shared-buffers-percentage:\n description: Percentage of total RAM that the database server uses for shared memory buffers. Valid range is 20-60 (float), which corresponds to 20% - 60%. This setting adjusts the shared_buffers configuration value.\n format: int64\n maximum: 60\n minimum: 20\n type: integer\n synchronous-replication:\n $ref: '#/components/schemas/enum-pg-synchronous-replication'\n termination-protection:\n description: Service is protected against termination and powering off\n type: boolean\n timescaledb-settings:\n $ref: '#/components/schemas/json-schema-timescaledb'\n variant:\n $ref: '#/components/schemas/enum-pg-variant'\n version:\n description: Version\n type: string\n work-mem:\n description: Sets the maximum amount of memory to be used by a query operation (such as a sort or hash table) before writing to temporary disk files, in MB. Default is 1MB + 0.075% of total RAM (up to 32MB).\n format: int64\n maximum: 1024\n minimum: 1\n type: integer\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { @@ -15820,7 +19159,7 @@ func xRegister(subcommand bool) { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XCreateDbaasServiceMysql(args[0], params, body) + _, decoded, err := XUpdateDbaasServicePg(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -15848,14 +19187,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "delete-dbaas-service-mysql name", - Short: "Delete a MySQL service", + Use: "start-dbaas-pg-maintenance name", + Short: "Initiate PostgreSQL maintenance update", Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XDeleteDbaasServiceMysql(args[0], params) + _, decoded, err := XStartDbaasPgMaintenance(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -15883,14 +19226,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-dbaas-service-mysql name", - Short: "Get a DBaaS MySQL service", - Long: cli.Markdown("Get a DBaaS MySQL service"), + Use: "stop-dbaas-pg-migration name", + Short: "Stop a DBaaS PostgreSQL migration", + Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XGetDbaasServiceMysql(args[0], params) + _, decoded, err := XStopDbaasPgMigration(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -15918,9 +19265,9 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "update-dbaas-service-mysql name", - Short: "Update a DBaaS MySQL service", - Long: cli.Markdown("Update a DBaaS MySQL service\n## Request Schema (application/json)\n\nproperties:\n backup-schedule:\n properties:\n backup-hour:\n description: The hour of day (in UTC) when backup for the service is started. New backup is only started if previous backup has already completed.\n format: int64\n maximum: 23\n minimum: 0\n type: integer\n backup-minute:\n description: The minute of an hour when backup for the service is started. New backup is only started if previous backup has already completed.\n format: int64\n maximum: 59\n minimum: 0\n type: integer\n type: object\n binlog-retention-period:\n description: The minimum amount of time in seconds to keep binlog entries before deletion. This may be extended for services that require binlog entries for longer than the default for example if using the MySQL Debezium Kafka connector.\n format: int64\n maximum: 86400\n minimum: 600\n type: integer\n ip-filter:\n description: Allow incoming connections from CIDR address block, e.g. '10.20.0.0/16'\n items:\n type: string\n type: array\n maintenance:\n description: Automatic maintenance settings\n properties:\n dow:\n description: Day of week for installing updates\n enum:\n - saturday\n - tuesday\n - never\n - wednesday\n - sunday\n - friday\n - monday\n - thursday\n type: string\n time:\n description: Time for installing updates, UTC\n maxLength: 8\n minLength: 8\n type: string\n required:\n - dow\n - time\n type: object\n migration:\n description: Migrate data from existing server\n properties:\n dbname:\n description: Database name for bootstrapping the initial connection\n maxLength: 63\n minLength: 1\n type: string\n host:\n description: Hostname or IP address of the server where to migrate data from\n maxLength: 255\n minLength: 1\n type: string\n ignore-dbs:\n description: Comma-separated list of databases, which should be ignored during migration (supported by MySQL only at the moment)\n maxLength: 2048\n minLength: 1\n type: string\n method:\n $ref: '#/components/schemas/enum-migration-method'\n password:\n description: Password for authentication with the server where to migrate data from\n maxLength: 255\n minLength: 1\n type: string\n port:\n description: Port number of the server where to migrate data from\n format: int64\n maximum: 65535\n minimum: 1\n type: integer\n ssl:\n description: The server where to migrate data from is secured with SSL\n type: boolean\n username:\n description: User name for authentication with the server where to migrate data from\n maxLength: 255\n minLength: 1\n type: string\n required:\n - host\n - port\n type: object\n mysql-settings:\n $ref: '#/components/schemas/json-schema-mysql'\n plan:\n description: Subscription plan\n maxLength: 128\n minLength: 1\n type: string\n termination-protection:\n description: Service is protected against termination and powering off\n type: boolean\ntype: object\n"), + Use: "create-dbaas-pg-connection-pool service-name", + Short: "Create a DBaaS PostgreSQL connection pool", + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n database-name:\n $ref: '#/components/schemas/dbaas-database-name'\n mode:\n $ref: '#/components/schemas/enum-pg-pool-mode'\n name:\n $ref: '#/components/schemas/dbaas-pg-pool-name'\n size:\n $ref: '#/components/schemas/dbaas-pg-pool-size'\n username:\n $ref: '#/components/schemas/dbaas-pg-pool-username'\nrequired:\n- name\n- database-name\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { @@ -15929,7 +19276,7 @@ func xRegister(subcommand bool) { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XUpdateDbaasServiceMysql(args[0], params, body) + _, decoded, err := XCreateDbaasPgConnectionPool(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -15957,18 +19304,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "enable-dbaas-mysql-writes name", - Short: "Temporarily enable writes for MySQL services in read-only mode due to filled up storage", + Use: "delete-dbaas-pg-connection-pool service-name connection-pool-name", + Short: "Delete a DBaaS PostgreSQL connection pool", Long: cli.Markdown(""), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XEnableDbaasMysqlWrites(args[0], params, body) + _, decoded, err := XDeleteDbaasPgConnectionPool(args[0], args[1], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -15996,18 +19339,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "start-dbaas-mysql-maintenance name", - Short: "Initiate MySQL maintenance update", - Long: cli.Markdown(""), + Use: "update-dbaas-pg-connection-pool service-name connection-pool-name", + Short: "Update a DBaaS PostgreSQL connection pool", + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n database-name:\n $ref: '#/components/schemas/dbaas-database-name'\n mode:\n $ref: '#/components/schemas/enum-pg-pool-mode'\n size:\n $ref: '#/components/schemas/dbaas-pg-pool-size'\n username:\n $ref: '#/components/schemas/dbaas-pg-pool-username'\ntype: object\n"), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("", args[1:]) + body, err := cli.GetBody("application/json", args[2:]) if err != nil { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XStartDbaasMysqlMaintenance(args[0], params, body) + _, decoded, err := XUpdateDbaasPgConnectionPool(args[0], args[1], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -16035,18 +19378,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "stop-dbaas-mysql-migration name", - Short: "Stop a DBaaS MySQL migration", - Long: cli.Markdown(""), + Use: "create-dbaas-pg-database service-name", + Short: "Create a DBaaS Postgres database", + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n database-name:\n $ref: '#/components/schemas/dbaas-database-name'\n lc-collate:\n description: Default string sort order (LC_COLLATE) for PostgreSQL database\n maxLength: 128\n type: string\n lc-ctype:\n description: Default character classification (LC_CTYPE) for PostgreSQL database\n maxLength: 128\n type: string\nrequired:\n- database-name\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("", args[1:]) + body, err := cli.GetBody("application/json", args[1:]) if err != nil { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XStopDbaasMysqlMigration(args[0], params, body) + _, decoded, err := XCreateDbaasPgDatabase(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -16074,18 +19417,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "create-dbaas-mysql-database service-name", - Short: "Create a DBaaS MySQL database", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n database-name:\n $ref: '#/components/schemas/dbaas-database-name'\nrequired:\n- database-name\ntype: object\n"), + Use: "delete-dbaas-pg-database service-name database-name", + Short: "Delete a DBaaS Postgres database", + Long: cli.Markdown(""), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XCreateDbaasMysqlDatabase(args[0], params, body) + _, decoded, err := XDeleteDbaasPgDatabase(args[0], args[1], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -16113,14 +19452,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "delete-dbaas-mysql-database service-name database-name", - Short: "Delete a DBaaS MySQL database", - Long: cli.Markdown(""), + Use: "create-dbaas-postgres-user service-name", + Short: "Create a DBaaS Postgres user", + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n allow-replication:\n type: boolean\n username:\n $ref: '#/components/schemas/dbaas-user-username'\nrequired:\n- username\ntype: object\n"), Example: examples, - Args: cobra.MinimumNArgs(2), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XDeleteDbaasMysqlDatabase(args[0], args[1], params) + _, decoded, err := XCreateDbaasPostgresUser(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -16148,18 +19491,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "create-dbaas-mysql-user service-name", - Short: "Create a DBaaS MySQL user", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n authentication:\n $ref: '#/components/schemas/enum-mysql-authentication-plugin'\n username:\n $ref: '#/components/schemas/dbaas-user-username'\nrequired:\n- username\ntype: object\n"), + Use: "delete-dbaas-postgres-user service-name username", + Short: "Delete a DBaaS Postgres user", + Long: cli.Markdown(""), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XCreateDbaasMysqlUser(args[0], params, body) + _, decoded, err := XDeleteDbaasPostgresUser(args[0], args[1], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -16187,14 +19526,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "delete-dbaas-mysql-user service-name username", - Short: "Delete a DBaaS MySQL user", - Long: cli.Markdown(""), + Use: "update-dbaas-postgres-allow-replication service-name username", + Short: "Update access control for one service user", + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n allow-replication:\n type: boolean\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[2:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XDeleteDbaasMysqlUser(args[0], args[1], params) + _, decoded, err := XUpdateDbaasPostgresAllowReplication(args[0], args[1], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -16222,9 +19565,9 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "reset-dbaas-mysql-user-password service-name username", - Short: "Reset the credentials of a DBaaS mysql user", - Long: cli.Markdown("If no password is provided one will be generated automatically.\n## Request Schema (application/json)\n\nproperties:\n authentication:\n $ref: '#/components/schemas/enum-mysql-authentication-plugin'\n password:\n $ref: '#/components/schemas/dbaas-user-password'\ntype: object\n"), + Use: "reset-dbaas-postgres-user-password service-name username", + Short: "Reset the credentials of a DBaaS Postgres user", + Long: cli.Markdown("If no password is provided one will be generated automatically.\n## Request Schema (application/json)\n\nproperties:\n password:\n $ref: '#/components/schemas/dbaas-user-password'\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { @@ -16233,7 +19576,7 @@ func xRegister(subcommand bool) { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XResetDbaasMysqlUserPassword(args[0], args[1], params, body) + _, decoded, err := XResetDbaasPostgresUserPassword(args[0], args[1], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -16261,14 +19604,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "reveal-dbaas-mysql-user-password service-name username", - Short: "Reveal the secrets of a DBaaS MySQL user", + Use: "reveal-dbaas-postgres-user-password service-name username", + Short: "Reveal the secrets of a DBaaS Postgres user", Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XRevealDbaasMysqlUserPassword(args[0], args[1], params) + _, decoded, err := XRevealDbaasPostgresUserPassword(args[0], args[1], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -16296,9 +19639,9 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "create-dbaas-service-opensearch name", - Short: "Create a DBaaS OpenSearch service", - Long: cli.Markdown("Create a DBaaS OpenSearch service\n## Request Schema (application/json)\n\nproperties:\n fork-from-service:\n $ref: '#/components/schemas/dbaas-service-name'\n index-patterns:\n description: 'Allows you to create glob style patterns and set a max number of indexes matching this pattern you want to keep. Creating indexes exceeding this value will cause the oldest one to get deleted. You could for example create a pattern looking like ''logs.?'' and then create index logs.1, logs.2 etc, it will delete logs.1 once you create logs.6. Do note ''logs.?'' does not apply to logs.10. Note: Setting max_index_count to 0 will do nothing and the pattern gets ignored.'\n items:\n properties:\n max-index-count:\n description: Maximum number of indexes to keep\n format: int64\n minimum: 0\n type: integer\n pattern:\n description: fnmatch pattern\n maxLength: 1024\n type: string\n sorting-algorithm:\n description: Deletion sorting algorithm\n enum:\n - alphabetical\n - creation_date\n type: string\n type: object\n type: array\n index-template:\n description: Template settings for all new indexes\n properties:\n mapping-nested-objects-limit:\n description: The maximum number of nested JSON objects that a single document can contain across all nested types. This limit helps to prevent out of memory errors when a document contains too many nested objects. Default is 10000.\n format: int64\n maximum: 100000\n minimum: 0\n type: integer\n number-of-replicas:\n description: The number of replicas each primary shard has.\n format: int64\n maximum: 29\n minimum: 0\n type: integer\n number-of-shards:\n description: The number of primary shards that an index should have.\n format: int64\n maximum: 1024\n minimum: 1\n type: integer\n type: object\n ip-filter:\n description: Allow incoming connections from CIDR address block, e.g. '10.20.0.0/16'\n items:\n type: string\n type: array\n keep-index-refresh-interval:\n description: Aiven automation resets index.refresh_interval to default value for every index to be sure that indices are always visible to search. If it doesn't fit your case, you can disable this by setting up this flag to true.\n type: boolean\n maintenance:\n description: Automatic maintenance settings\n properties:\n dow:\n description: Day of week for installing updates\n enum:\n - saturday\n - tuesday\n - never\n - wednesday\n - sunday\n - friday\n - monday\n - thursday\n type: string\n time:\n description: Time for installing updates, UTC\n maxLength: 8\n minLength: 8\n type: string\n required:\n - dow\n - time\n type: object\n max-index-count:\n description: Maximum number of indexes to keep before deleting the oldest one\n format: int64\n minimum: 0\n type: integer\n opensearch-dashboards:\n description: OpenSearch Dashboards settings\n properties:\n enabled:\n description: 'Enable or disable OpenSearch Dashboards (default: true)'\n type: boolean\n max-old-space-size:\n description: 'Limits the maximum amount of memory (in MiB) the OpenSearch Dashboards process can use. This sets the max_old_space_size option of the nodejs running the OpenSearch Dashboards. Note: the memory reserved by OpenSearch Dashboards is not available for OpenSearch. (default: 128)'\n format: int64\n maximum: 1024\n minimum: 64\n type: integer\n opensearch-request-timeout:\n description: 'Timeout in milliseconds for requests made by OpenSearch Dashboards towards OpenSearch (default: 30000)'\n format: int64\n maximum: 120000\n minimum: 5000\n type: integer\n type: object\n opensearch-settings:\n $ref: '#/components/schemas/json-schema-opensearch'\n plan:\n description: Subscription plan\n maxLength: 128\n minLength: 1\n type: string\n recovery-backup-name:\n description: Name of a backup to recover from for services that support backup names\n minLength: 1\n type: string\n termination-protection:\n description: Service is protected against termination and powering off\n type: boolean\n version:\n description: OpenSearch major version\n minLength: 1\n type: string\nrequired:\n- plan\ntype: object\n"), + Use: "create-dbaas-pg-upgrade-check service", + Short: "create-dbaas-pg-upgrade-check", + Long: cli.Markdown("Check whether you can upgrade Postgres service to a newer version\n## Request Schema (application/json)\n\nproperties:\n target-version:\n $ref: '#/components/schemas/dbaas-pg-target-versions'\nrequired:\n- target-version\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { @@ -16307,7 +19650,7 @@ func xRegister(subcommand bool) { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XCreateDbaasServiceOpensearch(args[0], params, body) + _, decoded, err := XCreateDbaasPgUpgradeCheck(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -16335,14 +19678,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "delete-dbaas-service-opensearch name", - Short: "Delete a OpenSearch service", - Long: cli.Markdown(""), + Use: "list-dbaas-services", + Short: "List DBaaS services", + Long: cli.Markdown("List DBaaS services"), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(0), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XDeleteDbaasServiceOpensearch(args[0], params) + _, decoded, err := XListDbaasServices(params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -16370,14 +19713,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-dbaas-service-opensearch name", - Short: "Get a DBaaS OpenSearch service", - Long: cli.Markdown("Get a DBaaS OpenSearch service"), + Use: "get-dbaas-service-logs service-name", + Short: "Get logs of DBaaS service", + Long: cli.Markdown("Get logs of DBaaS service\n## Request Schema (application/json)\n\nproperties:\n limit:\n description: 'How many log entries to receive at most, up to 500 (default: 100)'\n format: int64\n maximum: 500\n minimum: 1\n type: integer\n offset:\n description: Opaque offset identifier\n type: string\n sort-order:\n $ref: '#/components/schemas/enum-sort-order'\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XGetDbaasServiceOpensearch(args[0], params) + _, decoded, err := XGetDbaasServiceLogs(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -16405,9 +19752,9 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "update-dbaas-service-opensearch name", - Short: "Update a DBaaS OpenSearch service", - Long: cli.Markdown("Update a DBaaS OpenSearch service\n## Request Schema (application/json)\n\nproperties:\n index-patterns:\n description: 'Allows you to create glob style patterns and set a max number of indexes matching this pattern you want to keep. Creating indexes exceeding this value will cause the oldest one to get deleted. You could for example create a pattern looking like ''logs.?'' and then create index logs.1, logs.2 etc, it will delete logs.1 once you create logs.6. Do note ''logs.?'' does not apply to logs.10. Note: Setting max_index_count to 0 will do nothing and the pattern gets ignored.'\n items:\n properties:\n max-index-count:\n description: Maximum number of indexes to keep\n format: int64\n minimum: 0\n type: integer\n pattern:\n description: fnmatch pattern\n maxLength: 1024\n type: string\n sorting-algorithm:\n description: Deletion sorting algorithm\n enum:\n - alphabetical\n - creation_date\n type: string\n type: object\n type: array\n index-template:\n description: Template settings for all new indexes\n properties:\n mapping-nested-objects-limit:\n description: The maximum number of nested JSON objects that a single document can contain across all nested types. This limit helps to prevent out of memory errors when a document contains too many nested objects. Default is 10000.\n format: int64\n maximum: 100000\n minimum: 0\n type: integer\n number-of-replicas:\n description: The number of replicas each primary shard has.\n format: int64\n maximum: 29\n minimum: 0\n type: integer\n number-of-shards:\n description: The number of primary shards that an index should have.\n format: int64\n maximum: 1024\n minimum: 1\n type: integer\n type: object\n ip-filter:\n description: Allow incoming connections from CIDR address block, e.g. '10.20.0.0/16'\n items:\n type: string\n type: array\n keep-index-refresh-interval:\n description: Aiven automation resets index.refresh_interval to default value for every index to be sure that indices are always visible to search. If it doesn't fit your case, you can disable this by setting up this flag to true.\n type: boolean\n maintenance:\n description: Automatic maintenance settings\n properties:\n dow:\n description: Day of week for installing updates\n enum:\n - saturday\n - tuesday\n - never\n - wednesday\n - sunday\n - friday\n - monday\n - thursday\n type: string\n time:\n description: Time for installing updates, UTC\n maxLength: 8\n minLength: 8\n type: string\n required:\n - dow\n - time\n type: object\n max-index-count:\n description: Maximum number of indexes to keep before deleting the oldest one\n format: int64\n minimum: 0\n type: integer\n opensearch-dashboards:\n description: OpenSearch Dashboards settings\n properties:\n enabled:\n description: 'Enable or disable OpenSearch Dashboards (default: true)'\n type: boolean\n max-old-space-size:\n description: 'Limits the maximum amount of memory (in MiB) the OpenSearch Dashboards process can use. This sets the max_old_space_size option of the nodejs running the OpenSearch Dashboards. Note: the memory reserved by OpenSearch Dashboards is not available for OpenSearch. (default: 128)'\n format: int64\n maximum: 1024\n minimum: 64\n type: integer\n opensearch-request-timeout:\n description: 'Timeout in milliseconds for requests made by OpenSearch Dashboards towards OpenSearch (default: 30000)'\n format: int64\n maximum: 120000\n minimum: 5000\n type: integer\n type: object\n opensearch-settings:\n $ref: '#/components/schemas/json-schema-opensearch'\n plan:\n description: Subscription plan\n maxLength: 128\n minLength: 1\n type: string\n termination-protection:\n description: Service is protected against termination and powering off\n type: boolean\n version:\n description: Version\n type: string\ntype: object\n"), + Use: "get-dbaas-service-metrics service-name", + Short: "Get metrics of DBaaS service", + Long: cli.Markdown("Get metrics of DBaaS service\n## Request Schema (application/json)\n\nproperties:\n period:\n description: 'Metrics time period (default: hour)'\n enum:\n - hour\n - week\n - year\n - month\n - day\n type: string\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { @@ -16416,7 +19763,7 @@ func xRegister(subcommand bool) { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XUpdateDbaasServiceOpensearch(args[0], params, body) + _, decoded, err := XGetDbaasServiceMetrics(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -16444,14 +19791,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-dbaas-opensearch-acl-config name", - Short: "Get DBaaS OpenSearch ACL configuration", - Long: cli.Markdown(""), + Use: "list-dbaas-service-types", + Short: "DBaaS Service Types", + Long: cli.Markdown("List available service types for DBaaS"), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(0), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XGetDbaasOpensearchAclConfig(args[0], params) + _, decoded, err := XListDbaasServiceTypes(params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -16479,18 +19826,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "update-dbaas-opensearch-acl-config name", - Short: "Create a DBaaS OpenSearch ACL configuration", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n acl-enabled:\n description: Enable OpenSearch ACLs. When disabled authenticated service users have unrestricted access.\n type: boolean\n acls:\n description: List of OpenSearch ACLs\n items:\n properties:\n rules:\n items:\n properties:\n index:\n description: OpenSearch index pattern\n maxLength: 249\n type: string\n permission:\n $ref: '#/components/schemas/enum-opensearch-rule-permission'\n required:\n - index\n type: object\n type: array\n username:\n $ref: '#/components/schemas/dbaas-user-username'\n type: object\n type: array\n extended-acl-enabled:\n description: Enable to enforce index rules in a limited fashion for requests that use the _mget, _msearch, and _bulk APIs\n type: boolean\ntype: object\n"), + Use: "get-dbaas-service-type service-type-name", + Short: "Get a DBaaS service type", + Long: cli.Markdown("Get a DBaaS service type"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XUpdateDbaasOpensearchAclConfig(args[0], params, body) + _, decoded, err := XGetDbaasServiceType(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -16518,18 +19861,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "start-dbaas-opensearch-maintenance name", - Short: "Initiate OpenSearch maintenance update", - Long: cli.Markdown(""), + Use: "delete-dbaas-service name", + Short: "Delete a DBaaS service", + Long: cli.Markdown("Delete a DBaaS service"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XStartDbaasOpensearchMaintenance(args[0], params, body) + _, decoded, err := XDeleteDbaasService(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -16557,18 +19896,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "create-dbaas-opensearch-user service-name", - Short: "Create a DBaaS OpenSearch user", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n username:\n $ref: '#/components/schemas/dbaas-user-username'\nrequired:\n- username\ntype: object\n"), + Use: "get-dbaas-settings-grafana", + Short: "Get DBaaS Grafana settings", + Long: cli.Markdown("Get DBaaS Grafana settings"), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(0), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XCreateDbaasOpensearchUser(args[0], params, body) + _, decoded, err := XGetDbaasSettingsGrafana(params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -16596,14 +19931,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "delete-dbaas-opensearch-user service-name username", - Short: "Delete a DBaaS OpenSearch user", - Long: cli.Markdown(""), + Use: "get-dbaas-settings-kafka", + Short: "Get DBaaS Kafka settings", + Long: cli.Markdown("Get DBaaS Kafka settings"), Example: examples, - Args: cobra.MinimumNArgs(2), + Args: cobra.MinimumNArgs(0), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XDeleteDbaasOpensearchUser(args[0], args[1], params) + _, decoded, err := XGetDbaasSettingsKafka(params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -16631,18 +19966,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "reset-dbaas-opensearch-user-password service-name username", - Short: "Reset the credentials of a DBaaS OpenSearch user", - Long: cli.Markdown("If no password is provided one will be generated automatically.\n## Request Schema (application/json)\n\nproperties:\n password:\n $ref: '#/components/schemas/dbaas-user-password'\ntype: object\n"), + Use: "get-dbaas-settings-mysql", + Short: "Get DBaaS MySQL settings", + Long: cli.Markdown("Get DBaaS MySQL settings"), Example: examples, - Args: cobra.MinimumNArgs(2), + Args: cobra.MinimumNArgs(0), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[2:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XResetDbaasOpensearchUserPassword(args[0], args[1], params, body) + _, decoded, err := XGetDbaasSettingsMysql(params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -16670,14 +20001,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "reveal-dbaas-opensearch-user-password service-name username", - Short: "Reveal the secrets of a DBaaS OpenSearch user", - Long: cli.Markdown(""), + Use: "get-dbaas-settings-opensearch", + Short: "Get DBaaS OpenSearch settings", + Long: cli.Markdown("Get DBaaS OpenSearch settings"), Example: examples, - Args: cobra.MinimumNArgs(2), + Args: cobra.MinimumNArgs(0), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XRevealDbaasOpensearchUserPassword(args[0], args[1], params) + _, decoded, err := XGetDbaasSettingsOpensearch(params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -16705,18 +20036,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "create-dbaas-service-pg name", - Short: "Create a DBaaS PostgreSQL service", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n admin-password:\n description: Custom password for admin user. Defaults to random string. This must be set only when a new service is being created.\n maxLength: 256\n minLength: 8\n pattern: ^[a-zA-Z0-9-_]+$\n type: string\n admin-username:\n description: Custom username for admin user. This must be set only when a new service is being created.\n maxLength: 64\n minLength: 1\n pattern: ^[_A-Za-z0-9][-._A-Za-z0-9]{0,63}$\n type: string\n backup-schedule:\n properties:\n backup-hour:\n description: The hour of day (in UTC) when backup for the service is started. New backup is only started if previous backup has already completed.\n format: int64\n maximum: 23\n minimum: 0\n type: integer\n backup-minute:\n description: The minute of an hour when backup for the service is started. New backup is only started if previous backup has already completed.\n format: int64\n maximum: 59\n minimum: 0\n type: integer\n type: object\n fork-from-service:\n $ref: '#/components/schemas/dbaas-service-name'\n integrations:\n description: Service integrations to be enabled when creating the service.\n items:\n properties:\n dest-service:\n $ref: '#/components/schemas/dbaas-service-name'\n settings:\n description: Integration settings\n type: object\n source-service:\n $ref: '#/components/schemas/dbaas-service-name'\n type:\n description: Integration type\n enum:\n - read_replica\n type: string\n required:\n - type\n type: object\n type: array\n ip-filter:\n description: Allow incoming connections from CIDR address block, e.g. '10.20.0.0/16'\n items:\n type: string\n type: array\n maintenance:\n description: Automatic maintenance settings\n properties:\n dow:\n description: Day of week for installing updates\n enum:\n - saturday\n - tuesday\n - never\n - wednesday\n - sunday\n - friday\n - monday\n - thursday\n type: string\n time:\n description: Time for installing updates, UTC\n maxLength: 8\n minLength: 8\n type: string\n required:\n - dow\n - time\n type: object\n migration:\n description: Migrate data from existing server\n properties:\n dbname:\n description: Database name for bootstrapping the initial connection\n maxLength: 63\n minLength: 1\n type: string\n host:\n description: Hostname or IP address of the server where to migrate data from\n maxLength: 255\n minLength: 1\n type: string\n ignore-dbs:\n description: Comma-separated list of databases, which should be ignored during migration (supported by MySQL only at the moment)\n maxLength: 2048\n minLength: 1\n type: string\n method:\n $ref: '#/components/schemas/enum-migration-method'\n password:\n description: Password for authentication with the server where to migrate data from\n maxLength: 255\n minLength: 1\n type: string\n port:\n description: Port number of the server where to migrate data from\n format: int64\n maximum: 65535\n minimum: 1\n type: integer\n ssl:\n description: The server where to migrate data from is secured with SSL\n type: boolean\n username:\n description: User name for authentication with the server where to migrate data from\n maxLength: 255\n minLength: 1\n type: string\n required:\n - host\n - port\n type: object\n pg-settings:\n $ref: '#/components/schemas/json-schema-pg'\n pgbouncer-settings:\n $ref: '#/components/schemas/json-schema-pgbouncer'\n pglookout-settings:\n $ref: '#/components/schemas/json-schema-pglookout'\n plan:\n description: Subscription plan\n maxLength: 128\n minLength: 1\n type: string\n recovery-backup-time:\n description: ISO time of a backup to recover from for services that support arbitrary times\n minLength: 1\n type: string\n shared-buffers-percentage:\n description: Percentage of total RAM that the database server uses for shared memory buffers. Valid range is 20-60 (float), which corresponds to 20% - 60%. This setting adjusts the shared_buffers configuration value.\n format: int64\n maximum: 60\n minimum: 20\n type: integer\n synchronous-replication:\n $ref: '#/components/schemas/enum-pg-synchronous-replication'\n termination-protection:\n description: Service is protected against termination and powering off\n type: boolean\n timescaledb-settings:\n $ref: '#/components/schemas/json-schema-timescaledb'\n variant:\n $ref: '#/components/schemas/enum-pg-variant'\n version:\n $ref: '#/components/schemas/dbaas-pg-target-versions'\n work-mem:\n description: Sets the maximum amount of memory to be used by a query operation (such as a sort or hash table) before writing to temporary disk files, in MB. Default is 1MB + 0.075% of total RAM (up to 32MB).\n format: int64\n maximum: 1024\n minimum: 1\n type: integer\nrequired:\n- plan\ntype: object\n"), + Use: "get-dbaas-settings-pg", + Short: "Get DBaaS PostgreSQL settings", + Long: cli.Markdown("Get DBaaS PostgreSQL settings"), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(0), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XCreateDbaasServicePg(args[0], params, body) + _, decoded, err := XGetDbaasSettingsPg(params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -16744,14 +20071,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "delete-dbaas-service-pg name", - Short: "Delete a Postgres service", - Long: cli.Markdown(""), + Use: "get-dbaas-settings-thanos", + Short: "Get DBaaS Thanos settings", + Long: cli.Markdown("Get DBaaS Thanos settings"), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(0), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XDeleteDbaasServicePg(args[0], params) + _, decoded, err := XGetDbaasSettingsThanos(params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -16779,14 +20106,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-dbaas-service-pg name", - Short: "Get a DBaaS PostgreSQL service", - Long: cli.Markdown("Get a DBaaS PostgreSQL service"), + Use: "get-dbaas-settings-valkey", + Short: "Get DBaaS Valkey settings", + Long: cli.Markdown("Returns the default settings for Valkey."), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(0), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XGetDbaasServicePg(args[0], params) + _, decoded, err := XGetDbaasSettingsValkey(params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -16814,9 +20141,9 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "update-dbaas-service-pg name", - Short: "Update a DBaaS PostgreSQL service", - Long: cli.Markdown("Update a DBaaS PostgreSQL service\n## Request Schema (application/json)\n\nproperties:\n backup-schedule:\n properties:\n backup-hour:\n description: The hour of day (in UTC) when backup for the service is started. New backup is only started if previous backup has already completed.\n format: int64\n maximum: 23\n minimum: 0\n type: integer\n backup-minute:\n description: The minute of an hour when backup for the service is started. New backup is only started if previous backup has already completed.\n format: int64\n maximum: 59\n minimum: 0\n type: integer\n type: object\n ip-filter:\n description: Allow incoming connections from CIDR address block, e.g. '10.20.0.0/16'\n items:\n type: string\n type: array\n maintenance:\n description: Automatic maintenance settings\n properties:\n dow:\n description: Day of week for installing updates\n enum:\n - saturday\n - tuesday\n - never\n - wednesday\n - sunday\n - friday\n - monday\n - thursday\n type: string\n time:\n description: Time for installing updates, UTC\n maxLength: 8\n minLength: 8\n type: string\n required:\n - dow\n - time\n type: object\n migration:\n description: Migrate data from existing server\n properties:\n dbname:\n description: Database name for bootstrapping the initial connection\n maxLength: 63\n minLength: 1\n type: string\n host:\n description: Hostname or IP address of the server where to migrate data from\n maxLength: 255\n minLength: 1\n type: string\n ignore-dbs:\n description: Comma-separated list of databases, which should be ignored during migration (supported by MySQL only at the moment)\n maxLength: 2048\n minLength: 1\n type: string\n method:\n $ref: '#/components/schemas/enum-migration-method'\n password:\n description: Password for authentication with the server where to migrate data from\n maxLength: 255\n minLength: 1\n type: string\n port:\n description: Port number of the server where to migrate data from\n format: int64\n maximum: 65535\n minimum: 1\n type: integer\n ssl:\n description: The server where to migrate data from is secured with SSL\n type: boolean\n username:\n description: User name for authentication with the server where to migrate data from\n maxLength: 255\n minLength: 1\n type: string\n required:\n - host\n - port\n type: object\n pg-settings:\n $ref: '#/components/schemas/json-schema-pg'\n pgbouncer-settings:\n $ref: '#/components/schemas/json-schema-pgbouncer'\n pglookout-settings:\n $ref: '#/components/schemas/json-schema-pglookout'\n plan:\n description: Subscription plan\n maxLength: 128\n minLength: 1\n type: string\n shared-buffers-percentage:\n description: Percentage of total RAM that the database server uses for shared memory buffers. Valid range is 20-60 (float), which corresponds to 20% - 60%. This setting adjusts the shared_buffers configuration value.\n format: int64\n maximum: 60\n minimum: 20\n type: integer\n synchronous-replication:\n $ref: '#/components/schemas/enum-pg-synchronous-replication'\n termination-protection:\n description: Service is protected against termination and powering off\n type: boolean\n timescaledb-settings:\n $ref: '#/components/schemas/json-schema-timescaledb'\n variant:\n $ref: '#/components/schemas/enum-pg-variant'\n version:\n description: Version\n type: string\n work-mem:\n description: Sets the maximum amount of memory to be used by a query operation (such as a sort or hash table) before writing to temporary disk files, in MB. Default is 1MB + 0.075% of total RAM (up to 32MB).\n format: int64\n maximum: 1024\n minimum: 1\n type: integer\ntype: object\n"), + Use: "create-dbaas-task-migration-check service", + Short: "create-dbaas-task-migration-check", + Long: cli.Markdown("Create a DBaaS task to check migration\n## Request Schema (application/json)\n\nproperties:\n ignore-dbs:\n description: Comma-separated list of databases, which should be ignored during migration (supported by MySQL only at the moment)\n maxLength: 2048\n minLength: 1\n type: string\n method:\n $ref: '#/components/schemas/enum-migration-method'\n source-service-uri:\n description: Service URI of the source MySQL or PostgreSQL database with admin credentials.\n maxLength: 512\n minLength: 1\n type: string\nrequired:\n- source-service-uri\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { @@ -16825,7 +20152,7 @@ func xRegister(subcommand bool) { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XUpdateDbaasServicePg(args[0], params, body) + _, decoded, err := XCreateDbaasTaskMigrationCheck(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -16853,18 +20180,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "start-dbaas-pg-maintenance name", - Short: "Initiate PostgreSQL maintenance update", - Long: cli.Markdown(""), + Use: "get-dbaas-task service id", + Short: "Get a DBaaS task", + Long: cli.Markdown("Get a DBaaS task"), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XStartDbaasPgMaintenance(args[0], params, body) + _, decoded, err := XGetDbaasTask(args[0], args[1], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -16892,18 +20215,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "stop-dbaas-pg-migration name", - Short: "Stop a DBaaS PostgreSQL migration", - Long: cli.Markdown(""), + Use: "create-dbaas-service-thanos name", + Short: "Create a DBaaS Thanos service", + Long: cli.Markdown("Create a DBaaS Thanos service\n## Request Schema (application/json)\n\nproperties:\n ip-filter:\n description: Allowed CIDR address blocks for incoming connections\n items:\n type: string\n type: array\n maintenance:\n description: Automatic maintenance settings\n properties:\n dow:\n description: Day of week for installing updates\n enum:\n - saturday\n - tuesday\n - never\n - wednesday\n - sunday\n - friday\n - monday\n - thursday\n type: string\n time:\n description: Time for installing updates, UTC\n maxLength: 8\n minLength: 8\n type: string\n required:\n - dow\n - time\n type: object\n plan:\n description: Subscription plan\n maxLength: 128\n minLength: 1\n type: string\n termination-protection:\n description: Service is protected against termination and powering off\n type: boolean\n thanos-settings:\n $ref: '#/components/schemas/json-schema-thanos'\nrequired:\n- plan\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("", args[1:]) + body, err := cli.GetBody("application/json", args[1:]) if err != nil { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XStopDbaasPgMigration(args[0], params, body) + _, decoded, err := XCreateDbaasServiceThanos(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -16931,18 +20254,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "create-dbaas-pg-connection-pool service-name", - Short: "Create a DBaaS PostgreSQL connection pool", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n database-name:\n $ref: '#/components/schemas/dbaas-database-name'\n mode:\n $ref: '#/components/schemas/enum-pg-pool-mode'\n name:\n $ref: '#/components/schemas/dbaas-pg-pool-name'\n size:\n $ref: '#/components/schemas/dbaas-pg-pool-size'\n username:\n $ref: '#/components/schemas/dbaas-pg-pool-username'\nrequired:\n- name\n- database-name\ntype: object\n"), + Use: "delete-dbaas-service-thanos name", + Short: "Delete a Thanos service", + Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XCreateDbaasPgConnectionPool(args[0], params, body) + _, decoded, err := XDeleteDbaasServiceThanos(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -16970,14 +20289,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "delete-dbaas-pg-connection-pool service-name connection-pool-name", - Short: "Delete a DBaaS PostgreSQL connection pool", - Long: cli.Markdown(""), + Use: "get-dbaas-service-thanos name", + Short: "get-dbaas-service-thanos", + Long: cli.Markdown("Get a DBaaS Thanos service"), Example: examples, - Args: cobra.MinimumNArgs(2), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XDeleteDbaasPgConnectionPool(args[0], args[1], params) + _, decoded, err := XGetDbaasServiceThanos(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -17005,18 +20324,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "update-dbaas-pg-connection-pool service-name connection-pool-name", - Short: "Update a DBaaS PostgreSQL connection pool", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n database-name:\n $ref: '#/components/schemas/dbaas-database-name'\n mode:\n $ref: '#/components/schemas/enum-pg-pool-mode'\n size:\n $ref: '#/components/schemas/dbaas-pg-pool-size'\n username:\n $ref: '#/components/schemas/dbaas-pg-pool-username'\ntype: object\n"), + Use: "update-dbaas-service-thanos name", + Short: "update-dbaas-service-thanos", + Long: cli.Markdown("Update a DBaaS Thanos service\n## Request Schema (application/json)\n\nproperties:\n ip-filter:\n description: Allowed CIDR address blocks for incoming connections\n items:\n type: string\n type: array\n maintenance:\n description: Automatic maintenance settings\n properties:\n dow:\n description: Day of week for installing updates\n enum:\n - saturday\n - tuesday\n - never\n - wednesday\n - sunday\n - friday\n - monday\n - thursday\n type: string\n time:\n description: Time for installing updates, UTC\n maxLength: 8\n minLength: 8\n type: string\n required:\n - dow\n - time\n type: object\n plan:\n description: Subscription plan\n maxLength: 128\n minLength: 1\n type: string\n termination-protection:\n description: Service is protected against termination and powering off\n type: boolean\n thanos-settings:\n $ref: '#/components/schemas/json-schema-thanos'\ntype: object\n"), Example: examples, - Args: cobra.MinimumNArgs(2), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[2:]) + body, err := cli.GetBody("application/json", args[1:]) if err != nil { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XUpdateDbaasPgConnectionPool(args[0], args[1], params, body) + _, decoded, err := XUpdateDbaasServiceThanos(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -17044,18 +20363,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "create-dbaas-pg-database service-name", - Short: "Create a DBaaS Postgres database", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n database-name:\n $ref: '#/components/schemas/dbaas-database-name'\n lc-collate:\n description: Default string sort order (LC_COLLATE) for PostgreSQL database\n maxLength: 128\n type: string\n lc-ctype:\n description: Default character classification (LC_CTYPE) for PostgreSQL database\n maxLength: 128\n type: string\nrequired:\n- database-name\ntype: object\n"), + Use: "start-dbaas-thanos-maintenance name", + Short: "Initiate Thanos maintenance update", + Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) + body, err := cli.GetBody("", args[1:]) if err != nil { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XCreateDbaasPgDatabase(args[0], params, body) + _, decoded, err := XStartDbaasThanosMaintenance(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -17083,14 +20402,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "delete-dbaas-pg-database service-name database-name", - Short: "Delete a DBaaS Postgres database", + Use: "reveal-dbaas-thanos-user-password service-name username", + Short: "Reveal the secrets of a DBaaS Thanos user", Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XDeleteDbaasPgDatabase(args[0], args[1], params) + _, decoded, err := XRevealDbaasThanosUserPassword(args[0], args[1], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -17118,9 +20437,9 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "create-dbaas-postgres-user service-name", - Short: "Create a DBaaS Postgres user", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n allow-replication:\n type: boolean\n username:\n $ref: '#/components/schemas/dbaas-user-username'\nrequired:\n- username\ntype: object\n"), + Use: "create-dbaas-service-valkey name", + Short: "Create a DBaaS Valkey service", + Long: cli.Markdown("Create a DBaaS Valkey service\n## Request Schema (application/json)\n\nproperties:\n fork-from-service:\n $ref: '#/components/schemas/dbaas-service-name'\n ip-filter:\n description: Allow incoming connections from CIDR address block, e.g. '10.20.0.0/16'\n items:\n type: string\n type: array\n maintenance:\n description: Automatic maintenance settings\n properties:\n dow:\n description: Day of week for installing updates\n enum:\n - saturday\n - tuesday\n - never\n - wednesday\n - sunday\n - friday\n - monday\n - thursday\n type: string\n time:\n description: Time for installing updates, UTC\n maxLength: 8\n minLength: 8\n type: string\n required:\n - dow\n - time\n type: object\n migration:\n description: Migrate data from existing server\n properties:\n dbname:\n description: Database name for bootstrapping the initial connection\n maxLength: 63\n minLength: 1\n type: string\n host:\n description: Hostname or IP address of the server where to migrate data from\n maxLength: 255\n minLength: 1\n type: string\n ignore-dbs:\n description: Comma-separated list of databases, which should be ignored during migration (supported by MySQL only at the moment)\n maxLength: 2048\n minLength: 1\n type: string\n method:\n $ref: '#/components/schemas/enum-migration-method'\n password:\n description: Password for authentication with the server where to migrate data from\n maxLength: 255\n minLength: 1\n type: string\n port:\n description: Port number of the server where to migrate data from\n format: int64\n maximum: 65535\n minimum: 1\n type: integer\n ssl:\n description: The server where to migrate data from is secured with SSL\n type: boolean\n username:\n description: User name for authentication with the server where to migrate data from\n maxLength: 255\n minLength: 1\n type: string\n required:\n - host\n - port\n type: object\n plan:\n description: Subscription plan\n maxLength: 128\n minLength: 1\n type: string\n recovery-backup-name:\n description: Name of a backup to recover from for services that support backup names\n minLength: 1\n type: string\n termination-protection:\n description: Service is protected against termination and powering off\n type: boolean\n valkey-settings:\n $ref: '#/components/schemas/json-schema-valkey'\nrequired:\n- plan\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { @@ -17129,7 +20448,7 @@ func xRegister(subcommand bool) { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XCreateDbaasPostgresUser(args[0], params, body) + _, decoded, err := XCreateDbaasServiceValkey(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -17157,14 +20476,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "delete-dbaas-postgres-user service-name username", - Short: "Delete a DBaaS Postgres user", + Use: "delete-dbaas-service-valkey name", + Short: "Delete a Valkey service", Long: cli.Markdown(""), Example: examples, - Args: cobra.MinimumNArgs(2), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XDeleteDbaasPostgresUser(args[0], args[1], params) + _, decoded, err := XDeleteDbaasServiceValkey(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -17192,18 +20511,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "update-dbaas-postgres-allow-replication service-name username", - Short: "Update access control for one service user", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n allow-replication:\n type: boolean\ntype: object\n"), + Use: "get-dbaas-service-valkey name", + Short: "get-dbaas-service-valkey", + Long: cli.Markdown("Get a DBaaS Valkey service"), Example: examples, - Args: cobra.MinimumNArgs(2), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[2:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XUpdateDbaasPostgresAllowReplication(args[0], args[1], params, body) + _, decoded, err := XGetDbaasServiceValkey(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -17231,18 +20546,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "reset-dbaas-postgres-user-password service-name username", - Short: "Reset the credentials of a DBaaS Postgres user", - Long: cli.Markdown("If no password is provided one will be generated automatically.\n## Request Schema (application/json)\n\nproperties:\n password:\n $ref: '#/components/schemas/dbaas-user-password'\ntype: object\n"), + Use: "update-dbaas-service-valkey name", + Short: "update-dbaas-service-valkey", + Long: cli.Markdown("Update a DBaaS Valkey service\n## Request Schema (application/json)\n\nproperties:\n ip-filter:\n description: Allow incoming connections from CIDR address block, e.g. '10.20.0.0/16'\n items:\n type: string\n type: array\n maintenance:\n description: Automatic maintenance settings\n properties:\n dow:\n description: Day of week for installing updates\n enum:\n - saturday\n - tuesday\n - never\n - wednesday\n - sunday\n - friday\n - monday\n - thursday\n type: string\n time:\n description: Time for installing updates, UTC\n maxLength: 8\n minLength: 8\n type: string\n required:\n - dow\n - time\n type: object\n migration:\n description: Migrate data from existing server\n properties:\n dbname:\n description: Database name for bootstrapping the initial connection\n maxLength: 63\n minLength: 1\n type: string\n host:\n description: Hostname or IP address of the server where to migrate data from\n maxLength: 255\n minLength: 1\n type: string\n ignore-dbs:\n description: Comma-separated list of databases, which should be ignored during migration (supported by MySQL only at the moment)\n maxLength: 2048\n minLength: 1\n type: string\n method:\n $ref: '#/components/schemas/enum-migration-method'\n password:\n description: Password for authentication with the server where to migrate data from\n maxLength: 255\n minLength: 1\n type: string\n port:\n description: Port number of the server where to migrate data from\n format: int64\n maximum: 65535\n minimum: 1\n type: integer\n ssl:\n description: The server where to migrate data from is secured with SSL\n type: boolean\n username:\n description: User name for authentication with the server where to migrate data from\n maxLength: 255\n minLength: 1\n type: string\n required:\n - host\n - port\n type: object\n plan:\n description: Subscription plan\n maxLength: 128\n minLength: 1\n type: string\n termination-protection:\n description: Service is protected against termination and powering off\n type: boolean\n valkey-settings:\n $ref: '#/components/schemas/json-schema-valkey'\ntype: object\n"), Example: examples, - Args: cobra.MinimumNArgs(2), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[2:]) + body, err := cli.GetBody("application/json", args[1:]) if err != nil { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XResetDbaasPostgresUserPassword(args[0], args[1], params, body) + _, decoded, err := XUpdateDbaasServiceValkey(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -17270,14 +20585,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "reveal-dbaas-postgres-user-password service-name username", - Short: "Reveal the secrets of a DBaaS Postgres user", + Use: "start-dbaas-valkey-maintenance name", + Short: "Initiate Valkey maintenance update", Long: cli.Markdown(""), Example: examples, - Args: cobra.MinimumNArgs(2), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XRevealDbaasPostgresUserPassword(args[0], args[1], params) + _, decoded, err := XStartDbaasValkeyMaintenance(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -17305,18 +20624,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "create-dbaas-pg-upgrade-check service", - Short: "create-dbaas-pg-upgrade-check", - Long: cli.Markdown("Check whether you can upgrade Postgres service to a newer version\n## Request Schema (application/json)\n\nproperties:\n target-version:\n $ref: '#/components/schemas/dbaas-pg-target-versions'\nrequired:\n- target-version\ntype: object\n"), + Use: "stop-dbaas-valkey-migration name", + Short: "Stop a DBaaS Valkey migration", + Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) + body, err := cli.GetBody("", args[1:]) if err != nil { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XCreateDbaasPgUpgradeCheck(args[0], params, body) + _, decoded, err := XStopDbaasValkeyMigration(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -17344,14 +20663,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "list-dbaas-services", - Short: "List DBaaS services", - Long: cli.Markdown("List DBaaS services"), + Use: "create-dbaas-valkey-user service-name", + Short: "Create a DBaaS Valkey user", + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n access-control:\n $ref: '#/components/schemas/dbaas-valkey-user-access-control'\n username:\n $ref: '#/components/schemas/dbaas-user-username'\nrequired:\n- username\ntype: object\n"), Example: examples, - Args: cobra.MinimumNArgs(0), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XListDbaasServices(params) + _, decoded, err := XCreateDbaasValkeyUser(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -17379,18 +20702,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-dbaas-service-logs service-name", - Short: "Get logs of DBaaS service", - Long: cli.Markdown("Get logs of DBaaS service\n## Request Schema (application/json)\n\nproperties:\n limit:\n description: 'How many log entries to receive at most, up to 500 (default: 100)'\n format: int64\n maximum: 500\n minimum: 1\n type: integer\n offset:\n description: Opaque offset identifier\n type: string\n sort-order:\n $ref: '#/components/schemas/enum-sort-order'\ntype: object\n"), + Use: "list-dbaas-valkey-users service-name", + Short: "List DBaaS Valkey users with ACL configuration", + Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XGetDbaasServiceLogs(args[0], params, body) + _, decoded, err := XListDbaasValkeyUsers(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -17418,18 +20737,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-dbaas-service-metrics service-name", - Short: "Get metrics of DBaaS service", - Long: cli.Markdown("Get metrics of DBaaS service\n## Request Schema (application/json)\n\nproperties:\n period:\n description: 'Metrics time period (default: hour)'\n enum:\n - hour\n - week\n - year\n - month\n - day\n type: string\ntype: object\n"), + Use: "delete-dbaas-valkey-user service-name username", + Short: "Delete a DBaaS Valkey user", + Long: cli.Markdown(""), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XGetDbaasServiceMetrics(args[0], params, body) + _, decoded, err := XDeleteDbaasValkeyUser(args[0], args[1], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -17457,14 +20772,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "list-dbaas-service-types", - Short: "DBaaS Service Types", - Long: cli.Markdown("List available service types for DBaaS"), + Use: "update-dbaas-valkey-user-access-control service-name username", + Short: "Update access control for one DBaaS Valkey service user", + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n access-control:\n $ref: '#/components/schemas/dbaas-valkey-user-access-control'\ntype: object\n"), Example: examples, - Args: cobra.MinimumNArgs(0), + Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[2:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XListDbaasServiceTypes(params) + _, decoded, err := XUpdateDbaasValkeyUserAccessControl(args[0], args[1], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -17492,14 +20811,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-dbaas-service-type service-type-name", - Short: "Get a DBaaS service type", - Long: cli.Markdown("Get a DBaaS service type"), + Use: "reset-dbaas-valkey-user-password service-name username", + Short: "Reset the credentials of a DBaaS Valkey user", + Long: cli.Markdown("If no password is provided one will be generated automatically.\n## Request Schema (application/json)\n\nproperties:\n password:\n $ref: '#/components/schemas/dbaas-user-password'\ntype: object\n"), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[2:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XGetDbaasServiceType(args[0], params) + _, decoded, err := XResetDbaasValkeyUserPassword(args[0], args[1], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -17527,14 +20850,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "delete-dbaas-service name", - Short: "Delete a DBaaS service", - Long: cli.Markdown("Delete a DBaaS service"), + Use: "reveal-dbaas-valkey-user-password service-name username", + Short: "Reveal the secrets of a DBaaS Valkey user", + Long: cli.Markdown(""), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XDeleteDbaasService(args[0], params) + _, decoded, err := XRevealDbaasValkeyUserPassword(args[0], args[1], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -17562,14 +20885,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-dbaas-settings-grafana", - Short: "Get DBaaS Grafana settings", - Long: cli.Markdown("Get DBaaS Grafana settings"), + Use: "list-deploy-targets", + Short: "List Deploy Targets", + Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(0), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XGetDbaasSettingsGrafana(params) + _, decoded, err := XListDeployTargets(params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -17597,14 +20920,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-dbaas-settings-kafka", - Short: "Get DBaaS Kafka settings", - Long: cli.Markdown("Get DBaaS Kafka settings"), + Use: "get-deploy-target id", + Short: "Retrieve Deploy Target details", + Long: cli.Markdown(""), Example: examples, - Args: cobra.MinimumNArgs(0), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XGetDbaasSettingsKafka(params) + _, decoded, err := XGetDeployTarget(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -17632,14 +20955,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-dbaas-settings-mysql", - Short: "Get DBaaS MySQL settings", - Long: cli.Markdown("Get DBaaS MySQL settings"), + Use: "create-dns-domain", + Short: "Create DNS domain", + Long: cli.Markdown("\n## Request Schema (application/json)\n\ndescription: DNS Domain\nproperties:\n unicode-name:\n description: Domain name\n type: string\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(0), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[0:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XGetDbaasSettingsMysql(params) + _, decoded, err := XCreateDnsDomain(params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -17667,14 +20994,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-dbaas-settings-opensearch", - Short: "Get DBaaS OpenSearch settings", - Long: cli.Markdown("Get DBaaS OpenSearch settings"), + Use: "list-dns-domains", + Short: "List DNS domains", + Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(0), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XGetDbaasSettingsOpensearch(params) + _, decoded, err := XListDnsDomains(params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -17702,14 +21029,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-dbaas-settings-pg", - Short: "Get DBaaS PostgreSQL settings", - Long: cli.Markdown("Get DBaaS PostgreSQL settings"), + Use: "create-dns-domain-record domain-id", + Short: "Create DNS domain record", + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n content:\n description: DNS domain record content\n type: string\n name:\n description: DNS domain record name\n type: string\n priority:\n description: DNS domain record priority\n format: int64\n minimum: 0\n type: integer\n ttl:\n description: DNS domain record TTL\n format: int64\n minimum: 0\n type: integer\n type:\n description: DNS domain record type\n enum:\n - NS\n - CAA\n - NAPTR\n - POOL\n - A\n - HINFO\n - CNAME\n - SSHFP\n - SRV\n - AAAA\n - MX\n - TXT\n - ALIAS\n - URL\n type: string\nrequired:\n- name\n- type\n- content\ntype: object\n"), Example: examples, - Args: cobra.MinimumNArgs(0), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XGetDbaasSettingsPg(params) + _, decoded, err := XCreateDnsDomainRecord(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -17737,14 +21068,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-dbaas-settings-valkey", - Short: "Get DBaaS Valkey settings", - Long: cli.Markdown("Returns the default settings for Valkey."), + Use: "list-dns-domain-records domain-id", + Short: "List DNS domain records", + Long: cli.Markdown(""), Example: examples, - Args: cobra.MinimumNArgs(0), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XGetDbaasSettingsValkey(params) + _, decoded, err := XListDnsDomainRecords(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -17772,18 +21103,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "create-dbaas-task-migration-check service", - Short: "create-dbaas-task-migration-check", - Long: cli.Markdown("Create a DBaaS task to check migration\n## Request Schema (application/json)\n\nproperties:\n ignore-dbs:\n description: Comma-separated list of databases, which should be ignored during migration (supported by MySQL only at the moment)\n maxLength: 2048\n minLength: 1\n type: string\n method:\n $ref: '#/components/schemas/enum-migration-method'\n source-service-uri:\n description: Service URI of the source MySQL or PostgreSQL database with admin credentials.\n maxLength: 512\n minLength: 1\n type: string\nrequired:\n- source-service-uri\ntype: object\n"), + Use: "delete-dns-domain-record domain-id record-id", + Short: "Delete DNS domain record", + Long: cli.Markdown(""), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XCreateDbaasTaskMigrationCheck(args[0], params, body) + _, decoded, err := XDeleteDnsDomainRecord(args[0], args[1], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -17811,14 +21138,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-dbaas-task service id", - Short: "Get a DBaaS task", - Long: cli.Markdown("Get a DBaaS task"), + Use: "get-dns-domain-record domain-id record-id", + Short: "Retrieve DNS domain record details", + Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XGetDbaasTask(args[0], args[1], params) + _, decoded, err := XGetDnsDomainRecord(args[0], args[1], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -17846,18 +21173,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "create-dbaas-service-valkey name", - Short: "Create a DBaaS Valkey service", - Long: cli.Markdown("Create a DBaaS Valkey service\n## Request Schema (application/json)\n\nproperties:\n fork-from-service:\n $ref: '#/components/schemas/dbaas-service-name'\n ip-filter:\n description: Allow incoming connections from CIDR address block, e.g. '10.20.0.0/16'\n items:\n type: string\n type: array\n maintenance:\n description: Automatic maintenance settings\n properties:\n dow:\n description: Day of week for installing updates\n enum:\n - saturday\n - tuesday\n - never\n - wednesday\n - sunday\n - friday\n - monday\n - thursday\n type: string\n time:\n description: Time for installing updates, UTC\n maxLength: 8\n minLength: 8\n type: string\n required:\n - dow\n - time\n type: object\n migration:\n description: Migrate data from existing server\n properties:\n dbname:\n description: Database name for bootstrapping the initial connection\n maxLength: 63\n minLength: 1\n type: string\n host:\n description: Hostname or IP address of the server where to migrate data from\n maxLength: 255\n minLength: 1\n type: string\n ignore-dbs:\n description: Comma-separated list of databases, which should be ignored during migration (supported by MySQL only at the moment)\n maxLength: 2048\n minLength: 1\n type: string\n method:\n $ref: '#/components/schemas/enum-migration-method'\n password:\n description: Password for authentication with the server where to migrate data from\n maxLength: 255\n minLength: 1\n type: string\n port:\n description: Port number of the server where to migrate data from\n format: int64\n maximum: 65535\n minimum: 1\n type: integer\n ssl:\n description: The server where to migrate data from is secured with SSL\n type: boolean\n username:\n description: User name for authentication with the server where to migrate data from\n maxLength: 255\n minLength: 1\n type: string\n required:\n - host\n - port\n type: object\n plan:\n description: Subscription plan\n maxLength: 128\n minLength: 1\n type: string\n recovery-backup-name:\n description: Name of a backup to recover from for services that support backup names\n minLength: 1\n type: string\n termination-protection:\n description: Service is protected against termination and powering off\n type: boolean\n valkey-settings:\n $ref: '#/components/schemas/json-schema-valkey'\nrequired:\n- plan\ntype: object\n"), + Use: "update-dns-domain-record domain-id record-id", + Short: "Update DNS domain record", + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n content:\n description: DNS domain record content\n type: string\n name:\n description: DNS domain record name\n type: string\n priority:\n description: DNS domain record priority\n exclusiveMinimum: true\n format: int64\n minimum: 0\n type: integer\n ttl:\n description: DNS domain record TTL\n exclusiveMinimum: true\n format: int64\n minimum: 0\n type: integer\ntype: object\n"), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) + body, err := cli.GetBody("application/json", args[2:]) if err != nil { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XCreateDbaasServiceValkey(args[0], params, body) + _, decoded, err := XUpdateDnsDomainRecord(args[0], args[1], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -17885,14 +21212,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "delete-dbaas-service-valkey name", - Short: "Delete a Valkey service", + Use: "delete-dns-domain id", + Short: "Delete DNS Domain", Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XDeleteDbaasServiceValkey(args[0], params) + _, decoded, err := XDeleteDnsDomain(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -17920,14 +21247,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-dbaas-service-valkey name", - Short: "get-dbaas-service-valkey", - Long: cli.Markdown("Get a DBaaS Valkey service"), + Use: "get-dns-domain id", + Short: "Retrieve DNS domain details", + Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XGetDbaasServiceValkey(args[0], params) + _, decoded, err := XGetDnsDomain(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -17955,18 +21282,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "update-dbaas-service-valkey name", - Short: "update-dbaas-service-valkey", - Long: cli.Markdown("Update a DBaaS Valkey service\n## Request Schema (application/json)\n\nproperties:\n ip-filter:\n description: Allow incoming connections from CIDR address block, e.g. '10.20.0.0/16'\n items:\n type: string\n type: array\n maintenance:\n description: Automatic maintenance settings\n properties:\n dow:\n description: Day of week for installing updates\n enum:\n - saturday\n - tuesday\n - never\n - wednesday\n - sunday\n - friday\n - monday\n - thursday\n type: string\n time:\n description: Time for installing updates, UTC\n maxLength: 8\n minLength: 8\n type: string\n required:\n - dow\n - time\n type: object\n migration:\n description: Migrate data from existing server\n properties:\n dbname:\n description: Database name for bootstrapping the initial connection\n maxLength: 63\n minLength: 1\n type: string\n host:\n description: Hostname or IP address of the server where to migrate data from\n maxLength: 255\n minLength: 1\n type: string\n ignore-dbs:\n description: Comma-separated list of databases, which should be ignored during migration (supported by MySQL only at the moment)\n maxLength: 2048\n minLength: 1\n type: string\n method:\n $ref: '#/components/schemas/enum-migration-method'\n password:\n description: Password for authentication with the server where to migrate data from\n maxLength: 255\n minLength: 1\n type: string\n port:\n description: Port number of the server where to migrate data from\n format: int64\n maximum: 65535\n minimum: 1\n type: integer\n ssl:\n description: The server where to migrate data from is secured with SSL\n type: boolean\n username:\n description: User name for authentication with the server where to migrate data from\n maxLength: 255\n minLength: 1\n type: string\n required:\n - host\n - port\n type: object\n plan:\n description: Subscription plan\n maxLength: 128\n minLength: 1\n type: string\n termination-protection:\n description: Service is protected against termination and powering off\n type: boolean\n valkey-settings:\n $ref: '#/components/schemas/json-schema-valkey'\ntype: object\n"), + Use: "get-dns-domain-zone-file id", + Short: "Retrieve DNS domain zone file", + Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XUpdateDbaasServiceValkey(args[0], params, body) + _, decoded, err := XGetDnsDomainZoneFile(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -17994,18 +21317,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "start-dbaas-valkey-maintenance name", - Short: "Initiate Valkey maintenance update", - Long: cli.Markdown(""), + Use: "create-elastic-ip", + Short: "Create an Elastic IP", + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n addressfamily:\n description: 'Elastic IP address family (default: :inet4)'\n enum:\n - inet4\n - inet6\n type: string\n description:\n description: Elastic IP description\n maxLength: 255\n type: string\n healthcheck:\n $ref: '#/components/schemas/elastic-ip-healthcheck'\n labels:\n $ref: '#/components/schemas/labels'\ntype: object\n"), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(0), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("", args[1:]) + body, err := cli.GetBody("application/json", args[0:]) if err != nil { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XStartDbaasValkeyMaintenance(args[0], params, body) + _, decoded, err := XCreateElasticIp(params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -18033,18 +21356,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "stop-dbaas-valkey-migration name", - Short: "Stop a DBaaS Valkey migration", + Use: "list-elastic-ips", + Short: "List Elastic IPs", Long: cli.Markdown(""), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(0), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XStopDbaasValkeyMigration(args[0], params, body) + _, decoded, err := XListElasticIps(params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -18072,18 +21391,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "create-dbaas-valkey-user service-name", - Short: "Create a DBaaS Valkey user", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n username:\n $ref: '#/components/schemas/dbaas-user-username'\nrequired:\n- username\ntype: object\n"), + Use: "delete-elastic-ip id", + Short: "Delete an Elastic IP", + Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XCreateDbaasValkeyUser(args[0], params, body) + _, decoded, err := XDeleteElasticIp(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -18111,14 +21426,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "delete-dbaas-valkey-user service-name username", - Short: "Delete a DBaaS Valkey user", + Use: "get-elastic-ip id", + Short: "Retrieve Elastic IP details", Long: cli.Markdown(""), Example: examples, - Args: cobra.MinimumNArgs(2), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XDeleteDbaasValkeyUser(args[0], args[1], params) + _, decoded, err := XGetElasticIp(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -18146,18 +21461,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "reset-dbaas-valkey-user-password service-name username", - Short: "Reset the credentials of a DBaaS Valkey user", - Long: cli.Markdown("If no password is provided one will be generated automatically.\n## Request Schema (application/json)\n\nproperties:\n password:\n $ref: '#/components/schemas/dbaas-user-password'\ntype: object\n"), + Use: "update-elastic-ip id", + Short: "Update an Elastic IP", + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n description:\n description: Elastic IP description\n maxLength: 255\n type: string\n healthcheck:\n $ref: '#/components/schemas/elastic-ip-healthcheck'\n labels:\n $ref: '#/components/schemas/labels'\ntype: object\n"), Example: examples, - Args: cobra.MinimumNArgs(2), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[2:]) + body, err := cli.GetBody("application/json", args[1:]) if err != nil { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XResetDbaasValkeyUserPassword(args[0], args[1], params, body) + _, decoded, err := XUpdateElasticIp(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -18185,14 +21500,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "reveal-dbaas-valkey-user-password service-name username", - Short: "Reveal the secrets of a DBaaS Valkey user", + Use: "reset-elastic-ip-field id field", + Short: "Reset an Elastic IP field to its default value", Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XRevealDbaasValkeyUserPassword(args[0], args[1], params) + _, decoded, err := XResetElasticIpField(args[0], args[1], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -18220,14 +21535,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "list-deploy-targets", - Short: "List Deploy Targets", - Long: cli.Markdown(""), + Use: "attach-instance-to-elastic-ip id", + Short: "Attach a Compute instance to an Elastic IP", + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n instance:\n $ref: '#/components/schemas/instance-ref'\nrequired:\n- instance\ntype: object\n"), Example: examples, - Args: cobra.MinimumNArgs(0), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XListDeployTargets(params) + _, decoded, err := XAttachInstanceToElasticIp(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -18255,14 +21574,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-deploy-target id", - Short: "Retrieve Deploy Target details", - Long: cli.Markdown(""), + Use: "detach-instance-from-elastic-ip id", + Short: "Detach a Compute instance from an Elastic IP", + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n instance:\n $ref: '#/components/schemas/instance-ref'\nrequired:\n- instance\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XGetDeployTarget(args[0], params) + _, decoded, err := XDetachInstanceFromElasticIp(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -18290,18 +21613,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "create-dns-domain", - Short: "Create DNS domain", - Long: cli.Markdown("\n## Request Schema (application/json)\n\ndescription: DNS Domain\nproperties:\n unicode-name:\n description: Domain name\n type: string\ntype: object\n"), + Use: "get-env-impact period", + Short: "[BETA] Retrieve organization environmental impact reports", + Long: cli.Markdown("[BETA] Returns environmental impact reports for an organization"), Example: examples, - Args: cobra.MinimumNArgs(0), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[0:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XCreateDnsDomain(params, body) + _, decoded, err := XGetEnvImpact(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -18329,14 +21648,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "list-dns-domains", - Short: "List DNS domains", - Long: cli.Markdown(""), + Use: "list-events", + Short: "List Events", + Long: cli.Markdown("Retrieve Mutation Events for a given date range. Defaults to retrieving Events for the past 24 hours.\n Both a `from` and `to` arguments can be specified to filter Events over a specific period.\n Events will be the the most descriptive possible but not all fields are mandatory"), Example: examples, Args: cobra.MinimumNArgs(0), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XListDnsDomains(params) + _, decoded, err := XListEvents(params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -18350,6 +21669,9 @@ func xRegister(subcommand bool) { root.AddCommand(cmd) + cmd.Flags().String("from", "", "") + cmd.Flags().String("to", "", "") + cli.SetCustomFlags(cmd) if cmd.Flags().HasFlags() { @@ -18364,18 +21686,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "create-dns-domain-record domain-id", - Short: "Create DNS domain record", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n content:\n description: DNS domain record content\n type: string\n name:\n description: DNS domain record name\n type: string\n priority:\n description: DNS domain record priority\n format: int64\n minimum: 0\n type: integer\n ttl:\n description: DNS domain record TTL\n format: int64\n minimum: 0\n type: integer\n type:\n description: DNS domain record type\n enum:\n - NS\n - CAA\n - NAPTR\n - POOL\n - A\n - HINFO\n - CNAME\n - SSHFP\n - SRV\n - AAAA\n - MX\n - TXT\n - ALIAS\n - URL\n - SPF\n type: string\nrequired:\n- name\n- type\n- content\ntype: object\n"), + Use: "get-iam-organization-policy", + Short: "Retrieve IAM Organization Policy", + Long: cli.Markdown(""), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(0), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XCreateDnsDomainRecord(args[0], params, body) + _, decoded, err := XGetIamOrganizationPolicy(params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -18403,14 +21721,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "list-dns-domain-records domain-id", - Short: "List DNS domain records", - Long: cli.Markdown(""), + Use: "update-iam-organization-policy", + Short: "Update IAM Organization Policy", + Long: cli.Markdown("\n## Request Schema (application/json)\n\ndescription: Policy\nproperties:\n default-service-strategy:\n description: IAM default service strategy\n enum:\n - allow\n - deny\n type: string\n services:\n additionalProperties:\n $ref: '#/components/schemas/iam-service-policy'\n description: IAM services\n type: object\nrequired:\n- default-service-strategy\n- services\ntype: object\n"), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(0), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[0:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XListDnsDomainRecords(args[0], params) + _, decoded, err := XUpdateIamOrganizationPolicy(params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -18438,14 +21760,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "delete-dns-domain-record domain-id record-id", - Short: "Delete DNS domain record", + Use: "reset-iam-organization-policy", + Short: "Reset IAM Organization Policy", Long: cli.Markdown(""), Example: examples, - Args: cobra.MinimumNArgs(2), + Args: cobra.MinimumNArgs(0), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("", args[0:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XDeleteDnsDomainRecord(args[0], args[1], params) + _, decoded, err := XResetIamOrganizationPolicy(params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -18473,14 +21799,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-dns-domain-record domain-id record-id", - Short: "Retrieve DNS domain record details", - Long: cli.Markdown(""), + Use: "create-iam-role", + Short: "Create IAM Role", + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n assume-role-policy:\n $ref: '#/components/schemas/iam-policy'\n description:\n description: IAM Role description\n maxLength: 255\n minLength: 1\n type: string\n editable:\n description: 'Sets if the IAM Role Policy is editable or not (default: true). This setting cannot be changed after creation'\n type: boolean\n labels:\n $ref: '#/components/schemas/labels'\n max-session-ttl:\n description: Maximum TTL requester is allowed to ask for when assuming a role\n exclusiveMinimum: true\n format: int64\n minimum: 0\n type: integer\n name:\n description: IAM Role name\n maxLength: 191\n minLength: 1\n type: string\n permissions:\n description: IAM Role permissions\n items:\n enum:\n - bypass-governance-retention\n - reset-iam-organization-policy\n type: string\n type: array\n uniqueItems: true\n policy:\n $ref: '#/components/schemas/iam-policy'\nrequired:\n- name\ntype: object\n"), Example: examples, - Args: cobra.MinimumNArgs(2), + Args: cobra.MinimumNArgs(0), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[0:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XGetDnsDomainRecord(args[0], args[1], params) + _, decoded, err := XCreateIamRole(params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -18508,18 +21838,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "update-dns-domain-record domain-id record-id", - Short: "Update DNS domain record", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n content:\n description: DNS domain record content\n type: string\n name:\n description: DNS domain record name\n type: string\n priority:\n description: DNS domain record priority\n exclusiveMinimum: true\n format: int64\n minimum: 0\n type: integer\n ttl:\n description: DNS domain record TTL\n exclusiveMinimum: true\n format: int64\n minimum: 0\n type: integer\ntype: object\n"), + Use: "list-iam-roles", + Short: "List IAM Roles", + Long: cli.Markdown(""), Example: examples, - Args: cobra.MinimumNArgs(2), + Args: cobra.MinimumNArgs(0), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[2:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XUpdateDnsDomainRecord(args[0], args[1], params, body) + _, decoded, err := XListIamRoles(params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -18547,14 +21873,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "delete-dns-domain id", - Short: "Delete DNS Domain", + Use: "delete-iam-role id", + Short: "Delete IAM Role", Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XDeleteDnsDomain(args[0], params) + _, decoded, err := XDeleteIamRole(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -18582,14 +21908,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-dns-domain id", - Short: "Retrieve DNS domain details", + Use: "get-iam-role id", + Short: "Retrieve IAM Role", Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XGetDnsDomain(args[0], params) + _, decoded, err := XGetIamRole(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -18617,14 +21943,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-dns-domain-zone-file id", - Short: "Retrieve DNS domain zone file", - Long: cli.Markdown(""), + Use: "update-iam-role id", + Short: "Update IAM Role", + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n description:\n description: IAM Role description\n maxLength: 255\n minLength: 1\n type: string\n labels:\n $ref: '#/components/schemas/labels'\n max-session-ttl:\n description: Maximum TTL requester is allowed to ask for when assuming a role\n exclusiveMinimum: true\n format: int64\n minimum: 0\n type: integer\n permissions:\n description: IAM Role permissions\n items:\n enum:\n - bypass-governance-retention\n - reset-iam-organization-policy\n type: string\n type: array\n uniqueItems: true\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XGetDnsDomainZoneFile(args[0], params) + _, decoded, err := XUpdateIamRole(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -18652,18 +21982,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "create-elastic-ip", - Short: "Create an Elastic IP", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n addressfamily:\n description: 'Elastic IP address family (default: :inet4)'\n enum:\n - inet4\n - inet6\n type: string\n description:\n description: Elastic IP description\n maxLength: 255\n type: string\n healthcheck:\n $ref: '#/components/schemas/elastic-ip-healthcheck'\n labels:\n $ref: '#/components/schemas/labels'\ntype: object\n"), + Use: "update-iam-role-assume-policy id", + Short: "Update IAM Assume role Policy", + Long: cli.Markdown("\n## Request Schema (application/json)\n\ndescription: Policy\nproperties:\n default-service-strategy:\n description: IAM default service strategy\n enum:\n - allow\n - deny\n type: string\n services:\n additionalProperties:\n $ref: '#/components/schemas/iam-service-policy'\n description: IAM services\n type: object\nrequired:\n- default-service-strategy\n- services\ntype: object\n"), Example: examples, - Args: cobra.MinimumNArgs(0), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[0:]) + body, err := cli.GetBody("application/json", args[1:]) if err != nil { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XCreateElasticIp(params, body) + _, decoded, err := XUpdateIamRoleAssumePolicy(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -18691,14 +22021,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "list-elastic-ips", - Short: "List Elastic IPs", - Long: cli.Markdown(""), + Use: "update-iam-role-policy id", + Short: "Update IAM Role Policy", + Long: cli.Markdown("\n## Request Schema (application/json)\n\ndescription: Policy\nproperties:\n default-service-strategy:\n description: IAM default service strategy\n enum:\n - allow\n - deny\n type: string\n services:\n additionalProperties:\n $ref: '#/components/schemas/iam-service-policy'\n description: IAM services\n type: object\nrequired:\n- default-service-strategy\n- services\ntype: object\n"), Example: examples, - Args: cobra.MinimumNArgs(0), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XListElasticIps(params) + _, decoded, err := XUpdateIamRolePolicy(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -18726,14 +22060,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "delete-elastic-ip id", - Short: "Delete an Elastic IP", - Long: cli.Markdown(""), + Use: "assume-iam-role target-role-id", + Short: "[BETA] Request generation of key/secret that allow caller to assume target role", + Long: cli.Markdown("[BETA] Request generation of key/secret that allow caller to assume target role\n## Request Schema (application/json)\n\nproperties:\n ttl:\n description: TTL in seconds for the generated access key (cannot exceed the max TTL defined in the targeted assume role)\n exclusiveMinimum: true\n format: int64\n minimum: 0\n type: integer\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XDeleteElasticIp(args[0], params) + _, decoded, err := XAssumeIamRole(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -18761,14 +22099,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-elastic-ip id", - Short: "Retrieve Elastic IP details", - Long: cli.Markdown(""), + Use: "create-instance", + Short: "Create a Compute instance", + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n anti-affinity-groups:\n description: Instance Anti-affinity Groups\n items:\n $ref: '#/components/schemas/anti-affinity-group-ref'\n type: array\n uniqueItems: true\n application-consistent-snapshot-enabled:\n description: Enable application-consistent snapshot for the instance\n type: boolean\n auto-start:\n description: 'Start Instance on creation (default: true)'\n type: boolean\n deploy-target:\n $ref: '#/components/schemas/deploy-target-ref'\n disk-size:\n description: Instance disk size in GiB\n format: int64\n maximum: 51200\n minimum: 10\n type: integer\n instance-type:\n $ref: '#/components/schemas/instance-type-ref'\n ipv6-enabled:\n description: 'Enable IPv6. DEPRECATED: use `public-ip-assignments`.'\n type: boolean\n labels:\n $ref: '#/components/schemas/labels'\n name:\n description: Instance name\n maxLength: 255\n minLength: 1\n type: string\n public-ip-assignment:\n $ref: '#/components/schemas/public-ip-assignment'\n secureboot-enabled:\n description: Enable secure boot\n type: boolean\n security-groups:\n description: Instance Security Groups\n items:\n $ref: '#/components/schemas/security-group-ref'\n type: array\n uniqueItems: true\n ssh-key:\n $ref: '#/components/schemas/ssh-key-ref'\n ssh-keys:\n description: Instance SSH Keys\n items:\n $ref: '#/components/schemas/ssh-key-ref'\n type: array\n uniqueItems: true\n template:\n $ref: '#/components/schemas/template-ref'\n tpm-enabled:\n description: Enable Trusted Platform Module (TPM)\n type: boolean\n user-data:\n description: Instance Cloud-init user-data (base64 encoded)\n maxLength: 32768\n minLength: 1\n type: string\nrequired:\n- disk-size\n- instance-type\n- template\ntype: object\n"), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(0), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[0:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XGetElasticIp(args[0], params) + _, decoded, err := XCreateInstance(params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -18796,18 +22138,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "update-elastic-ip id", - Short: "Update an Elastic IP", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n description:\n description: Elastic IP description\n maxLength: 255\n type: string\n healthcheck:\n $ref: '#/components/schemas/elastic-ip-healthcheck'\n labels:\n $ref: '#/components/schemas/labels'\ntype: object\n"), + Use: "list-instances", + Short: "List Compute instances", + Long: cli.Markdown(""), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(0), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XUpdateElasticIp(args[0], params, body) + _, decoded, err := XListInstances(params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -18821,6 +22159,11 @@ func xRegister(subcommand bool) { root.AddCommand(cmd) + cmd.Flags().String("manager-id", "", "") + cmd.Flags().String("manager-type", "", "") + cmd.Flags().String("ip-address", "", "") + cmd.Flags().String("labels", "", "") + cli.SetCustomFlags(cmd) if cmd.Flags().HasFlags() { @@ -18835,14 +22178,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "reset-elastic-ip-field id field", - Short: "Reset an Elastic IP field to its default value", - Long: cli.Markdown(""), + Use: "create-instance-pool", + Short: "Create an Instance Pool", + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n anti-affinity-groups:\n description: Instance Pool Anti-affinity Groups\n items:\n $ref: '#/components/schemas/anti-affinity-group-ref'\n type: array\n uniqueItems: true\n application-consistent-snapshot-enabled:\n description: Enable application consistent snapshots\n type: boolean\n deploy-target:\n $ref: '#/components/schemas/deploy-target-ref'\n description:\n description: Instance Pool description\n maxLength: 255\n type: string\n disk-size:\n description: Instances disk size in GiB\n format: int64\n maximum: 51200\n minimum: 10\n type: integer\n elastic-ips:\n description: Instances Elastic IPs\n items:\n $ref: '#/components/schemas/elastic-ip-ref'\n type: array\n uniqueItems: true\n instance-prefix:\n description: 'Prefix to apply to Instances names (default: pool)'\n maxLength: 30\n minLength: 1\n type: string\n instance-type:\n $ref: '#/components/schemas/instance-type-ref'\n ipv6-enabled:\n description: 'Enable IPv6. DEPRECATED: use `public-ip-assignments`.'\n type: boolean\n labels:\n $ref: '#/components/schemas/labels'\n min-available:\n description: Minimum number of running Instances\n format: int64\n minimum: 0\n type: integer\n name:\n description: Instance Pool name\n maxLength: 255\n minLength: 1\n type: string\n private-networks:\n description: Instance Pool Private Networks\n items:\n $ref: '#/components/schemas/private-network-ref'\n type: array\n uniqueItems: true\n public-ip-assignment:\n description: Determines public IP assignment of the Instances. Type `none` is final and can't be changed later on.\n enum:\n - inet4\n - dual\n - none\n type: string\n security-groups:\n description: Instance Pool Security Groups\n items:\n $ref: '#/components/schemas/security-group-ref'\n type: array\n uniqueItems: true\n size:\n description: Number of Instances\n exclusiveMinimum: true\n format: int64\n minimum: 0\n type: integer\n ssh-key:\n $ref: '#/components/schemas/ssh-key-ref'\n ssh-keys:\n description: Instances SSH Keys\n items:\n $ref: '#/components/schemas/ssh-key-ref'\n type: array\n uniqueItems: true\n template:\n $ref: '#/components/schemas/template-ref'\n user-data:\n description: Instances Cloud-init user-data\n maxLength: 32768\n minLength: 1\n type: string\nrequired:\n- name\n- size\n- instance-type\n- template\n- disk-size\ntype: object\n"), Example: examples, - Args: cobra.MinimumNArgs(2), + Args: cobra.MinimumNArgs(0), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[0:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XResetElasticIpField(args[0], args[1], params) + _, decoded, err := XCreateInstancePool(params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -18870,18 +22217,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "attach-instance-to-elastic-ip id", - Short: "Attach a Compute instance to an Elastic IP", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n instance:\n $ref: '#/components/schemas/instance-target'\nrequired:\n- instance\ntype: object\n"), + Use: "list-instance-pools", + Short: "List Instance Pools", + Long: cli.Markdown(""), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(0), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XAttachInstanceToElasticIp(args[0], params, body) + _, decoded, err := XListInstancePools(params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -18909,18 +22252,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "detach-instance-from-elastic-ip id", - Short: "Detach a Compute instance from an Elastic IP", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n instance:\n $ref: '#/components/schemas/instance-target'\nrequired:\n- instance\ntype: object\n"), + Use: "delete-instance-pool id", + Short: "Delete an Instance Pool", + Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XDetachInstanceFromElasticIp(args[0], params, body) + _, decoded, err := XDeleteInstancePool(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -18948,14 +22287,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-env-impact", - Short: "[BETA] Retrieve organization environmental impact reports", - Long: cli.Markdown("[BETA] Returns environmental impact reports for an organization"), + Use: "get-instance-pool id", + Short: "Retrieve Instance Pool details", + Long: cli.Markdown(""), Example: examples, - Args: cobra.MinimumNArgs(0), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XGetEnvImpact(params) + _, decoded, err := XGetInstancePool(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -18969,8 +22308,6 @@ func xRegister(subcommand bool) { root.AddCommand(cmd) - cmd.Flags().String("period", "", "") - cli.SetCustomFlags(cmd) if cmd.Flags().HasFlags() { @@ -18985,14 +22322,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "list-events", - Short: "List Events", - Long: cli.Markdown("Retrieve Mutation Events for a given date range. Defaults to retrieving Events for the past 24 hours.\n Both a `from` and `to` arguments can be specified to filter Events over a specific period.\n Events will be the the most descriptive possible but not all fields are mandatory"), + Use: "update-instance-pool id", + Short: "Update an Instance Pool", + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n anti-affinity-groups:\n description: Instance Pool Anti-affinity Groups\n items:\n $ref: '#/components/schemas/anti-affinity-group-ref'\n nullable: true\n type: array\n uniqueItems: true\n application-consistent-snapshot-enabled:\n description: Enable application consistent snapshots\n type: boolean\n deploy-target:\n $ref: '#/components/schemas/deploy-target-ref'\n description:\n description: Instance Pool description\n maxLength: 255\n type: string\n disk-size:\n description: Instances disk size in GiB\n format: int64\n maximum: 51200\n minimum: 10\n type: integer\n elastic-ips:\n description: Instances Elastic IPs\n items:\n $ref: '#/components/schemas/elastic-ip-ref'\n nullable: true\n type: array\n instance-prefix:\n description: 'Prefix to apply to Instances names (default: pool)'\n nullable: true\n type: string\n instance-type:\n $ref: '#/components/schemas/instance-type-ref'\n ipv6-enabled:\n description: 'Enable IPv6. DEPRECATED: use `public-ip-assignments`.'\n type: boolean\n labels:\n $ref: '#/components/schemas/labels'\n min-available:\n description: Minimum number of running Instances\n format: int64\n minimum: 0\n nullable: true\n type: integer\n name:\n description: Instance Pool name\n maxLength: 255\n minLength: 1\n type: string\n private-networks:\n description: Instance Pool Private Networks\n items:\n $ref: '#/components/schemas/private-network-ref'\n nullable: true\n type: array\n uniqueItems: true\n public-ip-assignment:\n description: Determines public IP assignment of the Instances.\n enum:\n - inet4\n - dual\n type: string\n security-groups:\n description: Instance Pool Security Groups\n items:\n $ref: '#/components/schemas/security-group-ref'\n nullable: true\n type: array\n uniqueItems: true\n ssh-key:\n $ref: '#/components/schemas/ssh-key-ref'\n ssh-keys:\n description: Instances SSH keys\n items:\n $ref: '#/components/schemas/ssh-key-ref'\n nullable: true\n type: array\n uniqueItems: true\n template:\n $ref: '#/components/schemas/template-ref'\n user-data:\n description: Instances Cloud-init user-data\n minLength: 1\n nullable: true\n type: string\ntype: object\n"), Example: examples, - Args: cobra.MinimumNArgs(0), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XListEvents(params) + _, decoded, err := XUpdateInstancePool(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -19006,9 +22347,6 @@ func xRegister(subcommand bool) { root.AddCommand(cmd) - cmd.Flags().String("from", "", "") - cmd.Flags().String("to", "", "") - cli.SetCustomFlags(cmd) if cmd.Flags().HasFlags() { @@ -19023,14 +22361,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-iam-organization-policy", - Short: "Retrieve IAM Organization Policy", + Use: "reset-instance-pool-field id field", + Short: "Reset an Instance Pool field to its default value", Long: cli.Markdown(""), Example: examples, - Args: cobra.MinimumNArgs(0), + Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XGetIamOrganizationPolicy(params) + _, decoded, err := XResetInstancePoolField(args[0], args[1], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -19058,18 +22396,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "update-iam-organization-policy", - Short: "Update IAM Organization Policy", - Long: cli.Markdown("\n## Request Schema (application/json)\n\ndescription: Policy\nproperties:\n default-service-strategy:\n description: IAM default service strategy\n enum:\n - allow\n - deny\n type: string\n services:\n additionalProperties:\n $ref: '#/components/schemas/iam-service-policy'\n description: IAM services\n type: object\nrequired:\n- default-service-strategy\n- services\ntype: object\n"), + Use: "evict-instance-pool-members id", + Short: "Evict Instance Pool members", + Long: cli.Markdown("This operation evicts the specified Compute instances member from the Instance Pool, shrinking it to `<current pool size> - <# evicted members>`.\n## Request Schema (application/json)\n\nproperties:\n instances:\n items:\n format: uuid\n type: string\n type: array\ntype: object\n"), Example: examples, - Args: cobra.MinimumNArgs(0), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[0:]) + body, err := cli.GetBody("application/json", args[1:]) if err != nil { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XUpdateIamOrganizationPolicy(params, body) + _, decoded, err := XEvictInstancePoolMembers(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -19097,18 +22435,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "reset-iam-organization-policy", - Short: "Reset IAM Organization Policy", - Long: cli.Markdown(""), + Use: "scale-instance-pool id", + Short: "Scale an Instance Pool", + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n size:\n description: Number of managed Instances\n format: int64\n minimum: 0\n type: integer\nrequired:\n- size\ntype: object\n"), Example: examples, - Args: cobra.MinimumNArgs(0), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("", args[0:]) + body, err := cli.GetBody("application/json", args[1:]) if err != nil { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XResetIamOrganizationPolicy(params, body) + _, decoded, err := XScaleInstancePool(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -19136,18 +22474,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "create-iam-role", - Short: "Create IAM Role", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n description:\n description: IAM Role description\n maxLength: 255\n minLength: 1\n type: string\n editable:\n description: 'Sets if the IAM Role Policy is editable or not (default: true). This setting cannot be changed after creation'\n type: boolean\n labels:\n $ref: '#/components/schemas/labels'\n name:\n description: IAM Role name\n maxLength: 191\n minLength: 1\n type: string\n permissions:\n description: IAM Role permissions\n items:\n enum:\n - bypass-governance-retention\n - reset-iam-organization-policy\n type: string\n type: array\n uniqueItems: true\n policy:\n $ref: '#/components/schemas/iam-policy'\nrequired:\n- name\ntype: object\n"), + Use: "list-instance-types", + Short: "List Compute instance Types", + Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(0), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[0:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XCreateIamRole(params, body) + _, decoded, err := XListInstanceTypes(params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -19175,14 +22509,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "list-iam-roles", - Short: "List IAM Roles", + Use: "get-instance-type id", + Short: "Retrieve Instance Type details", Long: cli.Markdown(""), Example: examples, - Args: cobra.MinimumNArgs(0), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XListIamRoles(params) + _, decoded, err := XGetInstanceType(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -19210,14 +22544,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "delete-iam-role id", - Short: "Delete IAM Role", + Use: "delete-instance id", + Short: "Delete a Compute instance", Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XDeleteIamRole(args[0], params) + _, decoded, err := XDeleteInstance(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -19245,14 +22579,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-iam-role id", - Short: "Retrieve IAM Role", + Use: "get-instance id", + Short: "Retrieve Compute instance details", Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XGetIamRole(args[0], params) + _, decoded, err := XGetInstance(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -19280,9 +22614,9 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "update-iam-role id", - Short: "Update IAM Role", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n description:\n description: IAM Role description\n maxLength: 255\n minLength: 1\n type: string\n labels:\n $ref: '#/components/schemas/labels'\n permissions:\n description: IAM Role permissions\n items:\n enum:\n - bypass-governance-retention\n - reset-iam-organization-policy\n type: string\n type: array\n uniqueItems: true\ntype: object\n"), + Use: "update-instance id", + Short: "Update a Compute instance", + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n application-consistent-snapshot-enabled:\n description: Enable/Disable Application Consistent Snapshot for Instance\n type: boolean\n labels:\n $ref: '#/components/schemas/labels'\n name:\n description: Instance name\n maxLength: 255\n minLength: 1\n type: string\n public-ip-assignment:\n $ref: '#/components/schemas/public-ip-assignment'\n user-data:\n description: Instance Cloud-init user-data (base64 encoded)\n maxLength: 32768\n minLength: 1\n type: string\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { @@ -19291,7 +22625,7 @@ func xRegister(subcommand bool) { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XUpdateIamRole(args[0], params, body) + _, decoded, err := XUpdateInstance(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -19319,18 +22653,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "update-iam-role-policy id", - Short: "Update IAM Role Policy", - Long: cli.Markdown("\n## Request Schema (application/json)\n\ndescription: Policy\nproperties:\n default-service-strategy:\n description: IAM default service strategy\n enum:\n - allow\n - deny\n type: string\n services:\n additionalProperties:\n $ref: '#/components/schemas/iam-service-policy'\n description: IAM services\n type: object\nrequired:\n- default-service-strategy\n- services\ntype: object\n"), + Use: "reset-instance-field id field", + Short: "Reset Instance field", + Long: cli.Markdown(""), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XUpdateIamRolePolicy(args[0], params, body) + _, decoded, err := XResetInstanceField(args[0], args[1], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -19358,18 +22688,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "create-instance", - Short: "Create a Compute instance", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n anti-affinity-groups:\n description: Instance Anti-affinity Groups\n items:\n $ref: '#/components/schemas/anti-affinity-group'\n type: array\n uniqueItems: true\n auto-start:\n description: 'Start Instance on creation (default: true)'\n type: boolean\n deploy-target:\n $ref: '#/components/schemas/deploy-target'\n disk-size:\n description: Instance disk size in GiB\n format: int64\n maximum: 51200\n minimum: 10\n type: integer\n instance-type:\n $ref: '#/components/schemas/instance-type'\n ipv6-enabled:\n description: 'Enable IPv6. DEPRECATED: use `public-ip-assignments`.'\n type: boolean\n labels:\n $ref: '#/components/schemas/labels'\n name:\n description: Instance name\n maxLength: 255\n minLength: 1\n type: string\n public-ip-assignment:\n $ref: '#/components/schemas/public-ip-assignment'\n secureboot-enabled:\n description: Enable secure boot\n type: boolean\n security-groups:\n description: Instance Security Groups\n items:\n $ref: '#/components/schemas/security-group'\n type: array\n uniqueItems: true\n ssh-key:\n $ref: '#/components/schemas/ssh-key'\n ssh-keys:\n description: Instance SSH Keys\n items:\n $ref: '#/components/schemas/ssh-key'\n type: array\n uniqueItems: true\n template:\n $ref: '#/components/schemas/template'\n tpm-enabled:\n description: Enable Trusted Platform Module (TPM)\n type: boolean\n user-data:\n description: Instance Cloud-init user-data (base64 encoded)\n maxLength: 32768\n minLength: 1\n type: string\nrequired:\n- disk-size\n- instance-type\n- template\ntype: object\n"), + Use: "add-instance-protection id", + Short: "Set instance destruction protection", + Long: cli.Markdown(""), Example: examples, - Args: cobra.MinimumNArgs(0), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[0:]) + body, err := cli.GetBody("", args[1:]) if err != nil { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XCreateInstance(params, body) + _, decoded, err := XAddInstanceProtection(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -19397,14 +22727,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "list-instances", - Short: "List Compute instances", + Use: "create-snapshot id", + Short: "Create a Snapshot of a Compute instance", Long: cli.Markdown(""), Example: examples, - Args: cobra.MinimumNArgs(0), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XListInstances(params) + _, decoded, err := XCreateSnapshot(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -19418,10 +22752,6 @@ func xRegister(subcommand bool) { root.AddCommand(cmd) - cmd.Flags().String("manager-id", "", "") - cmd.Flags().String("manager-type", "", "") - cmd.Flags().String("ip-address", "", "") - cli.SetCustomFlags(cmd) if cmd.Flags().HasFlags() { @@ -19436,18 +22766,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "create-instance-pool", - Short: "Create an Instance Pool", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n anti-affinity-groups:\n description: Instance Pool Anti-affinity Groups\n items:\n $ref: '#/components/schemas/anti-affinity-group'\n type: array\n uniqueItems: true\n deploy-target:\n $ref: '#/components/schemas/deploy-target'\n description:\n description: Instance Pool description\n maxLength: 255\n type: string\n disk-size:\n description: Instances disk size in GiB\n format: int64\n maximum: 51200\n minimum: 10\n type: integer\n elastic-ips:\n description: Instances Elastic IPs\n items:\n $ref: '#/components/schemas/elastic-ip'\n type: array\n uniqueItems: true\n instance-prefix:\n description: 'Prefix to apply to Instances names (default: pool)'\n maxLength: 30\n minLength: 1\n type: string\n instance-type:\n $ref: '#/components/schemas/instance-type'\n ipv6-enabled:\n description: 'Enable IPv6. DEPRECATED: use `public-ip-assignments`.'\n type: boolean\n labels:\n $ref: '#/components/schemas/labels'\n min-available:\n description: Minimum number of running Instances\n format: int64\n minimum: 0\n type: integer\n name:\n description: Instance Pool name\n maxLength: 255\n minLength: 1\n type: string\n private-networks:\n description: Instance Pool Private Networks\n items:\n $ref: '#/components/schemas/private-network'\n type: array\n uniqueItems: true\n public-ip-assignment:\n description: Determines public IP assignment of the Instances. Type `none` is final and can't be changed later on.\n enum:\n - inet4\n - dual\n - none\n type: string\n security-groups:\n description: Instance Pool Security Groups\n items:\n $ref: '#/components/schemas/security-group'\n type: array\n uniqueItems: true\n size:\n description: Number of Instances\n exclusiveMinimum: true\n format: int64\n minimum: 0\n type: integer\n ssh-key:\n $ref: '#/components/schemas/ssh-key'\n ssh-keys:\n description: Instances SSH Keys\n items:\n $ref: '#/components/schemas/ssh-key'\n type: array\n uniqueItems: true\n template:\n $ref: '#/components/schemas/template'\n user-data:\n description: Instances Cloud-init user-data\n minLength: 1\n type: string\nrequired:\n- name\n- size\n- instance-type\n- template\n- disk-size\ntype: object\n"), + Use: "enable-tpm id", + Short: "Enable tpm for the instance.", + Long: cli.Markdown(""), Example: examples, - Args: cobra.MinimumNArgs(0), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[0:]) + body, err := cli.GetBody("", args[1:]) if err != nil { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XCreateInstancePool(params, body) + _, decoded, err := XEnableTpm(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -19475,14 +22805,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "list-instance-pools", - Short: "List Instance Pools", - Long: cli.Markdown(""), + Use: "reveal-instance-password id", + Short: "Reveal the password used during instance creation or the latest password reset.", + Long: cli.Markdown("Reveal the password used during instance creation or the latest password reset.\n This is only available for VMs created against templates having the `password-enabled`\n property set to `true`.\n\n Passwords are transiently stored for at most 24 hours and intended to be retrieved shortly after\n creation or resets."), Example: examples, - Args: cobra.MinimumNArgs(0), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XListInstancePools(params) + _, decoded, err := XRevealInstancePassword(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -19510,14 +22840,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "delete-instance-pool id", - Short: "Delete an Instance Pool", + Use: "reboot-instance id", + Short: "Reboot a Compute instance", Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XDeleteInstancePool(args[0], params) + _, decoded, err := XRebootInstance(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -19545,14 +22879,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-instance-pool id", - Short: "Retrieve Instance Pool details", + Use: "remove-instance-protection id", + Short: "Remove instance destruction protection", Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XGetInstancePool(args[0], params) + _, decoded, err := XRemoveInstanceProtection(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -19580,9 +22918,9 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "update-instance-pool id", - Short: "Update an Instance Pool", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n anti-affinity-groups:\n description: Instance Pool Anti-affinity Groups\n items:\n $ref: '#/components/schemas/anti-affinity-group'\n nullable: true\n type: array\n uniqueItems: true\n deploy-target:\n $ref: '#/components/schemas/deploy-target'\n description:\n description: Instance Pool description\n maxLength: 255\n type: string\n disk-size:\n description: Instances disk size in GiB\n format: int64\n maximum: 51200\n minimum: 10\n type: integer\n elastic-ips:\n description: Instances Elastic IPs\n items:\n $ref: '#/components/schemas/elastic-ip'\n nullable: true\n type: array\n instance-prefix:\n description: 'Prefix to apply to Instances names (default: pool)'\n nullable: true\n type: string\n instance-type:\n $ref: '#/components/schemas/instance-type'\n ipv6-enabled:\n description: 'Enable IPv6. DEPRECATED: use `public-ip-assignments`.'\n type: boolean\n labels:\n $ref: '#/components/schemas/labels'\n min-available:\n description: Minimum number of running Instances\n format: int64\n minimum: 0\n nullable: true\n type: integer\n name:\n description: Instance Pool name\n maxLength: 255\n minLength: 1\n type: string\n private-networks:\n description: Instance Pool Private Networks\n items:\n $ref: '#/components/schemas/private-network'\n nullable: true\n type: array\n uniqueItems: true\n public-ip-assignment:\n description: Determines public IP assignment of the Instances.\n enum:\n - inet4\n - dual\n type: string\n security-groups:\n description: Instance Pool Security Groups\n items:\n $ref: '#/components/schemas/security-group'\n nullable: true\n type: array\n uniqueItems: true\n ssh-key:\n $ref: '#/components/schemas/ssh-key'\n ssh-keys:\n description: Instances SSH keys\n items:\n $ref: '#/components/schemas/ssh-key'\n nullable: true\n type: array\n uniqueItems: true\n template:\n $ref: '#/components/schemas/template'\n user-data:\n description: Instances Cloud-init user-data\n minLength: 1\n nullable: true\n type: string\ntype: object\n"), + Use: "reset-instance id", + Short: "Reset a Compute instance to a base/target template", + Long: cli.Markdown("This operation re-installs a Compute instance to a base template. If target template is provided it will be used to recreated instance from. Warning: the operation wipes all data stored on the disk.\n## Request Schema (application/json)\n\nproperties:\n disk-size:\n description: Instance disk size in GiB\n format: int64\n maximum: 51200\n minimum: 10\n type: integer\n template:\n $ref: '#/components/schemas/template-ref'\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { @@ -19591,7 +22929,7 @@ func xRegister(subcommand bool) { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XUpdateInstancePool(args[0], params, body) + _, decoded, err := XResetInstance(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -19619,14 +22957,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "reset-instance-pool-field id field", - Short: "Reset an Instance Pool field to its default value", + Use: "reset-instance-password id", + Short: "Reset a compute instance password", Long: cli.Markdown(""), Example: examples, - Args: cobra.MinimumNArgs(2), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XResetInstancePoolField(args[0], args[1], params) + _, decoded, err := XResetInstancePassword(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -19654,9 +22996,9 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "evict-instance-pool-members id", - Short: "Evict Instance Pool members", - Long: cli.Markdown("This operation evicts the specified Compute instances member from the Instance Pool, shrinking it to `<current pool size> - <# evicted members>`.\n## Request Schema (application/json)\n\nproperties:\n instances:\n items:\n format: uuid\n type: string\n type: array\ntype: object\n"), + Use: "resize-instance-disk id", + Short: "Resize a Compute instance disk", + Long: cli.Markdown("This operation resizes a Compute instance's disk volume. Note: the disk can only grow, cannot be shrunk.\n## Request Schema (application/json)\n\nproperties:\n disk-size:\n description: Instance disk size in GiB\n format: int64\n maximum: 51200\n minimum: 10\n type: integer\nrequired:\n- disk-size\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { @@ -19665,7 +23007,7 @@ func xRegister(subcommand bool) { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XEvictInstancePoolMembers(args[0], params, body) + _, decoded, err := XResizeInstanceDisk(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -19693,9 +23035,9 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "scale-instance-pool id", - Short: "Scale an Instance Pool", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n size:\n description: Number of managed Instances\n exclusiveMinimum: true\n format: int64\n minimum: 0\n type: integer\nrequired:\n- size\ntype: object\n"), + Use: "scale-instance id", + Short: "Scale a Compute instance to a new Instance Type", + Long: cli.Markdown("This operation changes the Compute instance's type. Note: the new Instance Type must be within the same family (e.g. a standard instance cannot be scaled to gpu2 or storage).\n## Request Schema (application/json)\n\nproperties:\n instance-type:\n $ref: '#/components/schemas/instance-type-ref'\nrequired:\n- instance-type\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { @@ -19704,7 +23046,7 @@ func xRegister(subcommand bool) { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XScaleInstancePool(args[0], params, body) + _, decoded, err := XScaleInstance(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -19732,14 +23074,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "list-instance-types", - Short: "List Compute instance Types", - Long: cli.Markdown(""), + Use: "start-instance id", + Short: "Start a Compute instance", + Long: cli.Markdown("This operation starts a virtual machine, potentially using a rescue profile if specified\n## Request Schema (application/json)\n\nproperties:\n rescue-profile:\n description: 'Boot in Rescue Mode, using named profile (supported: netboot, netboot-efi)'\n enum:\n - netboot-efi\n - netboot\n type: string\ntype: object\n"), Example: examples, - Args: cobra.MinimumNArgs(0), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XListInstanceTypes(params) + _, decoded, err := XStartInstance(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -19767,14 +23113,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-instance-type id", - Short: "Retrieve Instance Type details", + Use: "stop-instance id", + Short: "Stop a Compute instance", Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XGetInstanceType(args[0], params) + _, decoded, err := XStopInstance(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -19802,14 +23152,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "delete-instance id", - Short: "Delete a Compute instance", - Long: cli.Markdown(""), + Use: "revert-instance-to-snapshot instance-id", + Short: "Revert a snapshot for an instance", + Long: cli.Markdown("This operation reverts the snapshot to the Compute instance volume, restoring stored data as it was at the time of the snapshot.\nThe Compute instance must be previously stopped.\n## Request Schema (application/json)\n\nproperties:\n id:\n description: Snapshot ID\n format: uuid\n type: string\nrequired:\n- id\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XDeleteInstance(args[0], params) + _, decoded, err := XRevertInstanceToSnapshot(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -19837,14 +23191,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-instance id", - Short: "Retrieve Compute instance details", - Long: cli.Markdown(""), + Use: "create-kms-key", + Short: "[BETA] Create KMS Key", + Long: cli.Markdown("Create a KMS Key in a given zone with a given name.\n## Request Schema (application/json)\n\nproperties:\n description:\n type: string\n multi-zone:\n type: boolean\n name:\n type: string\n usage:\n enum:\n - encrypt-decrypt\n type: string\nrequired:\n- name\n- description\n- usage\n- multi-zone\ntype: object\n"), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(0), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[0:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XGetInstance(args[0], params) + _, decoded, err := XCreateKmsKey(params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -19872,18 +23230,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "update-instance id", - Short: "Update a Compute instance", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n labels:\n $ref: '#/components/schemas/labels'\n name:\n description: Instance name\n maxLength: 255\n minLength: 1\n type: string\n public-ip-assignment:\n $ref: '#/components/schemas/public-ip-assignment'\n user-data:\n description: Instance Cloud-init user-data (base64 encoded)\n maxLength: 32768\n minLength: 1\n type: string\ntype: object\n"), + Use: "list-kms-keys", + Short: "[BETA] List KMS Keys", + Long: cli.Markdown("List KMS Keys details for an organization in a given zone."), Example: examples, - Args: cobra.MinimumNArgs(1), + Args: cobra.MinimumNArgs(0), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XUpdateInstance(args[0], params, body) + _, decoded, err := XListKmsKeys(params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -19911,14 +23265,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "reset-instance-field id field", - Short: "Reset Instance field", - Long: cli.Markdown(""), + Use: "get-kms-key id", + Short: "[BETA] Get KMS Key", + Long: cli.Markdown("Retrieve KMS Key details."), Example: examples, - Args: cobra.MinimumNArgs(2), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XResetInstanceField(args[0], args[1], params) + _, decoded, err := XGetKmsKey(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -19946,9 +23300,9 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "add-instance-protection id", - Short: "Set instance destruction protection", - Long: cli.Markdown(""), + Use: "cancel-kms-key-deletion id", + Short: "[Beta] Cancel KMS Key Deletion", + Long: cli.Markdown("Cancel the scheduled deletion of a KMS Key."), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { @@ -19957,7 +23311,7 @@ func xRegister(subcommand bool) { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XAddInstanceProtection(args[0], params, body) + _, decoded, err := XCancelKmsKeyDeletion(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -19985,18 +23339,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "create-snapshot id", - Short: "Create a Snapshot of a Compute instance", - Long: cli.Markdown(""), + Use: "decrypt id", + Short: "[BETA] Decrypt", + Long: cli.Markdown("Decrypt a ciphertext.\n## Request Schema (application/json)\n\nproperties:\n ciphertext:\n format: byte\n type: string\n encryption-context:\n format: byte\n nullable: true\n type: string\nrequired:\n- ciphertext\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("", args[1:]) + body, err := cli.GetBody("application/json", args[1:]) if err != nil { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XCreateSnapshot(args[0], params, body) + _, decoded, err := XDecrypt(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -20024,9 +23378,9 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "enable-tpm id", - Short: "Enable tpm for the instance.", - Long: cli.Markdown(""), + Use: "disable-kms-key id", + Short: "[BETA] Disable KMS Key", + Long: cli.Markdown("Disable a KMS Key"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { @@ -20035,7 +23389,7 @@ func xRegister(subcommand bool) { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XEnableTpm(args[0], params, body) + _, decoded, err := XDisableKmsKey(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -20063,14 +23417,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "reveal-instance-password id", - Short: "Reveal the password used during instance creation or the latest password reset.", - Long: cli.Markdown("Reveal the password used during instance creation or the latest password reset.\n This is only available for VMs created against templates having the `password-enabled`\n property set to `true`.\n\n Passwords are transiently stored for at most 24 hours and intended to be retrieved shortly after\n creation or resets."), + Use: "disable-kms-key-rotation id", + Short: "[BETA] Disable Key Rotation", + Long: cli.Markdown("Disable the periodic rotation of a KMS Key.\n## Request Schema (application/json)\n\nproperties:\n id:\n format: uuid\n type: string\nrequired:\n- id\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[1:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XRevealInstancePassword(args[0], params) + _, decoded, err := XDisableKmsKeyRotation(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -20098,9 +23456,9 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "reboot-instance id", - Short: "Reboot a Compute instance", - Long: cli.Markdown(""), + Use: "enable-kms-key id", + Short: "[BETA] Enable KMS Key", + Long: cli.Markdown("Enable a KMS Key\""), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { @@ -20109,7 +23467,7 @@ func xRegister(subcommand bool) { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XRebootInstance(args[0], params, body) + _, decoded, err := XEnableKmsKey(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -20137,18 +23495,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "remove-instance-protection id", - Short: "Remove instance destruction protection", - Long: cli.Markdown(""), + Use: "enable-kms-key-rotation id", + Short: "[BETA] Enable Key Rotation", + Long: cli.Markdown("Enable the periodic rotation of a KMS Key.\n## Request Schema (application/json)\n\nproperties:\n id:\n format: uuid\n type: string\n rotation-period:\n default: 365\n maximum: 2560\n minimum: 90\n type: integer\nrequired:\n- id\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("", args[1:]) + body, err := cli.GetBody("application/json", args[1:]) if err != nil { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XRemoveInstanceProtection(args[0], params, body) + _, decoded, err := XEnableKmsKeyRotation(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -20176,9 +23534,9 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "reset-instance id", - Short: "Reset a Compute instance to a base/target template", - Long: cli.Markdown("This operation re-installs a Compute instance to a base template. If target template is provided it will be used to recreated instance from. Warning: the operation wipes all data stored on the disk.\n## Request Schema (application/json)\n\nproperties:\n disk-size:\n description: Instance disk size in GiB\n format: int64\n maximum: 51200\n minimum: 10\n type: integer\n template:\n $ref: '#/components/schemas/template'\ntype: object\n"), + Use: "encrypt id", + Short: "[BETA] Encrypt", + Long: cli.Markdown("Encrypt a plaintext.\n## Request Schema (application/json)\n\nproperties:\n encryption-context:\n format: byte\n nullable: true\n type: string\n plaintext:\n format: byte\n type: string\nrequired:\n- plaintext\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { @@ -20187,7 +23545,7 @@ func xRegister(subcommand bool) { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XResetInstance(args[0], params, body) + _, decoded, err := XEncrypt(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -20215,18 +23573,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "reset-instance-password id", - Short: "Reset a compute instance password", - Long: cli.Markdown(""), + Use: "generate-data-key id", + Short: "[BETA] Generate Data Key", + Long: cli.Markdown("Generate a Data Encryption Key from a given KMS Key.\n## Request Schema (application/json)\n\nproperties:\n bytes-count:\n maximum: 1024\n minimum: 1\n type: integer\n encryption-context:\n format: byte\n nullable: true\n type: string\n key-spec:\n enum:\n - AES-256\n type: string\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("", args[1:]) + body, err := cli.GetBody("application/json", args[1:]) if err != nil { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XResetInstancePassword(args[0], params, body) + _, decoded, err := XGenerateDataKey(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -20254,18 +23612,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "resize-instance-disk id", - Short: "Resize a Compute instance disk", - Long: cli.Markdown("This operation resizes a Compute instance's disk volume. Note: the disk can only grow, cannot be shrunk.\n## Request Schema (application/json)\n\nproperties:\n disk-size:\n description: Instance disk size in GiB\n format: int64\n maximum: 51200\n minimum: 10\n type: integer\nrequired:\n- disk-size\ntype: object\n"), + Use: "list-kms-key-rotations id", + Short: "[BETA] List KMS Key Rotations", + Long: cli.Markdown("List all the key material versions of a KMS Key."), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[1:]) - if err != nil { - log.Fatal().Err(err).Msg("Unable to get body") - } - _, decoded, err := XResizeInstanceDisk(args[0], params, body) + _, decoded, err := XListKmsKeyRotations(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -20293,9 +23647,9 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "scale-instance id", - Short: "Scale a Compute instance to a new Instance Type", - Long: cli.Markdown("This operation changes the Compute instance's type. Note: the new Instance Type must be within the same family (e.g. a standard instance cannot be scaled to gpu2 or storage).\n## Request Schema (application/json)\n\nproperties:\n instance-type:\n $ref: '#/components/schemas/instance-type'\nrequired:\n- instance-type\ntype: object\n"), + Use: "re-encrypt id", + Short: "[BETA] Re-encrypt", + Long: cli.Markdown("Decrypts an existing ciphertext using its original key material and re-encrypts the underlying plaintext using a specified KMS key or the latest key material of the same KMS Key.\n## Request Schema (application/json)\n\nproperties:\n destination:\n properties:\n encryption-context:\n description: Optional encryption context appended to the AAD.\n format: byte\n nullable: true\n type: string\n key:\n description: The ID of the target key.\n format: uuid\n type: string\n required:\n - key\n type: object\n source:\n properties:\n ciphertext:\n format: byte\n type: string\n encryption-context:\n description: Optional encryption context appended to the AAD.\n format: byte\n nullable: true\n type: string\n key:\n description: The ID of the source key.\n format: uuid\n type: string\n required:\n - key\n - ciphertext\n type: object\nrequired:\n- source\n- destination\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { @@ -20304,7 +23658,7 @@ func xRegister(subcommand bool) { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XScaleInstance(args[0], params, body) + _, decoded, err := XReEncrypt(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -20332,9 +23686,9 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "start-instance id", - Short: "Start a Compute instance", - Long: cli.Markdown("This operation starts a virtual machine, potentially using a rescue profile if specified\n## Request Schema (application/json)\n\nproperties:\n rescue-profile:\n description: 'Boot in Rescue Mode, using named profile (supported: netboot, netboot-efi)'\n enum:\n - netboot-efi\n - netboot\n type: string\ntype: object\n"), + Use: "replicate-kms-key id", + Short: "[BETA] Replicate KMS Key", + Long: cli.Markdown("Replicate a KMS key to a target zone.\n## Request Schema (application/json)\n\nproperties:\n zone:\n type: string\nrequired:\n- zone\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { @@ -20343,7 +23697,7 @@ func xRegister(subcommand bool) { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XStartInstance(args[0], params, body) + _, decoded, err := XReplicateKmsKey(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -20371,9 +23725,9 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "stop-instance id", - Short: "Stop a Compute instance", - Long: cli.Markdown(""), + Use: "rotate-kms-key id", + Short: "[BETA] Rotate Key", + Long: cli.Markdown("Perform a manual rotation of the key material for a symmetric key."), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { @@ -20382,7 +23736,7 @@ func xRegister(subcommand bool) { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XStopInstance(args[0], params, body) + _, decoded, err := XRotateKmsKey(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -20410,9 +23764,9 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "revert-instance-to-snapshot instance-id", - Short: "Revert a snapshot for an instance", - Long: cli.Markdown("This operation reverts the snapshot to the Compute instance volume, restoring stored data as it was at the time of the snapshot.\nThe Compute instance must be previously stopped.\n## Request Schema (application/json)\n\nproperties:\n id:\n description: Snapshot ID\n format: uuid\n type: string\nrequired:\n- id\ntype: object\n"), + Use: "schedule-kms-key-deletion id", + Short: "[BETA] Schedule KMS Key Deletion", + Long: cli.Markdown("Schedule a KMS key for deletion after a delay.\n## Request Schema (application/json)\n\nproperties:\n delay-days:\n default: 30\n description: Number of days to wait until deletion is final.\n maximum: 30\n minimum: 7\n type: integer\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { @@ -20421,7 +23775,7 @@ func xRegister(subcommand bool) { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XRevertInstanceToSnapshot(args[0], params, body) + _, decoded, err := XScheduleKmsKeyDeletion(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -21921,7 +25275,7 @@ func xRegister(subcommand bool) { cmd := &cobra.Command{ Use: "create-sks-cluster", Short: "Create an SKS cluster", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n addons:\n description: Cluster addons\n items:\n enum:\n - exoscale-cloud-controller\n - exoscale-container-storage-interface\n - metrics-server\n type: string\n type: array\n uniqueItems: true\n auto-upgrade:\n description: Enable auto upgrade of the control plane to the latest patch version available\n type: boolean\n cni:\n description: Cluster CNI\n enum:\n - calico\n - cilium\n type: string\n create-default-security-group:\n description: Creates an ad-hoc security group based on the choice of the selected CNI\n nullable: true\n type: boolean\n description:\n description: Cluster description\n maxLength: 255\n nullable: true\n type: string\n enable-kube-proxy:\n description: Indicates whether to deploy the Kubernetes network proxy. When unspecified, defaults to `true` unless Cilium CNI is selected\n type: boolean\n feature-gates:\n description: A list of Kubernetes-only Alpha features to enable for API server component\n items:\n type: string\n type: array\n uniqueItems: true\n labels:\n $ref: '#/components/schemas/sks-cluster-labels'\n level:\n description: Cluster service level\n enum:\n - starter\n - pro\n type: string\n name:\n description: Cluster name\n maxLength: 255\n minLength: 1\n type: string\n networking:\n $ref: '#/components/schemas/networking'\n oidc:\n $ref: '#/components/schemas/sks-oidc'\n version:\n description: Control plane Kubernetes version\n type: string\nrequired:\n- name\n- level\n- version\ntype: object\n"), + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n addons:\n description: Cluster addons\n items:\n enum:\n - exoscale-cloud-controller\n - exoscale-container-storage-interface\n - metrics-server\n - karpenter\n type: string\n type: array\n uniqueItems: true\n audit:\n $ref: '#/components/schemas/sks-audit-create'\n auto-upgrade:\n description: Enable auto upgrade of the control plane to the latest patch version available\n type: boolean\n cni:\n description: Cluster CNI\n enum:\n - calico\n - cilium\n type: string\n create-default-security-group:\n description: Creates an ad-hoc security group based on the choice of the selected CNI\n nullable: true\n type: boolean\n description:\n description: Cluster description\n maxLength: 255\n nullable: true\n type: string\n enable-kube-proxy:\n description: Indicates whether to deploy the Kubernetes network proxy. When unspecified, defaults to `true` unless Cilium CNI is selected\n type: boolean\n feature-gates:\n description: A list of Kubernetes-only Alpha features to enable for API server component\n items:\n type: string\n type: array\n uniqueItems: true\n labels:\n $ref: '#/components/schemas/sks-cluster-labels'\n level:\n description: Cluster service level\n enum:\n - starter\n - pro\n type: string\n name:\n description: Cluster name\n maxLength: 255\n minLength: 1\n type: string\n networking:\n $ref: '#/components/schemas/networking'\n oidc:\n $ref: '#/components/schemas/sks-oidc'\n version:\n description: Control plane Kubernetes version\n type: string\nrequired:\n- name\n- level\n- version\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(0), Run: func(cmd *cobra.Command, args []string) { @@ -22176,7 +25530,7 @@ func xRegister(subcommand bool) { cmd := &cobra.Command{ Use: "update-sks-cluster id", Short: "Update an SKS cluster", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n addons:\n description: Cluster addons\n items:\n enum:\n - exoscale-cloud-controller\n - exoscale-container-storage-interface\n - metrics-server\n type: string\n type: array\n uniqueItems: true\n auto-upgrade:\n description: Enable auto upgrade of the control plane to the latest patch version available\n type: boolean\n description:\n description: Cluster description\n maxLength: 255\n nullable: true\n type: string\n enable-operators-ca:\n description: Add or remove the operators certificate authority (CA) from the list of trusted CAs of the api server. The default value is true\n type: boolean\n feature-gates:\n description: A list of Kubernetes-only Alpha features to enable for API server component\n items:\n type: string\n nullable: true\n type: array\n uniqueItems: true\n labels:\n $ref: '#/components/schemas/sks-cluster-labels'\n name:\n description: Cluster name\n maxLength: 255\n minLength: 1\n type: string\n oidc:\n $ref: '#/components/schemas/sks-oidc'\ntype: object\n"), + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n addons:\n description: Cluster addons\n items:\n enum:\n - exoscale-cloud-controller\n - exoscale-container-storage-interface\n - metrics-server\n - karpenter\n type: string\n type: array\n uniqueItems: true\n audit:\n $ref: '#/components/schemas/sks-audit-update'\n auto-upgrade:\n description: Enable auto upgrade of the control plane to the latest patch version available\n type: boolean\n description:\n description: Cluster description\n maxLength: 255\n nullable: true\n type: string\n enable-operators-ca:\n description: Add or remove the operators certificate authority (CA) from the list of trusted CAs of the api server. The default value is true\n type: boolean\n feature-gates:\n description: A list of Kubernetes-only Alpha features to enable for API server component\n items:\n type: string\n nullable: true\n type: array\n uniqueItems: true\n labels:\n $ref: '#/components/schemas/sks-cluster-labels'\n name:\n description: Cluster name\n maxLength: 255\n minLength: 1\n type: string\n oidc:\n $ref: '#/components/schemas/sks-oidc'\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { @@ -22285,7 +25639,7 @@ func xRegister(subcommand bool) { cmd := &cobra.Command{ Use: "create-sks-nodepool id", Short: "Create a new SKS Nodepool", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n addons:\n description: Nodepool addons\n items:\n enum:\n - storage-lvm\n type: string\n type: array\n uniqueItems: true\n anti-affinity-groups:\n description: Nodepool Anti-affinity Groups\n items:\n $ref: '#/components/schemas/anti-affinity-group'\n type: array\n uniqueItems: true\n deploy-target:\n $ref: '#/components/schemas/deploy-target'\n description:\n description: Nodepool description\n maxLength: 255\n type: string\n disk-size:\n description: Nodepool instances disk size in GiB\n format: int64\n maximum: 51200\n minimum: 20\n type: integer\n instance-prefix:\n description: 'Prefix to apply to instances names (default: pool), lowercase only'\n maxLength: 30\n minLength: 1\n type: string\n instance-type:\n $ref: '#/components/schemas/instance-type'\n kubelet-image-gc:\n $ref: '#/components/schemas/kubelet-image-gc'\n labels:\n $ref: '#/components/schemas/sks-nodepool-labels'\n name:\n description: Nodepool name, lowercase only\n maxLength: 255\n minLength: 1\n type: string\n private-networks:\n description: Nodepool Private Networks\n items:\n $ref: '#/components/schemas/private-network'\n type: array\n uniqueItems: true\n public-ip-assignment:\n description: |-\n Configures public IP assignment of the Instances with:\n\n * IPv4 (`inet4`) addressing only (default);\n * both IPv4 and IPv6 (`dual`) addressing.\n enum:\n - inet4\n - dual\n type: string\n security-groups:\n description: Nodepool Security Groups\n items:\n $ref: '#/components/schemas/security-group'\n type: array\n uniqueItems: true\n size:\n description: Number of instances\n exclusiveMinimum: true\n format: int64\n minimum: 0\n type: integer\n taints:\n $ref: '#/components/schemas/sks-nodepool-taints'\nrequired:\n- name\n- size\n- disk-size\n- instance-type\ntype: object\n"), + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n addons:\n description: Nodepool addons\n items:\n enum:\n - storage-lvm\n type: string\n type: array\n uniqueItems: true\n anti-affinity-groups:\n description: Nodepool Anti-affinity Groups\n items:\n $ref: '#/components/schemas/anti-affinity-group-ref'\n maxItems: 8\n type: array\n uniqueItems: true\n deploy-target:\n $ref: '#/components/schemas/deploy-target-ref'\n description:\n description: Nodepool description\n maxLength: 255\n type: string\n disk-size:\n description: Nodepool instances disk size in GiB\n format: int64\n maximum: 51200\n minimum: 20\n type: integer\n instance-prefix:\n description: 'Prefix to apply to instances names (default: pool), lowercase only'\n maxLength: 30\n minLength: 1\n type: string\n instance-type:\n $ref: '#/components/schemas/instance-type-ref'\n kubelet-image-gc:\n $ref: '#/components/schemas/kubelet-image-gc'\n labels:\n $ref: '#/components/schemas/sks-nodepool-labels'\n name:\n description: Nodepool name, lowercase only\n maxLength: 255\n minLength: 1\n type: string\n private-networks:\n description: Nodepool Private Networks\n items:\n $ref: '#/components/schemas/private-network-ref'\n maxItems: 16\n type: array\n uniqueItems: true\n public-ip-assignment:\n description: |-\n Configures public IP assignment of the Instances with:\n\n * IPv4 (`inet4`) addressing only (default);\n * both IPv4 and IPv6 (`dual`) addressing.\n enum:\n - inet4\n - dual\n type: string\n security-groups:\n description: Nodepool Security Groups\n items:\n $ref: '#/components/schemas/security-group-ref'\n maxItems: 16\n type: array\n uniqueItems: true\n size:\n description: Number of instances\n exclusiveMinimum: true\n format: int64\n minimum: 0\n type: integer\n taints:\n $ref: '#/components/schemas/sks-nodepool-taints'\nrequired:\n- name\n- size\n- disk-size\n- instance-type\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { @@ -22394,7 +25748,7 @@ func xRegister(subcommand bool) { cmd := &cobra.Command{ Use: "update-sks-nodepool id sks-nodepool-id", Short: "Update an SKS Nodepool", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n anti-affinity-groups:\n description: Nodepool Anti-affinity Groups\n items:\n $ref: '#/components/schemas/anti-affinity-group'\n type: array\n uniqueItems: true\n deploy-target:\n $ref: '#/components/schemas/deploy-target'\n description:\n description: Nodepool description\n maxLength: 255\n type: string\n disk-size:\n description: Nodepool instances disk size in GiB\n format: int64\n maximum: 51200\n minimum: 20\n type: integer\n instance-prefix:\n description: 'Prefix to apply to managed instances names (default: pool), lowercase only'\n maxLength: 30\n minLength: 1\n type: string\n instance-type:\n $ref: '#/components/schemas/instance-type'\n labels:\n $ref: '#/components/schemas/sks-nodepool-labels'\n name:\n description: Nodepool name, lowercase only\n maxLength: 255\n minLength: 1\n type: string\n private-networks:\n description: Nodepool Private Networks\n items:\n $ref: '#/components/schemas/private-network'\n type: array\n uniqueItems: true\n public-ip-assignment:\n description: |-\n Configures public IP assignment of the Instances with:\n\n * IPv4 (`inet4`) addressing only;\n * both IPv4 and IPv6 (`dual`) addressing.\n enum:\n - inet4\n - dual\n type: string\n security-groups:\n description: Nodepool Security Groups\n items:\n $ref: '#/components/schemas/security-group'\n type: array\n uniqueItems: true\n taints:\n $ref: '#/components/schemas/sks-nodepool-taints'\ntype: object\n"), + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n anti-affinity-groups:\n description: Nodepool Anti-affinity Groups\n items:\n $ref: '#/components/schemas/anti-affinity-group-ref'\n maxItems: 8\n type: array\n uniqueItems: true\n deploy-target:\n $ref: '#/components/schemas/deploy-target-ref'\n description:\n description: Nodepool description\n maxLength: 255\n type: string\n disk-size:\n description: Nodepool instances disk size in GiB\n format: int64\n maximum: 51200\n minimum: 20\n type: integer\n instance-prefix:\n description: 'Prefix to apply to managed instances names (default: pool), lowercase only'\n maxLength: 30\n minLength: 1\n type: string\n instance-type:\n $ref: '#/components/schemas/instance-type-ref'\n kubelet-image-gc:\n $ref: '#/components/schemas/kubelet-image-gc'\n labels:\n $ref: '#/components/schemas/sks-nodepool-labels'\n name:\n description: Nodepool name, lowercase only\n maxLength: 255\n minLength: 1\n type: string\n private-networks:\n description: Nodepool Private Networks\n items:\n $ref: '#/components/schemas/private-network-ref'\n maxItems: 16\n type: array\n uniqueItems: true\n public-ip-assignment:\n description: |-\n Configures public IP assignment of the Instances with:\n\n * IPv4 (`inet4`) addressing only;\n * both IPv4 and IPv6 (`dual`) addressing.\n enum:\n - inet4\n - dual\n type: string\n security-groups:\n description: Nodepool Security Groups\n items:\n $ref: '#/components/schemas/security-group-ref'\n maxItems: 16\n type: array\n uniqueItems: true\n taints:\n $ref: '#/components/schemas/sks-nodepool-taints'\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { @@ -22431,14 +25785,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "reset-sks-nodepool-field id sks-nodepool-id field", - Short: "Reset an SKS Nodepool field to its default value", - Long: cli.Markdown(""), + Use: "evict-sks-nodepool-members id sks-nodepool-id", + Short: "Evict Nodepool members", + Long: cli.Markdown("This operation evicts the specified Compute instances member from the Nodepool, shrinking it to `<current nodepool size> - <# evicted members>`.\n## Request Schema (application/json)\n\nproperties:\n instances:\n items:\n format: uuid\n type: string\n type: array\n uniqueItems: true\ntype: object\n"), Example: examples, - Args: cobra.MinimumNArgs(3), + Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { + body, err := cli.GetBody("application/json", args[2:]) + if err != nil { + log.Fatal().Err(err).Msg("Unable to get body") + } - _, decoded, err := XResetSksNodepoolField(args[0], args[1], args[2], params) + _, decoded, err := XEvictSksNodepoolMembers(args[0], args[1], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -22466,9 +25824,9 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "evict-sks-nodepool-members id sks-nodepool-id", - Short: "Evict Nodepool members", - Long: cli.Markdown("This operation evicts the specified Compute instances member from the Nodepool, shrinking it to `<current nodepool size> - <# evicted members>`.\n## Request Schema (application/json)\n\nproperties:\n instances:\n items:\n format: uuid\n type: string\n type: array\n uniqueItems: true\ntype: object\n"), + Use: "scale-sks-nodepool id sks-nodepool-id", + Short: "Scale a SKS Nodepool", + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n size:\n description: Number of instances\n format: int64\n minimum: 0\n type: integer\nrequired:\n- size\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { @@ -22477,7 +25835,7 @@ func xRegister(subcommand bool) { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XEvictSksNodepoolMembers(args[0], args[1], params, body) + _, decoded, err := XScaleSksNodepool(args[0], args[1], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -22505,18 +25863,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "scale-sks-nodepool id sks-nodepool-id", - Short: "Scale a SKS Nodepool", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n size:\n description: Number of instances\n exclusiveMinimum: true\n format: int64\n minimum: 0\n type: integer\nrequired:\n- size\ntype: object\n"), + Use: "rotate-sks-ccm-credentials id", + Short: "Rotate Exoscale CCM credentials", + Long: cli.Markdown(""), Example: examples, - Args: cobra.MinimumNArgs(2), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - body, err := cli.GetBody("application/json", args[2:]) + body, err := cli.GetBody("", args[1:]) if err != nil { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XScaleSksNodepool(args[0], args[1], params, body) + _, decoded, err := XRotateSksCcmCredentials(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -22544,8 +25902,8 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "rotate-sks-ccm-credentials id", - Short: "Rotate Exoscale CCM credentials", + Use: "rotate-sks-csi-credentials id", + Short: "Rotate Exoscale CSI credentials", Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(1), @@ -22555,7 +25913,7 @@ func xRegister(subcommand bool) { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XRotateSksCcmCredentials(args[0], params, body) + _, decoded, err := XRotateSksCsiCredentials(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -22583,8 +25941,8 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "rotate-sks-csi-credentials id", - Short: "Rotate Exoscale CSI credentials", + Use: "rotate-sks-karpenter-credentials id", + Short: "Rotate Exoscale Karpenter credentials", Long: cli.Markdown(""), Example: examples, Args: cobra.MinimumNArgs(1), @@ -22594,7 +25952,7 @@ func xRegister(subcommand bool) { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XRotateSksCsiCredentials(args[0], params, body) + _, decoded, err := XRotateSksKarpenterCredentials(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -22739,14 +26097,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "reset-sks-cluster-field id field", - Short: "Reset an SKS cluster field to its default value", - Long: cli.Markdown(""), + Use: "get-active-nodepool-template kube-version variant", + Short: "get-active-nodepool-template", + Long: cli.Markdown("Get the active template for a given kube version and variant (standard | nvidia)"), Example: examples, Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XResetSksClusterField(args[0], args[1], params) + _, decoded, err := XGetActiveNodepoolTemplate(args[0], args[1], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -23213,7 +26571,7 @@ func xRegister(subcommand bool) { cmd := &cobra.Command{ Use: "register-template", Short: "Register a Template", - Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n boot-mode:\n description: 'Boot mode (default: legacy)'\n enum:\n - legacy\n - uefi\n type: string\n build:\n description: Template build\n maxLength: 255\n minLength: 1\n type: string\n checksum:\n description: Template MD5 checksum\n minLength: 1\n type: string\n default-user:\n description: Template default user\n maxLength: 255\n minLength: 1\n type: string\n description:\n description: Template description\n maxLength: 255\n type: string\n maintainer:\n description: Template maintainer\n maxLength: 255\n minLength: 1\n type: string\n name:\n description: Template name\n maxLength: 255\n minLength: 1\n type: string\n password-enabled:\n description: Enable password-based login\n type: boolean\n size:\n description: Template size\n exclusiveMinimum: true\n format: int64\n minimum: 0\n type: integer\n ssh-key-enabled:\n description: Enable SSH key-based login\n type: boolean\n url:\n description: Template source URL\n minLength: 1\n type: string\n version:\n description: Template version\n maxLength: 255\n minLength: 1\n type: string\nrequired:\n- name\n- url\n- checksum\n- ssh-key-enabled\n- password-enabled\ntype: object\n"), + Long: cli.Markdown("\n## Request Schema (application/json)\n\nproperties:\n application-consistent-snapshot-enabled:\n description: Template with support for Application Consistent Snapshots\n type: boolean\n boot-mode:\n description: 'Boot mode (default: legacy)'\n enum:\n - legacy\n - uefi\n type: string\n build:\n description: Template build\n maxLength: 255\n minLength: 1\n type: string\n checksum:\n description: Template MD5 checksum\n minLength: 1\n type: string\n default-user:\n description: Template default user\n maxLength: 255\n minLength: 1\n type: string\n description:\n description: Template description\n maxLength: 255\n type: string\n maintainer:\n description: Template maintainer\n maxLength: 255\n minLength: 1\n type: string\n name:\n description: Template name\n maxLength: 255\n minLength: 1\n type: string\n password-enabled:\n description: Enable password-based login\n type: boolean\n size:\n description: Template size\n exclusiveMinimum: true\n format: int64\n minimum: 0\n type: integer\n ssh-key-enabled:\n description: Enable SSH key-based login\n type: boolean\n url:\n description: Template source URL\n minLength: 1\n type: string\n version:\n description: Template version\n maxLength: 255\n minLength: 1\n type: string\nrequired:\n- name\n- url\n- checksum\n- ssh-key-enabled\n- password-enabled\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(0), Run: func(cmd *cobra.Command, args []string) { diff --git a/go.mod b/go.mod index bdd13ccca..ba4a870d0 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/exoscale/cli -go 1.25.8 +go 1.26 require ( github.com/aws/aws-sdk-go-v2 v1.2.0 @@ -10,7 +10,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/s3 v1.2.0 github.com/aws/smithy-go v1.1.0 github.com/dustin/go-humanize v1.0.1 - github.com/exoscale/egoscale/v3 v3.1.34 + github.com/exoscale/egoscale/v3 v3.1.35-0.20260331081148-08a321a16e52 github.com/exoscale/openapi-cli-generator v1.2.0 github.com/fatih/camelcase v1.0.0 github.com/hashicorp/go-multierror v1.1.1 diff --git a/go.sum b/go.sum index 940490dd4..fec7f77c1 100644 --- a/go.sum +++ b/go.sum @@ -161,8 +161,8 @@ github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go. github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws= -github.com/exoscale/egoscale/v3 v3.1.34 h1:POTsCy3IhSR9L8ZN89hiKlfeQ9L+D7NncoKb10WsyaA= -github.com/exoscale/egoscale/v3 v3.1.34/go.mod h1:0iY8OxgHJCS5TKqDNhwOW95JBKCnBZl3YGU4Yt+NqkU= +github.com/exoscale/egoscale/v3 v3.1.35-0.20260331081148-08a321a16e52 h1:jYQRF2+1z2VXfQ+VvhncgVHy9OJ1MWfKGMo1atBd0hw= +github.com/exoscale/egoscale/v3 v3.1.35-0.20260331081148-08a321a16e52/go.mod h1:/1RTNibUdltIdzBbFxMMewNAkB6KKdxzRE/Icu8K5RU= github.com/exoscale/openapi-cli-generator v1.2.0 h1:xgTff1bInBP+JZCauD7Jq9GNBFoKK31Cnv5FIAcxtrk= github.com/exoscale/openapi-cli-generator v1.2.0/go.mod h1:TZBnbT7f3hJ5ImyUphJwRM+X5xF/zCQZ6o8a42gQeTs= github.com/fatih/camelcase v1.0.0 h1:hxNvNX/xYBp0ovncs8WyWZrOrpBNub/JfaMvbURyft8= diff --git a/vendor/github.com/exoscale/egoscale/v3/operations.go b/vendor/github.com/exoscale/egoscale/v3/operations.go index 1e5c7c4d3..de223e79e 100644 --- a/vendor/github.com/exoscale/egoscale/v3/operations.go +++ b/vendor/github.com/exoscale/egoscale/v3/operations.go @@ -9055,8 +9055,52 @@ func (c Client) StopDBAASValkeyMigration(ctx context.Context, name string) (*Ope return bodyresp, nil } +func (c Client) ListDBAASValkeyUsers(ctx context.Context, serviceName string) (*DBAASValkeyUsers, error) { + path := fmt.Sprintf("/dbaas-valkey/%v/user", serviceName) + + request, err := http.NewRequestWithContext(ctx, "GET", c.serverEndpoint+path, nil) + if err != nil { + return nil, fmt.Errorf("ListDBAASValkeyUsers: new request: %w", err) + } + + request.Header.Add("User-Agent", c.getUserAgent()) + + if err := c.executeRequestInterceptors(ctx, request); err != nil { + return nil, fmt.Errorf("ListDBAASValkeyUsers: execute request editors: %w", err) + } + + if err := c.signRequest(request); err != nil { + return nil, fmt.Errorf("ListDBAASValkeyUsers: sign request: %w", err) + } + + if c.trace { + dumpRequest(request, "list-dbaas-valkey-users") + } + + response, err := c.httpClient.Do(request) + if err != nil { + return nil, fmt.Errorf("ListDBAASValkeyUsers: http client do: %w", err) + } + + if c.trace { + dumpResponse(response) + } + + if err := handleHTTPErrorResp(response); err != nil { + return nil, fmt.Errorf("ListDBAASValkeyUsers: http response: %w", err) + } + + bodyresp := new(DBAASValkeyUsers) + if err := prepareJSONResponse(response, bodyresp); err != nil { + return nil, fmt.Errorf("ListDBAASValkeyUsers: prepare Json response: %w", err) + } + + return bodyresp, nil +} + type CreateDBAASValkeyUserRequest struct { - Username DBAASUserUsername `json:"username" validate:"required,gte=1,lte=64"` + AccessControl *DBAASValkeyUserAccessControl `json:"access-control,omitempty"` + Username DBAASUserUsername `json:"username" validate:"required,gte=1,lte=64"` } func (c Client) CreateDBAASValkeyUser(ctx context.Context, serviceName string, req CreateDBAASValkeyUserRequest) (*Operation, error) { @@ -9152,6 +9196,60 @@ func (c Client) DeleteDBAASValkeyUser(ctx context.Context, serviceName string, u return bodyresp, nil } +type UpdateDBAASValkeyUserAccessControlRequest struct { + AccessControl *DBAASValkeyUserAccessControl `json:"access-control,omitempty"` +} + +func (c Client) UpdateDBAASValkeyUserAccessControl(ctx context.Context, serviceName string, username string, req UpdateDBAASValkeyUserAccessControlRequest) (*Operation, error) { + path := fmt.Sprintf("/dbaas-valkey/%v/user/%v", serviceName, username) + + body, err := prepareJSONBody(req) + if err != nil { + return nil, fmt.Errorf("UpdateDBAASValkeyUserAccessControl: prepare Json body: %w", err) + } + + request, err := http.NewRequestWithContext(ctx, "PUT", c.serverEndpoint+path, body) + if err != nil { + return nil, fmt.Errorf("UpdateDBAASValkeyUserAccessControl: new request: %w", err) + } + + request.Header.Add("User-Agent", c.getUserAgent()) + + request.Header.Add("Content-Type", "application/json") + + if err := c.executeRequestInterceptors(ctx, request); err != nil { + return nil, fmt.Errorf("UpdateDBAASValkeyUserAccessControl: execute request editors: %w", err) + } + + if err := c.signRequest(request); err != nil { + return nil, fmt.Errorf("UpdateDBAASValkeyUserAccessControl: sign request: %w", err) + } + + if c.trace { + dumpRequest(request, "update-dbaas-valkey-user-access-control") + } + + response, err := c.httpClient.Do(request) + if err != nil { + return nil, fmt.Errorf("UpdateDBAASValkeyUserAccessControl: http client do: %w", err) + } + + if c.trace { + dumpResponse(response) + } + + if err := handleHTTPErrorResp(response); err != nil { + return nil, fmt.Errorf("UpdateDBAASValkeyUserAccessControl: http response: %w", err) + } + + bodyresp := new(Operation) + if err := prepareJSONResponse(response, bodyresp); err != nil { + return nil, fmt.Errorf("UpdateDBAASValkeyUserAccessControl: prepare Json response: %w", err) + } + + return bodyresp, nil +} + type ResetDBAASValkeyUserPasswordRequest struct { Password DBAASUserPassword `json:"password,omitempty" validate:"omitempty,gte=8,lte=256"` } @@ -10902,17 +11000,17 @@ func (c Client) UpdateIAMRole(ctx context.Context, id UUID, req UpdateIAMRoleReq } // Update IAM Assume role Policy -func (c Client) UpdateIAMAssumeRolePolicy(ctx context.Context, id UUID, req IAMPolicy) (*Operation, error) { +func (c Client) UpdateIAMRoleAssumePolicy(ctx context.Context, id UUID, req IAMPolicy) (*Operation, error) { path := fmt.Sprintf("/iam-role/%v:assume-role-policy", id) body, err := prepareJSONBody(req) if err != nil { - return nil, fmt.Errorf("UpdateIAMAssumeRolePolicy: prepare Json body: %w", err) + return nil, fmt.Errorf("UpdateIAMRoleAssumePolicy: prepare Json body: %w", err) } request, err := http.NewRequestWithContext(ctx, "PUT", c.serverEndpoint+path, body) if err != nil { - return nil, fmt.Errorf("UpdateIAMAssumeRolePolicy: new request: %w", err) + return nil, fmt.Errorf("UpdateIAMRoleAssumePolicy: new request: %w", err) } request.Header.Add("User-Agent", c.getUserAgent()) @@ -10920,20 +11018,20 @@ func (c Client) UpdateIAMAssumeRolePolicy(ctx context.Context, id UUID, req IAMP request.Header.Add("Content-Type", "application/json") if err := c.executeRequestInterceptors(ctx, request); err != nil { - return nil, fmt.Errorf("UpdateIAMAssumeRolePolicy: execute request editors: %w", err) + return nil, fmt.Errorf("UpdateIAMRoleAssumePolicy: execute request editors: %w", err) } if err := c.signRequest(request); err != nil { - return nil, fmt.Errorf("UpdateIAMAssumeRolePolicy: sign request: %w", err) + return nil, fmt.Errorf("UpdateIAMRoleAssumePolicy: sign request: %w", err) } if c.trace { - dumpRequest(request, "update-iam-assume-role-policy") + dumpRequest(request, "update-iam-role-assume-policy") } response, err := c.httpClient.Do(request) if err != nil { - return nil, fmt.Errorf("UpdateIAMAssumeRolePolicy: http client do: %w", err) + return nil, fmt.Errorf("UpdateIAMRoleAssumePolicy: http client do: %w", err) } if c.trace { @@ -10941,12 +11039,12 @@ func (c Client) UpdateIAMAssumeRolePolicy(ctx context.Context, id UUID, req IAMP } if err := handleHTTPErrorResp(response); err != nil { - return nil, fmt.Errorf("UpdateIAMAssumeRolePolicy: http response: %w", err) + return nil, fmt.Errorf("UpdateIAMRoleAssumePolicy: http response: %w", err) } bodyresp := new(Operation) if err := prepareJSONResponse(response, bodyresp); err != nil { - return nil, fmt.Errorf("UpdateIAMAssumeRolePolicy: prepare Json response: %w", err) + return nil, fmt.Errorf("UpdateIAMRoleAssumePolicy: prepare Json response: %w", err) } return bodyresp, nil @@ -11003,6 +11101,70 @@ func (c Client) UpdateIAMRolePolicy(ctx context.Context, id UUID, req IAMPolicy) return bodyresp, nil } +type AssumeIAMRoleResponse struct { + Key string `json:"key,omitempty"` + Name string `json:"name,omitempty"` + OrgID string `json:"org-id,omitempty"` + RoleID string `json:"role-id,omitempty"` + Secret string `json:"secret,omitempty"` +} + +type AssumeIAMRoleRequest struct { + // TTL in seconds for the generated access key (cannot exceed the max TTL defined in the targeted assume role) + Ttl int64 `json:"ttl,omitempty" validate:"omitempty,gt=0"` +} + +// [BETA] Request generation of key/secret that allow caller to assume target role +func (c Client) AssumeIAMRole(ctx context.Context, targetRoleID UUID, req AssumeIAMRoleRequest) (*AssumeIAMRoleResponse, error) { + path := fmt.Sprintf("/iam-role/%v/assume", targetRoleID) + + body, err := prepareJSONBody(req) + if err != nil { + return nil, fmt.Errorf("AssumeIAMRole: prepare Json body: %w", err) + } + + request, err := http.NewRequestWithContext(ctx, "POST", c.serverEndpoint+path, body) + if err != nil { + return nil, fmt.Errorf("AssumeIAMRole: new request: %w", err) + } + + request.Header.Add("User-Agent", c.getUserAgent()) + + request.Header.Add("Content-Type", "application/json") + + if err := c.executeRequestInterceptors(ctx, request); err != nil { + return nil, fmt.Errorf("AssumeIAMRole: execute request editors: %w", err) + } + + if err := c.signRequest(request); err != nil { + return nil, fmt.Errorf("AssumeIAMRole: sign request: %w", err) + } + + if c.trace { + dumpRequest(request, "assume-iam-role") + } + + response, err := c.httpClient.Do(request) + if err != nil { + return nil, fmt.Errorf("AssumeIAMRole: http client do: %w", err) + } + + if c.trace { + dumpResponse(response) + } + + if err := handleHTTPErrorResp(response); err != nil { + return nil, fmt.Errorf("AssumeIAMRole: http response: %w", err) + } + + bodyresp := new(AssumeIAMRoleResponse) + if err := prepareJSONResponse(response, bodyresp); err != nil { + return nil, fmt.Errorf("AssumeIAMRole: prepare Json response: %w", err) + } + + return bodyresp, nil +} + // Private Network type ListInstancesResponseInstancesPrivateNetworks struct { // Private Network ID @@ -11093,6 +11255,12 @@ func ListInstancesWithIPAddress(ipAddress string) ListInstancesOpt { } } +func ListInstancesWithLabels(labels string) ListInstancesOpt { + return func(q url.Values) { + q.Add("labels", fmt.Sprint(labels)) + } +} + // List Compute instances func (c Client) ListInstances(ctx context.Context, opts ...ListInstancesOpt) (*ListInstancesResponse, error) { path := "/instance" @@ -12712,16 +12880,12 @@ func (c Client) RevertInstanceToSnapshot(ctx context.Context, instanceID UUID, r return bodyresp, nil } -type ListLoadBalancersResponse struct { - LoadBalancers []LoadBalancer `json:"load-balancers,omitempty"` -} - -// FindLoadBalancer attempts to find an LoadBalancer by nameOrID. -func (l ListLoadBalancersResponse) FindLoadBalancer(nameOrID string) (LoadBalancer, error) { - var result []LoadBalancer - for i, elem := range l.LoadBalancers { +// FindListKmsKeysResponseEntry attempts to find an ListKmsKeysResponseEntry by nameOrID. +func (l ListKmsKeysResponse) FindListKmsKeysResponseEntry(nameOrID string) (ListKmsKeysResponseEntry, error) { + var result []ListKmsKeysResponseEntry + for i, elem := range l.KmsKeys { if string(elem.Name) == nameOrID || string(elem.ID) == nameOrID { - result = append(result, l.LoadBalancers[i]) + result = append(result, l.KmsKeys[i]) } } if len(result) == 1 { @@ -12729,38 +12893,38 @@ func (l ListLoadBalancersResponse) FindLoadBalancer(nameOrID string) (LoadBalanc } if len(result) > 1 { - return LoadBalancer{}, fmt.Errorf("%q too many found in ListLoadBalancersResponse: %w", nameOrID, ErrConflict) + return ListKmsKeysResponseEntry{}, fmt.Errorf("%q too many found in ListKmsKeysResponse: %w", nameOrID, ErrConflict) } - return LoadBalancer{}, fmt.Errorf("%q not found in ListLoadBalancersResponse: %w", nameOrID, ErrNotFound) + return ListKmsKeysResponseEntry{}, fmt.Errorf("%q not found in ListKmsKeysResponse: %w", nameOrID, ErrNotFound) } -// List Load Balancers -func (c Client) ListLoadBalancers(ctx context.Context) (*ListLoadBalancersResponse, error) { - path := "/load-balancer" +// List KMS Keys details for an organization in a given zone. +func (c Client) ListKmsKeys(ctx context.Context) (*ListKmsKeysResponse, error) { + path := "/kms-key" request, err := http.NewRequestWithContext(ctx, "GET", c.serverEndpoint+path, nil) if err != nil { - return nil, fmt.Errorf("ListLoadBalancers: new request: %w", err) + return nil, fmt.Errorf("ListKmsKeys: new request: %w", err) } request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { - return nil, fmt.Errorf("ListLoadBalancers: execute request editors: %w", err) + return nil, fmt.Errorf("ListKmsKeys: execute request editors: %w", err) } if err := c.signRequest(request); err != nil { - return nil, fmt.Errorf("ListLoadBalancers: sign request: %w", err) + return nil, fmt.Errorf("ListKmsKeys: sign request: %w", err) } if c.trace { - dumpRequest(request, "list-load-balancers") + dumpRequest(request, "list-kms-keys") } response, err := c.httpClient.Do(request) if err != nil { - return nil, fmt.Errorf("ListLoadBalancers: http client do: %w", err) + return nil, fmt.Errorf("ListKmsKeys: http client do: %w", err) } if c.trace { @@ -12768,37 +12932,29 @@ func (c Client) ListLoadBalancers(ctx context.Context) (*ListLoadBalancersRespon } if err := handleHTTPErrorResp(response); err != nil { - return nil, fmt.Errorf("ListLoadBalancers: http response: %w", err) + return nil, fmt.Errorf("ListKmsKeys: http response: %w", err) } - bodyresp := new(ListLoadBalancersResponse) + bodyresp := new(ListKmsKeysResponse) if err := prepareJSONResponse(response, bodyresp); err != nil { - return nil, fmt.Errorf("ListLoadBalancers: prepare Json response: %w", err) + return nil, fmt.Errorf("ListKmsKeys: prepare Json response: %w", err) } return bodyresp, nil } -type CreateLoadBalancerRequest struct { - // Load Balancer description - Description string `json:"description,omitempty" validate:"omitempty,lte=255"` - Labels Labels `json:"labels,omitempty"` - // Load Balancer name - Name string `json:"name" validate:"required,gte=1,lte=255"` -} - -// Create a Load Balancer -func (c Client) CreateLoadBalancer(ctx context.Context, req CreateLoadBalancerRequest) (*Operation, error) { - path := "/load-balancer" +// Create a KMS Key in a given zone with a given name. +func (c Client) CreateKmsKey(ctx context.Context, req CreateKmsKeyRequest) (*CreateKmsKeyResponse, error) { + path := "/kms-key" body, err := prepareJSONBody(req) if err != nil { - return nil, fmt.Errorf("CreateLoadBalancer: prepare Json body: %w", err) + return nil, fmt.Errorf("CreateKmsKey: prepare Json body: %w", err) } request, err := http.NewRequestWithContext(ctx, "POST", c.serverEndpoint+path, body) if err != nil { - return nil, fmt.Errorf("CreateLoadBalancer: new request: %w", err) + return nil, fmt.Errorf("CreateKmsKey: new request: %w", err) } request.Header.Add("User-Agent", c.getUserAgent()) @@ -12806,20 +12962,20 @@ func (c Client) CreateLoadBalancer(ctx context.Context, req CreateLoadBalancerRe request.Header.Add("Content-Type", "application/json") if err := c.executeRequestInterceptors(ctx, request); err != nil { - return nil, fmt.Errorf("CreateLoadBalancer: execute request editors: %w", err) + return nil, fmt.Errorf("CreateKmsKey: execute request editors: %w", err) } if err := c.signRequest(request); err != nil { - return nil, fmt.Errorf("CreateLoadBalancer: sign request: %w", err) + return nil, fmt.Errorf("CreateKmsKey: sign request: %w", err) } if c.trace { - dumpRequest(request, "create-load-balancer") + dumpRequest(request, "create-kms-key") } response, err := c.httpClient.Do(request) if err != nil { - return nil, fmt.Errorf("CreateLoadBalancer: http client do: %w", err) + return nil, fmt.Errorf("CreateKmsKey: http client do: %w", err) } if c.trace { @@ -12827,43 +12983,43 @@ func (c Client) CreateLoadBalancer(ctx context.Context, req CreateLoadBalancerRe } if err := handleHTTPErrorResp(response); err != nil { - return nil, fmt.Errorf("CreateLoadBalancer: http response: %w", err) + return nil, fmt.Errorf("CreateKmsKey: http response: %w", err) } - bodyresp := new(Operation) + bodyresp := new(CreateKmsKeyResponse) if err := prepareJSONResponse(response, bodyresp); err != nil { - return nil, fmt.Errorf("CreateLoadBalancer: prepare Json response: %w", err) + return nil, fmt.Errorf("CreateKmsKey: prepare Json response: %w", err) } return bodyresp, nil } -// Delete a Load Balancer -func (c Client) DeleteLoadBalancer(ctx context.Context, id UUID) (*Operation, error) { - path := fmt.Sprintf("/load-balancer/%v", id) +// Retrieve KMS Key details. +func (c Client) GetKmsKey(ctx context.Context, id UUID) (*GetKmsKeyResponse, error) { + path := fmt.Sprintf("/kms-key/%v", id) - request, err := http.NewRequestWithContext(ctx, "DELETE", c.serverEndpoint+path, nil) + request, err := http.NewRequestWithContext(ctx, "GET", c.serverEndpoint+path, nil) if err != nil { - return nil, fmt.Errorf("DeleteLoadBalancer: new request: %w", err) + return nil, fmt.Errorf("GetKmsKey: new request: %w", err) } request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { - return nil, fmt.Errorf("DeleteLoadBalancer: execute request editors: %w", err) + return nil, fmt.Errorf("GetKmsKey: execute request editors: %w", err) } if err := c.signRequest(request); err != nil { - return nil, fmt.Errorf("DeleteLoadBalancer: sign request: %w", err) + return nil, fmt.Errorf("GetKmsKey: sign request: %w", err) } if c.trace { - dumpRequest(request, "delete-load-balancer") + dumpRequest(request, "get-kms-key") } response, err := c.httpClient.Do(request) if err != nil { - return nil, fmt.Errorf("DeleteLoadBalancer: http client do: %w", err) + return nil, fmt.Errorf("GetKmsKey: http client do: %w", err) } if c.trace { @@ -12871,43 +13027,43 @@ func (c Client) DeleteLoadBalancer(ctx context.Context, id UUID) (*Operation, er } if err := handleHTTPErrorResp(response); err != nil { - return nil, fmt.Errorf("DeleteLoadBalancer: http response: %w", err) + return nil, fmt.Errorf("GetKmsKey: http response: %w", err) } - bodyresp := new(Operation) + bodyresp := new(GetKmsKeyResponse) if err := prepareJSONResponse(response, bodyresp); err != nil { - return nil, fmt.Errorf("DeleteLoadBalancer: prepare Json response: %w", err) + return nil, fmt.Errorf("GetKmsKey: prepare Json response: %w", err) } return bodyresp, nil } -// Retrieve Load Balancer details -func (c Client) GetLoadBalancer(ctx context.Context, id UUID) (*LoadBalancer, error) { - path := fmt.Sprintf("/load-balancer/%v", id) +// Cancel the scheduled deletion of a KMS Key. +func (c Client) CancelKmsKeyDeletion(ctx context.Context, id UUID) (*SuccessResponse, error) { + path := fmt.Sprintf("/kms-key/%v/cancel-deletion", id) - request, err := http.NewRequestWithContext(ctx, "GET", c.serverEndpoint+path, nil) + request, err := http.NewRequestWithContext(ctx, "POST", c.serverEndpoint+path, nil) if err != nil { - return nil, fmt.Errorf("GetLoadBalancer: new request: %w", err) + return nil, fmt.Errorf("CancelKmsKeyDeletion: new request: %w", err) } request.Header.Add("User-Agent", c.getUserAgent()) if err := c.executeRequestInterceptors(ctx, request); err != nil { - return nil, fmt.Errorf("GetLoadBalancer: execute request editors: %w", err) + return nil, fmt.Errorf("CancelKmsKeyDeletion: execute request editors: %w", err) } if err := c.signRequest(request); err != nil { - return nil, fmt.Errorf("GetLoadBalancer: sign request: %w", err) + return nil, fmt.Errorf("CancelKmsKeyDeletion: sign request: %w", err) } if c.trace { - dumpRequest(request, "get-load-balancer") + dumpRequest(request, "cancel-kms-key-deletion") } response, err := c.httpClient.Do(request) if err != nil { - return nil, fmt.Errorf("GetLoadBalancer: http client do: %w", err) + return nil, fmt.Errorf("CancelKmsKeyDeletion: http client do: %w", err) } if c.trace { @@ -12915,37 +13071,29 @@ func (c Client) GetLoadBalancer(ctx context.Context, id UUID) (*LoadBalancer, er } if err := handleHTTPErrorResp(response); err != nil { - return nil, fmt.Errorf("GetLoadBalancer: http response: %w", err) + return nil, fmt.Errorf("CancelKmsKeyDeletion: http response: %w", err) } - bodyresp := new(LoadBalancer) + bodyresp := new(SuccessResponse) if err := prepareJSONResponse(response, bodyresp); err != nil { - return nil, fmt.Errorf("GetLoadBalancer: prepare Json response: %w", err) + return nil, fmt.Errorf("CancelKmsKeyDeletion: prepare Json response: %w", err) } return bodyresp, nil } -type UpdateLoadBalancerRequest struct { - // Load Balancer description - Description string `json:"description,omitempty" validate:"omitempty,lte=255"` - Labels Labels `json:"labels,omitempty"` - // Load Balancer name - Name string `json:"name,omitempty" validate:"omitempty,gte=1,lte=255"` -} - -// Update a Load Balancer -func (c Client) UpdateLoadBalancer(ctx context.Context, id UUID, req UpdateLoadBalancerRequest) (*Operation, error) { - path := fmt.Sprintf("/load-balancer/%v", id) +// Decrypt a ciphertext. +func (c Client) Decrypt(ctx context.Context, id UUID, req DecryptRequest) (*DecryptResponse, error) { + path := fmt.Sprintf("/kms-key/%v/decrypt", id) body, err := prepareJSONBody(req) if err != nil { - return nil, fmt.Errorf("UpdateLoadBalancer: prepare Json body: %w", err) + return nil, fmt.Errorf("Decrypt: prepare Json body: %w", err) } - request, err := http.NewRequestWithContext(ctx, "PUT", c.serverEndpoint+path, body) + request, err := http.NewRequestWithContext(ctx, "POST", c.serverEndpoint+path, body) if err != nil { - return nil, fmt.Errorf("UpdateLoadBalancer: new request: %w", err) + return nil, fmt.Errorf("Decrypt: new request: %w", err) } request.Header.Add("User-Agent", c.getUserAgent()) @@ -12953,20 +13101,20 @@ func (c Client) UpdateLoadBalancer(ctx context.Context, id UUID, req UpdateLoadB request.Header.Add("Content-Type", "application/json") if err := c.executeRequestInterceptors(ctx, request); err != nil { - return nil, fmt.Errorf("UpdateLoadBalancer: execute request editors: %w", err) + return nil, fmt.Errorf("Decrypt: execute request editors: %w", err) } if err := c.signRequest(request); err != nil { - return nil, fmt.Errorf("UpdateLoadBalancer: sign request: %w", err) + return nil, fmt.Errorf("Decrypt: sign request: %w", err) } if c.trace { - dumpRequest(request, "update-load-balancer") + dumpRequest(request, "decrypt") } response, err := c.httpClient.Do(request) if err != nil { - return nil, fmt.Errorf("UpdateLoadBalancer: http client do: %w", err) + return nil, fmt.Errorf("Decrypt: http client do: %w", err) } if c.trace { @@ -12974,54 +13122,860 @@ func (c Client) UpdateLoadBalancer(ctx context.Context, id UUID, req UpdateLoadB } if err := handleHTTPErrorResp(response); err != nil { - return nil, fmt.Errorf("UpdateLoadBalancer: http response: %w", err) + return nil, fmt.Errorf("Decrypt: http response: %w", err) } - bodyresp := new(Operation) + bodyresp := new(DecryptResponse) if err := prepareJSONResponse(response, bodyresp); err != nil { - return nil, fmt.Errorf("UpdateLoadBalancer: prepare Json response: %w", err) + return nil, fmt.Errorf("Decrypt: prepare Json response: %w", err) } return bodyresp, nil } -type AddServiceToLoadBalancerRequestProtocol string +// Disable a KMS Key +func (c Client) DisableKmsKey(ctx context.Context, id UUID) (*SuccessResponse, error) { + path := fmt.Sprintf("/kms-key/%v/disable", id) -const ( - AddServiceToLoadBalancerRequestProtocolTCP AddServiceToLoadBalancerRequestProtocol = "tcp" - AddServiceToLoadBalancerRequestProtocolUDP AddServiceToLoadBalancerRequestProtocol = "udp" -) + request, err := http.NewRequestWithContext(ctx, "POST", c.serverEndpoint+path, nil) + if err != nil { + return nil, fmt.Errorf("DisableKmsKey: new request: %w", err) + } -type AddServiceToLoadBalancerRequestStrategy string + request.Header.Add("User-Agent", c.getUserAgent()) -const ( - AddServiceToLoadBalancerRequestStrategyRoundRobin AddServiceToLoadBalancerRequestStrategy = "round-robin" - AddServiceToLoadBalancerRequestStrategyMaglevHash AddServiceToLoadBalancerRequestStrategy = "maglev-hash" - AddServiceToLoadBalancerRequestStrategySourceHash AddServiceToLoadBalancerRequestStrategy = "source-hash" -) + if err := c.executeRequestInterceptors(ctx, request); err != nil { + return nil, fmt.Errorf("DisableKmsKey: execute request editors: %w", err) + } -type AddServiceToLoadBalancerRequest struct { - // Load Balancer Service description - Description string `json:"description,omitempty" validate:"omitempty,lte=255"` - // Load Balancer Service healthcheck - Healthcheck *LoadBalancerServiceHealthcheck `json:"healthcheck" validate:"required"` - // Instance Pool - InstancePool *InstancePool `json:"instance-pool" validate:"required"` - // Load Balancer Service name - Name string `json:"name" validate:"required,gte=1,lte=255"` - // Port exposed on the Load Balancer's public IP - Port int64 `json:"port" validate:"required,gte=1,lte=65535"` - // Network traffic protocol - Protocol AddServiceToLoadBalancerRequestProtocol `json:"protocol" validate:"required"` - // Load balancing strategy - Strategy AddServiceToLoadBalancerRequestStrategy `json:"strategy" validate:"required"` - // Port on which the network traffic will be forwarded to on the receiving instance - TargetPort int64 `json:"target-port" validate:"required,gte=1,lte=65535"` -} + if err := c.signRequest(request); err != nil { + return nil, fmt.Errorf("DisableKmsKey: sign request: %w", err) + } -// Add a Load Balancer Service -func (c Client) AddServiceToLoadBalancer(ctx context.Context, id UUID, req AddServiceToLoadBalancerRequest) (*Operation, error) { - path := fmt.Sprintf("/load-balancer/%v/service", id) + if c.trace { + dumpRequest(request, "disable-kms-key") + } + + response, err := c.httpClient.Do(request) + if err != nil { + return nil, fmt.Errorf("DisableKmsKey: http client do: %w", err) + } + + if c.trace { + dumpResponse(response) + } + + if err := handleHTTPErrorResp(response); err != nil { + return nil, fmt.Errorf("DisableKmsKey: http response: %w", err) + } + + bodyresp := new(SuccessResponse) + if err := prepareJSONResponse(response, bodyresp); err != nil { + return nil, fmt.Errorf("DisableKmsKey: prepare Json response: %w", err) + } + + return bodyresp, nil +} + +// Disable the periodic rotation of a KMS Key. +func (c Client) DisableKmsKeyRotation(ctx context.Context, id UUID, req DisableKmsKeyRotationRequest) (*DisableKmsKeyRotationResponse, error) { + path := fmt.Sprintf("/kms-key/%v/disable-key-rotation", id) + + body, err := prepareJSONBody(req) + if err != nil { + return nil, fmt.Errorf("DisableKmsKeyRotation: prepare Json body: %w", err) + } + + request, err := http.NewRequestWithContext(ctx, "POST", c.serverEndpoint+path, body) + if err != nil { + return nil, fmt.Errorf("DisableKmsKeyRotation: new request: %w", err) + } + + request.Header.Add("User-Agent", c.getUserAgent()) + + request.Header.Add("Content-Type", "application/json") + + if err := c.executeRequestInterceptors(ctx, request); err != nil { + return nil, fmt.Errorf("DisableKmsKeyRotation: execute request editors: %w", err) + } + + if err := c.signRequest(request); err != nil { + return nil, fmt.Errorf("DisableKmsKeyRotation: sign request: %w", err) + } + + if c.trace { + dumpRequest(request, "disable-kms-key-rotation") + } + + response, err := c.httpClient.Do(request) + if err != nil { + return nil, fmt.Errorf("DisableKmsKeyRotation: http client do: %w", err) + } + + if c.trace { + dumpResponse(response) + } + + if err := handleHTTPErrorResp(response); err != nil { + return nil, fmt.Errorf("DisableKmsKeyRotation: http response: %w", err) + } + + bodyresp := new(DisableKmsKeyRotationResponse) + if err := prepareJSONResponse(response, bodyresp); err != nil { + return nil, fmt.Errorf("DisableKmsKeyRotation: prepare Json response: %w", err) + } + + return bodyresp, nil +} + +// Enable a KMS Key" +func (c Client) EnableKmsKey(ctx context.Context, id UUID) (*SuccessResponse, error) { + path := fmt.Sprintf("/kms-key/%v/enable", id) + + request, err := http.NewRequestWithContext(ctx, "POST", c.serverEndpoint+path, nil) + if err != nil { + return nil, fmt.Errorf("EnableKmsKey: new request: %w", err) + } + + request.Header.Add("User-Agent", c.getUserAgent()) + + if err := c.executeRequestInterceptors(ctx, request); err != nil { + return nil, fmt.Errorf("EnableKmsKey: execute request editors: %w", err) + } + + if err := c.signRequest(request); err != nil { + return nil, fmt.Errorf("EnableKmsKey: sign request: %w", err) + } + + if c.trace { + dumpRequest(request, "enable-kms-key") + } + + response, err := c.httpClient.Do(request) + if err != nil { + return nil, fmt.Errorf("EnableKmsKey: http client do: %w", err) + } + + if c.trace { + dumpResponse(response) + } + + if err := handleHTTPErrorResp(response); err != nil { + return nil, fmt.Errorf("EnableKmsKey: http response: %w", err) + } + + bodyresp := new(SuccessResponse) + if err := prepareJSONResponse(response, bodyresp); err != nil { + return nil, fmt.Errorf("EnableKmsKey: prepare Json response: %w", err) + } + + return bodyresp, nil +} + +// Enable the periodic rotation of a KMS Key. +func (c Client) EnableKmsKeyRotation(ctx context.Context, id UUID, req EnableKmsKeyRotationRequest) (*EnableKmsKeyRotationResponse, error) { + path := fmt.Sprintf("/kms-key/%v/enable-key-rotation", id) + + body, err := prepareJSONBody(req) + if err != nil { + return nil, fmt.Errorf("EnableKmsKeyRotation: prepare Json body: %w", err) + } + + request, err := http.NewRequestWithContext(ctx, "POST", c.serverEndpoint+path, body) + if err != nil { + return nil, fmt.Errorf("EnableKmsKeyRotation: new request: %w", err) + } + + request.Header.Add("User-Agent", c.getUserAgent()) + + request.Header.Add("Content-Type", "application/json") + + if err := c.executeRequestInterceptors(ctx, request); err != nil { + return nil, fmt.Errorf("EnableKmsKeyRotation: execute request editors: %w", err) + } + + if err := c.signRequest(request); err != nil { + return nil, fmt.Errorf("EnableKmsKeyRotation: sign request: %w", err) + } + + if c.trace { + dumpRequest(request, "enable-kms-key-rotation") + } + + response, err := c.httpClient.Do(request) + if err != nil { + return nil, fmt.Errorf("EnableKmsKeyRotation: http client do: %w", err) + } + + if c.trace { + dumpResponse(response) + } + + if err := handleHTTPErrorResp(response); err != nil { + return nil, fmt.Errorf("EnableKmsKeyRotation: http response: %w", err) + } + + bodyresp := new(EnableKmsKeyRotationResponse) + if err := prepareJSONResponse(response, bodyresp); err != nil { + return nil, fmt.Errorf("EnableKmsKeyRotation: prepare Json response: %w", err) + } + + return bodyresp, nil +} + +// Encrypt a plaintext. +func (c Client) Encrypt(ctx context.Context, id UUID, req EncryptRequest) (*EncryptResponse, error) { + path := fmt.Sprintf("/kms-key/%v/encrypt", id) + + body, err := prepareJSONBody(req) + if err != nil { + return nil, fmt.Errorf("Encrypt: prepare Json body: %w", err) + } + + request, err := http.NewRequestWithContext(ctx, "POST", c.serverEndpoint+path, body) + if err != nil { + return nil, fmt.Errorf("Encrypt: new request: %w", err) + } + + request.Header.Add("User-Agent", c.getUserAgent()) + + request.Header.Add("Content-Type", "application/json") + + if err := c.executeRequestInterceptors(ctx, request); err != nil { + return nil, fmt.Errorf("Encrypt: execute request editors: %w", err) + } + + if err := c.signRequest(request); err != nil { + return nil, fmt.Errorf("Encrypt: sign request: %w", err) + } + + if c.trace { + dumpRequest(request, "encrypt") + } + + response, err := c.httpClient.Do(request) + if err != nil { + return nil, fmt.Errorf("Encrypt: http client do: %w", err) + } + + if c.trace { + dumpResponse(response) + } + + if err := handleHTTPErrorResp(response); err != nil { + return nil, fmt.Errorf("Encrypt: http response: %w", err) + } + + bodyresp := new(EncryptResponse) + if err := prepareJSONResponse(response, bodyresp); err != nil { + return nil, fmt.Errorf("Encrypt: prepare Json response: %w", err) + } + + return bodyresp, nil +} + +// Generate a Data Encryption Key from a given KMS Key. +func (c Client) GenerateDataKey(ctx context.Context, id UUID, req GenerateDataKeyRequest) (*GenerateDataKeyResponse, error) { + path := fmt.Sprintf("/kms-key/%v/generate-data-key", id) + + body, err := prepareJSONBody(req) + if err != nil { + return nil, fmt.Errorf("GenerateDataKey: prepare Json body: %w", err) + } + + request, err := http.NewRequestWithContext(ctx, "POST", c.serverEndpoint+path, body) + if err != nil { + return nil, fmt.Errorf("GenerateDataKey: new request: %w", err) + } + + request.Header.Add("User-Agent", c.getUserAgent()) + + request.Header.Add("Content-Type", "application/json") + + if err := c.executeRequestInterceptors(ctx, request); err != nil { + return nil, fmt.Errorf("GenerateDataKey: execute request editors: %w", err) + } + + if err := c.signRequest(request); err != nil { + return nil, fmt.Errorf("GenerateDataKey: sign request: %w", err) + } + + if c.trace { + dumpRequest(request, "generate-data-key") + } + + response, err := c.httpClient.Do(request) + if err != nil { + return nil, fmt.Errorf("GenerateDataKey: http client do: %w", err) + } + + if c.trace { + dumpResponse(response) + } + + if err := handleHTTPErrorResp(response); err != nil { + return nil, fmt.Errorf("GenerateDataKey: http response: %w", err) + } + + bodyresp := new(GenerateDataKeyResponse) + if err := prepareJSONResponse(response, bodyresp); err != nil { + return nil, fmt.Errorf("GenerateDataKey: prepare Json response: %w", err) + } + + return bodyresp, nil +} + +// List all the key material versions of a KMS Key. +func (c Client) ListKmsKeyRotations(ctx context.Context, id UUID) (*ListKmsKeyRotationsResponse, error) { + path := fmt.Sprintf("/kms-key/%v/list-key-rotations", id) + + request, err := http.NewRequestWithContext(ctx, "GET", c.serverEndpoint+path, nil) + if err != nil { + return nil, fmt.Errorf("ListKmsKeyRotations: new request: %w", err) + } + + request.Header.Add("User-Agent", c.getUserAgent()) + + if err := c.executeRequestInterceptors(ctx, request); err != nil { + return nil, fmt.Errorf("ListKmsKeyRotations: execute request editors: %w", err) + } + + if err := c.signRequest(request); err != nil { + return nil, fmt.Errorf("ListKmsKeyRotations: sign request: %w", err) + } + + if c.trace { + dumpRequest(request, "list-kms-key-rotations") + } + + response, err := c.httpClient.Do(request) + if err != nil { + return nil, fmt.Errorf("ListKmsKeyRotations: http client do: %w", err) + } + + if c.trace { + dumpResponse(response) + } + + if err := handleHTTPErrorResp(response); err != nil { + return nil, fmt.Errorf("ListKmsKeyRotations: http response: %w", err) + } + + bodyresp := new(ListKmsKeyRotationsResponse) + if err := prepareJSONResponse(response, bodyresp); err != nil { + return nil, fmt.Errorf("ListKmsKeyRotations: prepare Json response: %w", err) + } + + return bodyresp, nil +} + +// Decrypts an existing ciphertext using its original key material and re-encrypts the underlying plaintext using a specified KMS key or the latest key material of the same KMS Key. +func (c Client) ReEncrypt(ctx context.Context, id UUID, req ReEncryptRequest) (*ReEncryptResponse, error) { + path := fmt.Sprintf("/kms-key/%v/re-encrypt", id) + + body, err := prepareJSONBody(req) + if err != nil { + return nil, fmt.Errorf("ReEncrypt: prepare Json body: %w", err) + } + + request, err := http.NewRequestWithContext(ctx, "POST", c.serverEndpoint+path, body) + if err != nil { + return nil, fmt.Errorf("ReEncrypt: new request: %w", err) + } + + request.Header.Add("User-Agent", c.getUserAgent()) + + request.Header.Add("Content-Type", "application/json") + + if err := c.executeRequestInterceptors(ctx, request); err != nil { + return nil, fmt.Errorf("ReEncrypt: execute request editors: %w", err) + } + + if err := c.signRequest(request); err != nil { + return nil, fmt.Errorf("ReEncrypt: sign request: %w", err) + } + + if c.trace { + dumpRequest(request, "re-encrypt") + } + + response, err := c.httpClient.Do(request) + if err != nil { + return nil, fmt.Errorf("ReEncrypt: http client do: %w", err) + } + + if c.trace { + dumpResponse(response) + } + + if err := handleHTTPErrorResp(response); err != nil { + return nil, fmt.Errorf("ReEncrypt: http response: %w", err) + } + + bodyresp := new(ReEncryptResponse) + if err := prepareJSONResponse(response, bodyresp); err != nil { + return nil, fmt.Errorf("ReEncrypt: prepare Json response: %w", err) + } + + return bodyresp, nil +} + +// Replicate a KMS key to a target zone. +func (c Client) ReplicateKmsKey(ctx context.Context, id UUID, req ReplicateKmsKeyRequest) (*Operation, error) { + path := fmt.Sprintf("/kms-key/%v/replicate", id) + + body, err := prepareJSONBody(req) + if err != nil { + return nil, fmt.Errorf("ReplicateKmsKey: prepare Json body: %w", err) + } + + request, err := http.NewRequestWithContext(ctx, "POST", c.serverEndpoint+path, body) + if err != nil { + return nil, fmt.Errorf("ReplicateKmsKey: new request: %w", err) + } + + request.Header.Add("User-Agent", c.getUserAgent()) + + request.Header.Add("Content-Type", "application/json") + + if err := c.executeRequestInterceptors(ctx, request); err != nil { + return nil, fmt.Errorf("ReplicateKmsKey: execute request editors: %w", err) + } + + if err := c.signRequest(request); err != nil { + return nil, fmt.Errorf("ReplicateKmsKey: sign request: %w", err) + } + + if c.trace { + dumpRequest(request, "replicate-kms-key") + } + + response, err := c.httpClient.Do(request) + if err != nil { + return nil, fmt.Errorf("ReplicateKmsKey: http client do: %w", err) + } + + if c.trace { + dumpResponse(response) + } + + if err := handleHTTPErrorResp(response); err != nil { + return nil, fmt.Errorf("ReplicateKmsKey: http response: %w", err) + } + + bodyresp := new(Operation) + if err := prepareJSONResponse(response, bodyresp); err != nil { + return nil, fmt.Errorf("ReplicateKmsKey: prepare Json response: %w", err) + } + + return bodyresp, nil +} + +// Perform a manual rotation of the key material for a symmetric key. +func (c Client) RotateKmsKey(ctx context.Context, id UUID) (*RotateKmsKeyResponse, error) { + path := fmt.Sprintf("/kms-key/%v/rotate", id) + + request, err := http.NewRequestWithContext(ctx, "POST", c.serverEndpoint+path, nil) + if err != nil { + return nil, fmt.Errorf("RotateKmsKey: new request: %w", err) + } + + request.Header.Add("User-Agent", c.getUserAgent()) + + if err := c.executeRequestInterceptors(ctx, request); err != nil { + return nil, fmt.Errorf("RotateKmsKey: execute request editors: %w", err) + } + + if err := c.signRequest(request); err != nil { + return nil, fmt.Errorf("RotateKmsKey: sign request: %w", err) + } + + if c.trace { + dumpRequest(request, "rotate-kms-key") + } + + response, err := c.httpClient.Do(request) + if err != nil { + return nil, fmt.Errorf("RotateKmsKey: http client do: %w", err) + } + + if c.trace { + dumpResponse(response) + } + + if err := handleHTTPErrorResp(response); err != nil { + return nil, fmt.Errorf("RotateKmsKey: http response: %w", err) + } + + bodyresp := new(RotateKmsKeyResponse) + if err := prepareJSONResponse(response, bodyresp); err != nil { + return nil, fmt.Errorf("RotateKmsKey: prepare Json response: %w", err) + } + + return bodyresp, nil +} + +// Schedule a KMS key for deletion after a delay. +func (c Client) ScheduleKmsKeyDeletion(ctx context.Context, id UUID, req ScheduleKmsKeyDeletionRequest) (*SuccessResponse, error) { + path := fmt.Sprintf("/kms-key/%v/schedule-deletion", id) + + body, err := prepareJSONBody(req) + if err != nil { + return nil, fmt.Errorf("ScheduleKmsKeyDeletion: prepare Json body: %w", err) + } + + request, err := http.NewRequestWithContext(ctx, "POST", c.serverEndpoint+path, body) + if err != nil { + return nil, fmt.Errorf("ScheduleKmsKeyDeletion: new request: %w", err) + } + + request.Header.Add("User-Agent", c.getUserAgent()) + + request.Header.Add("Content-Type", "application/json") + + if err := c.executeRequestInterceptors(ctx, request); err != nil { + return nil, fmt.Errorf("ScheduleKmsKeyDeletion: execute request editors: %w", err) + } + + if err := c.signRequest(request); err != nil { + return nil, fmt.Errorf("ScheduleKmsKeyDeletion: sign request: %w", err) + } + + if c.trace { + dumpRequest(request, "schedule-kms-key-deletion") + } + + response, err := c.httpClient.Do(request) + if err != nil { + return nil, fmt.Errorf("ScheduleKmsKeyDeletion: http client do: %w", err) + } + + if c.trace { + dumpResponse(response) + } + + if err := handleHTTPErrorResp(response); err != nil { + return nil, fmt.Errorf("ScheduleKmsKeyDeletion: http response: %w", err) + } + + bodyresp := new(SuccessResponse) + if err := prepareJSONResponse(response, bodyresp); err != nil { + return nil, fmt.Errorf("ScheduleKmsKeyDeletion: prepare Json response: %w", err) + } + + return bodyresp, nil +} + +type ListLoadBalancersResponse struct { + LoadBalancers []LoadBalancer `json:"load-balancers,omitempty"` +} + +// FindLoadBalancer attempts to find an LoadBalancer by nameOrID. +func (l ListLoadBalancersResponse) FindLoadBalancer(nameOrID string) (LoadBalancer, error) { + var result []LoadBalancer + for i, elem := range l.LoadBalancers { + if string(elem.Name) == nameOrID || string(elem.ID) == nameOrID { + result = append(result, l.LoadBalancers[i]) + } + } + if len(result) == 1 { + return result[0], nil + } + + if len(result) > 1 { + return LoadBalancer{}, fmt.Errorf("%q too many found in ListLoadBalancersResponse: %w", nameOrID, ErrConflict) + } + + return LoadBalancer{}, fmt.Errorf("%q not found in ListLoadBalancersResponse: %w", nameOrID, ErrNotFound) +} + +// List Load Balancers +func (c Client) ListLoadBalancers(ctx context.Context) (*ListLoadBalancersResponse, error) { + path := "/load-balancer" + + request, err := http.NewRequestWithContext(ctx, "GET", c.serverEndpoint+path, nil) + if err != nil { + return nil, fmt.Errorf("ListLoadBalancers: new request: %w", err) + } + + request.Header.Add("User-Agent", c.getUserAgent()) + + if err := c.executeRequestInterceptors(ctx, request); err != nil { + return nil, fmt.Errorf("ListLoadBalancers: execute request editors: %w", err) + } + + if err := c.signRequest(request); err != nil { + return nil, fmt.Errorf("ListLoadBalancers: sign request: %w", err) + } + + if c.trace { + dumpRequest(request, "list-load-balancers") + } + + response, err := c.httpClient.Do(request) + if err != nil { + return nil, fmt.Errorf("ListLoadBalancers: http client do: %w", err) + } + + if c.trace { + dumpResponse(response) + } + + if err := handleHTTPErrorResp(response); err != nil { + return nil, fmt.Errorf("ListLoadBalancers: http response: %w", err) + } + + bodyresp := new(ListLoadBalancersResponse) + if err := prepareJSONResponse(response, bodyresp); err != nil { + return nil, fmt.Errorf("ListLoadBalancers: prepare Json response: %w", err) + } + + return bodyresp, nil +} + +type CreateLoadBalancerRequest struct { + // Load Balancer description + Description string `json:"description,omitempty" validate:"omitempty,lte=255"` + Labels Labels `json:"labels,omitempty"` + // Load Balancer name + Name string `json:"name" validate:"required,gte=1,lte=255"` +} + +// Create a Load Balancer +func (c Client) CreateLoadBalancer(ctx context.Context, req CreateLoadBalancerRequest) (*Operation, error) { + path := "/load-balancer" + + body, err := prepareJSONBody(req) + if err != nil { + return nil, fmt.Errorf("CreateLoadBalancer: prepare Json body: %w", err) + } + + request, err := http.NewRequestWithContext(ctx, "POST", c.serverEndpoint+path, body) + if err != nil { + return nil, fmt.Errorf("CreateLoadBalancer: new request: %w", err) + } + + request.Header.Add("User-Agent", c.getUserAgent()) + + request.Header.Add("Content-Type", "application/json") + + if err := c.executeRequestInterceptors(ctx, request); err != nil { + return nil, fmt.Errorf("CreateLoadBalancer: execute request editors: %w", err) + } + + if err := c.signRequest(request); err != nil { + return nil, fmt.Errorf("CreateLoadBalancer: sign request: %w", err) + } + + if c.trace { + dumpRequest(request, "create-load-balancer") + } + + response, err := c.httpClient.Do(request) + if err != nil { + return nil, fmt.Errorf("CreateLoadBalancer: http client do: %w", err) + } + + if c.trace { + dumpResponse(response) + } + + if err := handleHTTPErrorResp(response); err != nil { + return nil, fmt.Errorf("CreateLoadBalancer: http response: %w", err) + } + + bodyresp := new(Operation) + if err := prepareJSONResponse(response, bodyresp); err != nil { + return nil, fmt.Errorf("CreateLoadBalancer: prepare Json response: %w", err) + } + + return bodyresp, nil +} + +// Delete a Load Balancer +func (c Client) DeleteLoadBalancer(ctx context.Context, id UUID) (*Operation, error) { + path := fmt.Sprintf("/load-balancer/%v", id) + + request, err := http.NewRequestWithContext(ctx, "DELETE", c.serverEndpoint+path, nil) + if err != nil { + return nil, fmt.Errorf("DeleteLoadBalancer: new request: %w", err) + } + + request.Header.Add("User-Agent", c.getUserAgent()) + + if err := c.executeRequestInterceptors(ctx, request); err != nil { + return nil, fmt.Errorf("DeleteLoadBalancer: execute request editors: %w", err) + } + + if err := c.signRequest(request); err != nil { + return nil, fmt.Errorf("DeleteLoadBalancer: sign request: %w", err) + } + + if c.trace { + dumpRequest(request, "delete-load-balancer") + } + + response, err := c.httpClient.Do(request) + if err != nil { + return nil, fmt.Errorf("DeleteLoadBalancer: http client do: %w", err) + } + + if c.trace { + dumpResponse(response) + } + + if err := handleHTTPErrorResp(response); err != nil { + return nil, fmt.Errorf("DeleteLoadBalancer: http response: %w", err) + } + + bodyresp := new(Operation) + if err := prepareJSONResponse(response, bodyresp); err != nil { + return nil, fmt.Errorf("DeleteLoadBalancer: prepare Json response: %w", err) + } + + return bodyresp, nil +} + +// Retrieve Load Balancer details +func (c Client) GetLoadBalancer(ctx context.Context, id UUID) (*LoadBalancer, error) { + path := fmt.Sprintf("/load-balancer/%v", id) + + request, err := http.NewRequestWithContext(ctx, "GET", c.serverEndpoint+path, nil) + if err != nil { + return nil, fmt.Errorf("GetLoadBalancer: new request: %w", err) + } + + request.Header.Add("User-Agent", c.getUserAgent()) + + if err := c.executeRequestInterceptors(ctx, request); err != nil { + return nil, fmt.Errorf("GetLoadBalancer: execute request editors: %w", err) + } + + if err := c.signRequest(request); err != nil { + return nil, fmt.Errorf("GetLoadBalancer: sign request: %w", err) + } + + if c.trace { + dumpRequest(request, "get-load-balancer") + } + + response, err := c.httpClient.Do(request) + if err != nil { + return nil, fmt.Errorf("GetLoadBalancer: http client do: %w", err) + } + + if c.trace { + dumpResponse(response) + } + + if err := handleHTTPErrorResp(response); err != nil { + return nil, fmt.Errorf("GetLoadBalancer: http response: %w", err) + } + + bodyresp := new(LoadBalancer) + if err := prepareJSONResponse(response, bodyresp); err != nil { + return nil, fmt.Errorf("GetLoadBalancer: prepare Json response: %w", err) + } + + return bodyresp, nil +} + +type UpdateLoadBalancerRequest struct { + // Load Balancer description + Description string `json:"description,omitempty" validate:"omitempty,lte=255"` + Labels Labels `json:"labels,omitempty"` + // Load Balancer name + Name string `json:"name,omitempty" validate:"omitempty,gte=1,lte=255"` +} + +// Update a Load Balancer +func (c Client) UpdateLoadBalancer(ctx context.Context, id UUID, req UpdateLoadBalancerRequest) (*Operation, error) { + path := fmt.Sprintf("/load-balancer/%v", id) + + body, err := prepareJSONBody(req) + if err != nil { + return nil, fmt.Errorf("UpdateLoadBalancer: prepare Json body: %w", err) + } + + request, err := http.NewRequestWithContext(ctx, "PUT", c.serverEndpoint+path, body) + if err != nil { + return nil, fmt.Errorf("UpdateLoadBalancer: new request: %w", err) + } + + request.Header.Add("User-Agent", c.getUserAgent()) + + request.Header.Add("Content-Type", "application/json") + + if err := c.executeRequestInterceptors(ctx, request); err != nil { + return nil, fmt.Errorf("UpdateLoadBalancer: execute request editors: %w", err) + } + + if err := c.signRequest(request); err != nil { + return nil, fmt.Errorf("UpdateLoadBalancer: sign request: %w", err) + } + + if c.trace { + dumpRequest(request, "update-load-balancer") + } + + response, err := c.httpClient.Do(request) + if err != nil { + return nil, fmt.Errorf("UpdateLoadBalancer: http client do: %w", err) + } + + if c.trace { + dumpResponse(response) + } + + if err := handleHTTPErrorResp(response); err != nil { + return nil, fmt.Errorf("UpdateLoadBalancer: http response: %w", err) + } + + bodyresp := new(Operation) + if err := prepareJSONResponse(response, bodyresp); err != nil { + return nil, fmt.Errorf("UpdateLoadBalancer: prepare Json response: %w", err) + } + + return bodyresp, nil +} + +type AddServiceToLoadBalancerRequestProtocol string + +const ( + AddServiceToLoadBalancerRequestProtocolTCP AddServiceToLoadBalancerRequestProtocol = "tcp" + AddServiceToLoadBalancerRequestProtocolUDP AddServiceToLoadBalancerRequestProtocol = "udp" +) + +type AddServiceToLoadBalancerRequestStrategy string + +const ( + AddServiceToLoadBalancerRequestStrategyRoundRobin AddServiceToLoadBalancerRequestStrategy = "round-robin" + AddServiceToLoadBalancerRequestStrategyMaglevHash AddServiceToLoadBalancerRequestStrategy = "maglev-hash" + AddServiceToLoadBalancerRequestStrategySourceHash AddServiceToLoadBalancerRequestStrategy = "source-hash" +) + +type AddServiceToLoadBalancerRequest struct { + // Load Balancer Service description + Description string `json:"description,omitempty" validate:"omitempty,lte=255"` + // Load Balancer Service healthcheck + Healthcheck *LoadBalancerServiceHealthcheck `json:"healthcheck" validate:"required"` + // Instance Pool + InstancePool *InstancePool `json:"instance-pool" validate:"required"` + // Load Balancer Service name + Name string `json:"name" validate:"required,gte=1,lte=255"` + // Port exposed on the Load Balancer's public IP + Port int64 `json:"port" validate:"required,gte=1,lte=65535"` + // Network traffic protocol + Protocol AddServiceToLoadBalancerRequestProtocol `json:"protocol" validate:"required"` + // Load balancing strategy + Strategy AddServiceToLoadBalancerRequestStrategy `json:"strategy" validate:"required"` + // Port on which the network traffic will be forwarded to on the receiving instance + TargetPort int64 `json:"target-port" validate:"required,gte=1,lte=65535"` +} + +// Add a Load Balancer Service +func (c Client) AddServiceToLoadBalancer(ctx context.Context, id UUID, req AddServiceToLoadBalancerRequest) (*Operation, error) { + path := fmt.Sprintf("/load-balancer/%v/service", id) body, err := prepareJSONBody(req) if err != nil { @@ -15716,8 +16670,10 @@ type UpdateSKSNodepoolRequest struct { // Prefix to apply to managed instances names (default: pool), lowercase only InstancePrefix string `json:"instance-prefix,omitempty" validate:"omitempty,gte=1,lte=30"` // Instance type reference - InstanceType *InstanceType `json:"instance-type,omitempty"` - Labels SKSNodepoolLabels `json:"labels,omitempty"` + InstanceType *InstanceType `json:"instance-type,omitempty"` + // Kubelet image GC options + KubeletImageGC *KubeletImageGC `json:"kubelet-image-gc,omitempty"` + Labels SKSNodepoolLabels `json:"labels,omitempty"` // Nodepool name, lowercase only Name string `json:"name,omitempty" validate:"omitempty,gte=1,lte=255"` // Nodepool Private Networks diff --git a/vendor/github.com/exoscale/egoscale/v3/schemas.go b/vendor/github.com/exoscale/egoscale/v3/schemas.go index 2b6f323ad..04e5d8310 100644 --- a/vendor/github.com/exoscale/egoscale/v3/schemas.go +++ b/vendor/github.com/exoscale/egoscale/v3/schemas.go @@ -188,6 +188,48 @@ type CreateDeploymentRequest struct { Replicas int64 `json:"replicas" validate:"required,gte=1"` } +type CreateKmsKeyRequestUsage string + +const ( + CreateKmsKeyRequestUsageEncryptDecrypt CreateKmsKeyRequestUsage = "encrypt-decrypt" +) + +type CreateKmsKeyRequest struct { + Description string `json:"description" validate:"required"` + MultiZone *bool `json:"multi-zone" validate:"required"` + Name string `json:"name" validate:"required"` + Usage CreateKmsKeyRequestUsage `json:"usage" validate:"required"` +} + +type CreateKmsKeyResponseSource string + +const ( + CreateKmsKeyResponseSourceExoscaleKms CreateKmsKeyResponseSource = "exoscale-kms" +) + +type CreateKmsKeyResponseStatus string + +const ( + CreateKmsKeyResponseStatusEnabled CreateKmsKeyResponseStatus = "enabled" + CreateKmsKeyResponseStatusDisabled CreateKmsKeyResponseStatus = "disabled" + CreateKmsKeyResponseStatusPendingDeletion CreateKmsKeyResponseStatus = "pending-deletion" +) + +type CreateKmsKeyResponse struct { + CreatedAT time.Time `json:"created-at" validate:"required"` + Description string `json:"description" validate:"required"` + ID UUID `json:"id" validate:"required"` + MultiZone *bool `json:"multi-zone" validate:"required"` + Name string `json:"name" validate:"required"` + OriginZone string `json:"origin-zone" validate:"required"` + Policy string `json:"policy" validate:"required"` + Revision *RevisionStamp `json:"revision" validate:"required"` + Source CreateKmsKeyResponseSource `json:"source" validate:"required"` + Status CreateKmsKeyResponseStatus `json:"status" validate:"required"` + StatusSince time.Time `json:"status-since" validate:"required"` + Usage string `json:"usage" validate:"required"` +} + // AI model type CreateModelRequest struct { // Huggingface Token @@ -1857,6 +1899,36 @@ type DBAASUserValkeySecrets struct { Username string `json:"username,omitempty"` } +type DBAASValkeyUser struct { + AccessControl *DBAASValkeyUserAccessControl `json:"access-control,omitempty"` + Type string `json:"type,omitempty"` + Username DBAASUserUsername `json:"username" validate:"required,gte=1,lte=64"` +} + +type DBAASValkeyUserAccessControl struct { + // Use +@ to allow and -@ to disallow. Separate entries with a single space. Example: +@all -@dangerous. + Categories []string `json:"categories,omitempty"` + // Patterns use standard glob syntax and must be separated by a single space. Example: ~* &events. + Channels []string `json:"channels,omitempty"` + // Use + to allow and - to disallow. You can also use @. Separate entries with a single space. Example: +@all -flushall. + Commands []string `json:"commands,omitempty"` + // Patterns use standard glob syntax and must be separated by a single space. Example: cache:* session:*. + Keys []string `json:"keys,omitempty"` +} + +type DBAASValkeyUsers struct { + Users []DBAASValkeyUser `json:"users,omitempty"` +} + +type DecryptRequest struct { + Ciphertext byte `json:"ciphertext" validate:"required"` + EncryptionContext *byte `json:"encryption-context,omitempty"` +} + +type DecryptResponse struct { + Plaintext byte `json:"plaintext" validate:"required"` +} + // Model is in use: deletion forbidden type DeleteModelConflictResponse struct { // Deployments using models @@ -1888,6 +1960,14 @@ type DeployTargetRef struct { ID UUID `json:"id,omitempty"` } +type DisableKmsKeyRotationRequest struct { + ID UUID `json:"id" validate:"required"` +} + +type DisableKmsKeyRotationResponse struct { + Rotation *KeyRotationConfig `json:"rotation" validate:"required"` +} + // DNS domain type DNSDomain struct { // DNS domain creation date @@ -2003,6 +2083,24 @@ type ElasticIPRef struct { ID UUID `json:"id,omitempty"` } +type EnableKmsKeyRotationRequest struct { + ID UUID `json:"id" validate:"required"` + RotationPeriod int `json:"rotation-period,omitempty" validate:"omitempty,gte=90,lte=2560"` +} + +type EnableKmsKeyRotationResponse struct { + Rotation *KeyRotationConfig `json:"rotation" validate:"required"` +} + +type EncryptRequest struct { + EncryptionContext *byte `json:"encryption-context,omitempty"` + Plaintext byte `json:"plaintext" validate:"required"` +} + +type EncryptResponse struct { + Ciphertext byte `json:"ciphertext" validate:"required"` +} + type EnumComponentRoute string const ( @@ -2186,10 +2284,21 @@ type EnvProduct struct { Value string `json:"value,omitempty"` } -// Error +type ErrorResponseErrors struct { + Detail string `json:"detail,omitempty"` + Location string `json:"location,omitempty"` + Path string `json:"path,omitempty"` + Pointer string `json:"pointer,omitempty"` +} + +// RFC 9457 Problem Details error response type ErrorResponse struct { - // Error description - Error string `json:"error,omitempty"` + Detail string `json:"detail" validate:"required"` + Errors []ErrorResponseErrors `json:"errors,omitempty"` + Instance string `json:"instance,omitempty"` + Status int `json:"status" validate:"required,gte=100,lte=599"` + Title string `json:"title" validate:"required"` + Type string `json:"type" validate:"required"` } // A notable Mutation Event which happened on the infrastructure @@ -2226,6 +2335,23 @@ type Event struct { Zone string `json:"zone,omitempty"` } +type GenerateDataKeyRequestKeySpec string + +const ( + GenerateDataKeyRequestKeySpecAES256 GenerateDataKeyRequestKeySpec = "AES-256" +) + +type GenerateDataKeyRequest struct { + BytesCount int `json:"bytes-count,omitempty" validate:"omitempty,gte=1,lte=1024"` + EncryptionContext *byte `json:"encryption-context,omitempty"` + KeySpec GenerateDataKeyRequestKeySpec `json:"key-spec,omitempty"` +} + +type GenerateDataKeyResponse struct { + Ciphertext byte `json:"ciphertext" validate:"required"` + Plaintext byte `json:"plaintext" validate:"required"` +} + // GPU usage for all organizations type GetConfederatioUsageResponse struct { OrganizationsUsages map[string]OrganizationUsage `json:"organizations_usages" validate:"required"` @@ -2292,6 +2418,39 @@ type GetInferenceEngineHelpResponse struct { Parameters []InferenceEngineParameterEntry `json:"parameters,omitempty"` } +type GetKmsKeyResponseSource string + +const ( + GetKmsKeyResponseSourceExoscaleKms GetKmsKeyResponseSource = "exoscale-kms" +) + +type GetKmsKeyResponseStatus string + +const ( + GetKmsKeyResponseStatusEnabled GetKmsKeyResponseStatus = "enabled" + GetKmsKeyResponseStatusDisabled GetKmsKeyResponseStatus = "disabled" + GetKmsKeyResponseStatusPendingDeletion GetKmsKeyResponseStatus = "pending-deletion" +) + +type GetKmsKeyResponse struct { + CreatedAT time.Time `json:"created-at" validate:"required"` + Description string `json:"description" validate:"required"` + ID UUID `json:"id" validate:"required"` + Material *KeyMaterial `json:"material" validate:"required"` + MultiZone *bool `json:"multi-zone" validate:"required"` + Name string `json:"name" validate:"required"` + OriginZone string `json:"origin-zone" validate:"required"` + Policy string `json:"policy" validate:"required"` + Replicas []string `json:"replicas" validate:"required"` + ReplicasStatus []ReplicaState `json:"replicas-status,omitempty"` + Revision *RevisionStamp `json:"revision" validate:"required"` + Rotation *KeyRotationConfig `json:"rotation" validate:"required"` + Source GetKmsKeyResponseSource `json:"source" validate:"required"` + Status GetKmsKeyResponseStatus `json:"status" validate:"required"` + StatusSince time.Time `json:"status-since" validate:"required"` + Usage string `json:"usage" validate:"required"` +} + type GetModelResponseState string const ( @@ -2432,6 +2591,8 @@ type InferenceEngineVersion string const ( InferenceEngineVersion0120 InferenceEngineVersion = "0.12.0" InferenceEngineVersion0151 InferenceEngineVersion = "0.15.1" + InferenceEngineVersion0160 InferenceEngineVersion = "0.16.0" + InferenceEngineVersion0170 InferenceEngineVersion = "0.17.0" ) // Private Network @@ -3820,6 +3981,19 @@ type JSONSchemaValkey struct { Timeout int `json:"timeout,omitempty" validate:"omitempty,gte=0,lte=3.1536e+07"` } +type KeyMaterial struct { + Automatic *bool `json:"automatic" validate:"required"` + CreatedAT time.Time `json:"created-at" validate:"required"` + Version int `json:"version" validate:"required"` +} + +type KeyRotationConfig struct { + Automatic *bool `json:"automatic" validate:"required"` + ManualCount int `json:"manual-count" validate:"required"` + NextAT time.Time `json:"next-at" validate:"required"` + RotationPeriod int `json:"rotation-period" validate:"required"` +} + // Kubelet image GC options type KubeletImageGC struct { HighThreshold int64 `json:"high-threshold,omitempty" validate:"omitempty,gte=0"` @@ -3873,6 +4047,51 @@ type ListDeploymentsResponseEntry struct { UpdatedAT time.Time `json:"updated-at,omitempty"` } +type ListKmsKeyRotationsResponse struct { + Rotations []ListKmsKeyRotationsResponseEntry `json:"rotations" validate:"required"` +} + +type ListKmsKeyRotationsResponseEntry struct { + Automatic *bool `json:"automatic" validate:"required"` + RotatedAT time.Time `json:"rotated-at" validate:"required"` + Version int `json:"version" validate:"required"` +} + +type ListKmsKeysResponse struct { + KmsKeys []ListKmsKeysResponseEntry `json:"kms-keys" validate:"required"` +} + +type ListKmsKeysResponseEntrySource string + +const ( + ListKmsKeysResponseEntrySourceExoscaleKms ListKmsKeysResponseEntrySource = "exoscale-kms" +) + +type ListKmsKeysResponseEntryStatus string + +const ( + ListKmsKeysResponseEntryStatusEnabled ListKmsKeysResponseEntryStatus = "enabled" + ListKmsKeysResponseEntryStatusDisabled ListKmsKeysResponseEntryStatus = "disabled" + ListKmsKeysResponseEntryStatusPendingDeletion ListKmsKeysResponseEntryStatus = "pending-deletion" +) + +type ListKmsKeysResponseEntry struct { + CreatedAT time.Time `json:"created-at" validate:"required"` + Description string `json:"description" validate:"required"` + ID UUID `json:"id" validate:"required"` + Material *KeyMaterial `json:"material" validate:"required"` + MultiZone *bool `json:"multi-zone" validate:"required"` + Name string `json:"name" validate:"required"` + OriginZone string `json:"origin-zone" validate:"required"` + Replicas []string `json:"replicas" validate:"required"` + Revision *RevisionStamp `json:"revision" validate:"required"` + Rotation *KeyRotationConfig `json:"rotation" validate:"required"` + Source ListKmsKeysResponseEntrySource `json:"source" validate:"required"` + Status ListKmsKeysResponseEntryStatus `json:"status" validate:"required"` + StatusSince time.Time `json:"status-since" validate:"required"` + Usage string `json:"usage" validate:"required"` +} + // AI model list type ListModelsResponse struct { Models []ListModelsResponseEntry `json:"models,omitempty"` @@ -4111,6 +4330,12 @@ type Operation struct { State OperationState `json:"state,omitempty"` } +type OperationResourceRef struct { + Command string `json:"command" validate:"required"` + ID UUID `json:"id" validate:"required"` + Link string `json:"link,omitempty"` +} + // Organization type Organization struct { // Organization address @@ -4204,6 +4429,46 @@ type Quota struct { Usage int64 `json:"usage,omitempty"` } +type ReEncryptRequestDestination struct { + // Optional encryption context appended to the AAD. + EncryptionContext *byte `json:"encryption-context,omitempty"` + // The ID of the target key. + Key UUID `json:"key" validate:"required"` +} + +type ReEncryptRequestSource struct { + Ciphertext byte `json:"ciphertext" validate:"required"` + // Optional encryption context appended to the AAD. + EncryptionContext *byte `json:"encryption-context,omitempty"` + // The ID of the source key. + Key UUID `json:"key" validate:"required"` +} + +type ReEncryptRequest struct { + Destination *ReEncryptRequestDestination `json:"destination" validate:"required"` + Source *ReEncryptRequestSource `json:"source" validate:"required"` +} + +type ReEncryptResponse struct { + Ciphertext byte `json:"ciphertext" validate:"required"` +} + +type ReplicaFailure struct { + AttemptedWatermark int `json:"attempted-watermark" validate:"required"` + Error string `json:"error" validate:"required"` + FailedAT time.Time `json:"failed-at" validate:"required"` +} + +type ReplicaState struct { + LastAppliedWatermark int `json:"last-applied-watermark" validate:"required"` + LastFailure *ReplicaFailure `json:"last-failure,omitempty"` + Zone string `json:"zone" validate:"required"` +} + +type ReplicateKmsKeyRequest struct { + Zone string `json:"zone" validate:"required"` +} + // Resource type Resource struct { // Resource ID @@ -4221,12 +4486,26 @@ type ReverseDNSRecord struct { DomainName DomainName `json:"domain-name,omitempty" validate:"omitempty,gte=1,lte=253"` } +type RevisionStamp struct { + AT time.Time `json:"at" validate:"required"` + Seq int `json:"seq" validate:"required,gte=0"` +} + +type RotateKmsKeyResponse struct { + Rotation *KeyRotationConfig `json:"rotation" validate:"required"` +} + // Scale AI deployment type ScaleDeploymentRequest struct { // Number of replicas (>=0) Replicas int64 `json:"replicas" validate:"required,gte=0"` } +type ScheduleKmsKeyDeletionRequest struct { + // Number of days to wait until deletion is final. + DelayDays int `json:"delay-days,omitempty" validate:"omitempty,gte=7,lte=30"` +} + // Security Group type SecurityGroup struct { // Security Group description @@ -4610,6 +4889,16 @@ type SSHKeyRef struct { Name string `json:"name,omitempty" validate:"omitempty,gte=1,lte=255"` } +type SuccessResponseStatus string + +const ( + SuccessResponseStatusSuccess SuccessResponseStatus = "success" +) + +type SuccessResponse struct { + Status SuccessResponseStatus `json:"status" validate:"required"` +} + type TemplateBootMode string const ( diff --git a/vendor/modules.txt b/vendor/modules.txt index d025ba06c..b1f8cc314 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -154,8 +154,8 @@ github.com/dlclark/regexp2/syntax # github.com/dustin/go-humanize v1.0.1 ## explicit; go 1.16 github.com/dustin/go-humanize -# github.com/exoscale/egoscale/v3 v3.1.34 -## explicit; go 1.23.8 +# github.com/exoscale/egoscale/v3 v3.1.35-0.20260331081148-08a321a16e52 +## explicit; go 1.26 github.com/exoscale/egoscale/v3 github.com/exoscale/egoscale/v3/credentials # github.com/exoscale/openapi-cli-generator v1.2.0