From ebcd0550fa23836d6c82e136d63c4b0a1544ba50 Mon Sep 17 00:00:00 2001 From: simisoft-exo Date: Wed, 21 Aug 2024 13:31:05 +0100 Subject: [PATCH] DBaaS exo api update --- cmd/internal/x/x.gen.go | 5484 +++++++++++++++++++++++++++------------ 1 file changed, 3871 insertions(+), 1613 deletions(-) diff --git a/cmd/internal/x/x.gen.go b/cmd/internal/x/x.gen.go index dd0ac815..2a387a6b 100644 --- a/cmd/internal/x/x.gen.go +++ b/cmd/internal/x/x.gen.go @@ -1026,9 +1026,9 @@ func XGetDbaasCaCertificate(params *viper.Viper) (*gentleman.Response, map[strin 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" +// XDeleteDbaasExternalEndpointDatadog delete-dbaas-external-endpoint-datadog +func XDeleteDbaasExternalEndpointDatadog(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-dbaas-external-endpoint-datadog" if xSubcommand { handlerPath = "x " + handlerPath } @@ -1038,14 +1038,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-datadog/{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) @@ -1072,9 +1068,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" +// XGetDbaasExternalEndpointDatadog get-dbaas-external-endpoint-datadog +func XGetDbaasExternalEndpointDatadog(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dbaas-external-endpoint-datadog" if xSubcommand { handlerPath = "x " + handlerPath } @@ -1084,10 +1080,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-datadog/{id}" + url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Delete().URL(url) + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -1114,9 +1110,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" +// XUpdateDbaasExternalEndpointDatadog update-dbaas-external-endpoint-datadog +func XUpdateDbaasExternalEndpointDatadog(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-dbaas-external-endpoint-datadog" if xSubcommand { handlerPath = "x " + handlerPath } @@ -1126,10 +1122,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-datadog/{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) @@ -1156,9 +1156,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" +// 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 } @@ -1168,10 +1168,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-datadog/{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) @@ -1202,9 +1202,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" +// XDeleteDbaasExternalEndpointElasticsearch delete-dbaas-external-endpoint-elasticsearch +func XDeleteDbaasExternalEndpointElasticsearch(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-dbaas-external-endpoint-elasticsearch" if xSubcommand { handlerPath = "x " + handlerPath } @@ -1214,14 +1214,10 @@ 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-elasticsearch/{id}" + url = strings.Replace(url, "{id}", paramId, 1) - if body != "" { - req = req.AddHeader("Content-Type", "").BodyString(body) - } + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -1248,9 +1244,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" +// XGetDbaasExternalEndpointElasticsearch get-dbaas-external-endpoint-elasticsearch +func XGetDbaasExternalEndpointElasticsearch(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dbaas-external-endpoint-elasticsearch" if xSubcommand { handlerPath = "x " + handlerPath } @@ -1260,15 +1256,10 @@ 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) - - req := cli.Client.Put().URL(url) + url := server + "/dbaas-external-endpoint-elasticsearch/{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) @@ -1295,9 +1286,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" +// XUpdateDbaasExternalEndpointElasticsearch update-dbaas-external-endpoint-elasticsearch +func XUpdateDbaasExternalEndpointElasticsearch(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-dbaas-external-endpoint-elasticsearch" if xSubcommand { handlerPath = "x " + handlerPath } @@ -1307,11 +1298,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-elasticsearch/{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) @@ -1338,9 +1332,9 @@ func XRevealDbaasGrafanaUserPassword(paramServiceName string, paramUsername stri return resp, decoded, nil } -// XCreateDbaasIntegration Create a new DBaaS integration between two services -func XCreateDbaasIntegration(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-dbaas-integration" +// 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 } @@ -1350,7 +1344,8 @@ func XCreateDbaasIntegration(params *viper.Viper, body string) (*gentleman.Respo server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-integration" + url := server + "/dbaas-external-endpoint-elasticsearch/{name}" + url = strings.Replace(url, "{name}", paramName, 1) req := cli.Client.Post().URL(url) @@ -1383,9 +1378,9 @@ func XCreateDbaasIntegration(params *viper.Viper, body string) (*gentleman.Respo return resp, decoded, nil } -// XListDbaasIntegrationSettings Get 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" +// XDeleteDbaasExternalEndpointOpensearch delete-dbaas-external-endpoint-opensearch +func XDeleteDbaasExternalEndpointOpensearch(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-dbaas-external-endpoint-opensearch" if xSubcommand { handlerPath = "x " + handlerPath } @@ -1395,12 +1390,10 @@ 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-endpoint-opensearch/{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) @@ -1427,9 +1420,9 @@ func XListDbaasIntegrationSettings(paramIntegrationType string, paramSourceType return resp, decoded, nil } -// XListDbaasIntegrationTypes Get DBaaS integration types -func XListDbaasIntegrationTypes(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "list-dbaas-integration-types" +// XGetDbaasExternalEndpointOpensearch get-dbaas-external-endpoint-opensearch +func XGetDbaasExternalEndpointOpensearch(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dbaas-external-endpoint-opensearch" if xSubcommand { handlerPath = "x " + handlerPath } @@ -1439,7 +1432,8 @@ 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-endpoint-opensearch/{id}" + url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Get().URL(url) @@ -1468,9 +1462,9 @@ func XListDbaasIntegrationTypes(params *viper.Viper) (*gentleman.Response, map[s return resp, decoded, nil } -// XDeleteDbaasIntegration Delete a DBaaS Integration -func XDeleteDbaasIntegration(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-dbaas-integration" +// XUpdateDbaasExternalEndpointOpensearch update-dbaas-external-endpoint-opensearch +func XUpdateDbaasExternalEndpointOpensearch(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-dbaas-external-endpoint-opensearch" if xSubcommand { handlerPath = "x " + handlerPath } @@ -1480,10 +1474,14 @@ func XDeleteDbaasIntegration(paramId string, params *viper.Viper) (*gentleman.Re server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-integration/{id}" + url := server + "/dbaas-external-endpoint-opensearch/{id}" 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) @@ -1510,9 +1508,9 @@ func XDeleteDbaasIntegration(paramId string, params *viper.Viper) (*gentleman.Re return resp, decoded, nil } -// XGetDbaasIntegration Get a DBaaS Integration -func XGetDbaasIntegration(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-dbaas-integration" +// 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 } @@ -1522,10 +1520,14 @@ 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-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) @@ -1552,9 +1554,9 @@ func XGetDbaasIntegration(paramId string, params *viper.Viper) (*gentleman.Respo return resp, decoded, nil } -// XUpdateDbaasIntegration Update a existing DBaaS integration -func XUpdateDbaasIntegration(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "update-dbaas-integration" +// XDeleteDbaasExternalEndpointPrometheus delete-dbaas-external-endpoint-prometheus +func XDeleteDbaasExternalEndpointPrometheus(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-dbaas-external-endpoint-prometheus" if xSubcommand { handlerPath = "x " + handlerPath } @@ -1564,14 +1566,10 @@ func XUpdateDbaasIntegration(paramId string, params *viper.Viper, body string) ( server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-integration/{id}" + url := server + "/dbaas-external-endpoint-prometheus/{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) @@ -1598,9 +1596,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" +// XGetDbaasExternalEndpointPrometheus get-dbaas-external-endpoint-prometheus +func XGetDbaasExternalEndpointPrometheus(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dbaas-external-endpoint-prometheus" if xSubcommand { handlerPath = "x " + handlerPath } @@ -1610,14 +1608,10 @@ func XCreateDbaasServiceKafka(paramName string, params *viper.Viper, body string server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-kafka/{name}" - url = strings.Replace(url, "{name}", paramName, 1) - - req := cli.Client.Post().URL(url) + url := server + "/dbaas-external-endpoint-prometheus/{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) @@ -1644,9 +1638,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" +// XUpdateDbaasExternalEndpointPrometheus update-dbaas-external-endpoint-prometheus +func XUpdateDbaasExternalEndpointPrometheus(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-dbaas-external-endpoint-prometheus" if xSubcommand { handlerPath = "x " + handlerPath } @@ -1656,10 +1650,14 @@ func XDeleteDbaasServiceKafka(paramName string, params *viper.Viper) (*gentleman server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-kafka/{name}" - url = strings.Replace(url, "{name}", paramName, 1) + url := server + "/dbaas-external-endpoint-prometheus/{id}" + 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) @@ -1686,9 +1684,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" +// 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 } @@ -1698,10 +1696,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-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) @@ -1728,9 +1730,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" +// XDeleteDbaasExternalEndpointRsyslog delete-dbaas-external-endpoint-rsyslog +func XDeleteDbaasExternalEndpointRsyslog(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-dbaas-external-endpoint-rsyslog" if xSubcommand { handlerPath = "x " + handlerPath } @@ -1740,14 +1742,10 @@ func XUpdateDbaasServiceKafka(paramName string, params *viper.Viper, body string server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-kafka/{name}" - url = strings.Replace(url, "{name}", paramName, 1) - - req := cli.Client.Put().URL(url) + url := server + "/dbaas-external-endpoint-rsyslog/{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) @@ -1774,9 +1772,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" +// XGetDbaasExternalEndpointRsyslog get-dbaas-external-endpoint-rsyslog +func XGetDbaasExternalEndpointRsyslog(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dbaas-external-endpoint-rsyslog" if xSubcommand { handlerPath = "x " + handlerPath } @@ -1786,8 +1784,8 @@ 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-external-endpoint-rsyslog/{id}" + url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Get().URL(url) @@ -1816,9 +1814,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" +// XUpdateDbaasExternalEndpointRsyslog update-dbaas-external-endpoint-rsyslog +func XUpdateDbaasExternalEndpointRsyslog(paramId string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-dbaas-external-endpoint-rsyslog" if xSubcommand { handlerPath = "x " + handlerPath } @@ -1828,13 +1826,13 @@ 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) + url := server + "/dbaas-external-endpoint-rsyslog/{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) @@ -1862,9 +1860,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" +// 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 } @@ -1874,7 +1872,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 := server + "/dbaas-external-endpoint-rsyslog/{name}" url = strings.Replace(url, "{name}", paramName, 1) req := cli.Client.Post().URL(url) @@ -1908,9 +1906,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" +// 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 } @@ -1920,11 +1918,9 @@ 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-external-endpoint-types" - req := cli.Client.Delete().URL(url) + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -1951,9 +1947,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" +// 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 } @@ -1963,10 +1959,10 @@ 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) + url := server + "/dbaas-external-endpoint/{source-service-name}/attach" + url = strings.Replace(url, "{source-service-name}", paramSourceServiceName, 1) - req := cli.Client.Post().URL(url) + req := cli.Client.Put().URL(url) if body != "" { req = req.AddHeader("Content-Type", "application/json").BodyString(body) @@ -1997,9 +1993,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" +// 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 } @@ -2009,11 +2005,14 @@ 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-external-endpoint/{source-service-name}/detach" + url = strings.Replace(url, "{source-service-name}", paramSourceServiceName, 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) @@ -2040,9 +2039,9 @@ func XDeleteDbaasKafkaTopicAclConfig(paramName string, paramAclId string, params 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" +// 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 } @@ -2052,14 +2051,9 @@ 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) - - 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) @@ -2086,9 +2080,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" +// XGetDbaasExternalIntegration get-dbaas-external-integration +func XGetDbaasExternalIntegration(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dbaas-external-integration" if xSubcommand { handlerPath = "x " + handlerPath } @@ -2098,11 +2092,10 @@ 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-external-integration/{id}" + url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Delete().URL(url) + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -2129,9 +2122,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" +// 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 } @@ -2141,15 +2134,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 := server + "/dbaas-external-integrations/{service-name}" url = strings.Replace(url, "{service-name}", paramServiceName, 1) - url = strings.Replace(url, "{username}", paramUsername, 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) @@ -2176,9 +2164,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" +// 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 } @@ -2188,11 +2176,14 @@ 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-grafana/{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) @@ -2219,9 +2210,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" +// 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 } @@ -2231,10 +2222,10 @@ func XGetDbaasMigrationStatus(paramName string, params *viper.Viper) (*gentleman server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-migration-status/{name}" + url := server + "/dbaas-grafana/{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) @@ -2261,9 +2252,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" +// 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 } @@ -2273,14 +2264,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-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.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -2307,9 +2294,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" +// 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 } @@ -2319,10 +2306,14 @@ func XDeleteDbaasServiceMysql(paramName string, params *viper.Viper) (*gentleman server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-mysql/{name}" + url := server + "/dbaas-grafana/{name}" 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", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -2349,9 +2340,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" +// 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 } @@ -2361,10 +2352,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-grafana/{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) @@ -2391,9 +2386,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" +// 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 } @@ -2403,8 +2398,9 @@ func XUpdateDbaasServiceMysql(paramName string, params *viper.Viper, body string server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-mysql/{name}" - 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.Put().URL(url) @@ -2437,9 +2433,9 @@ func XUpdateDbaasServiceMysql(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" +// 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 } @@ -2449,14 +2445,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 = 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) @@ -2483,9 +2476,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" +// XCreateDbaasIntegration Create a new DBaaS integration between two services +func XCreateDbaasIntegration(params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-dbaas-integration" if xSubcommand { handlerPath = "x " + handlerPath } @@ -2495,13 +2488,12 @@ 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) + url := server + "/dbaas-integration" 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) @@ -2529,9 +2521,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" +// XListDbaasIntegrationSettings Get 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 } @@ -2541,14 +2533,12 @@ func XCreateDbaasMysqlDatabase(paramServiceName string, params *viper.Viper, bod server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-mysql/{service-name}/database" - url = strings.Replace(url, "{service-name}", paramServiceName, 1) - - req := cli.Client.Post().URL(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) - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -2575,9 +2565,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" +// XListDbaasIntegrationTypes Get DBaaS integration types +func XListDbaasIntegrationTypes(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-dbaas-integration-types" if xSubcommand { handlerPath = "x " + handlerPath } @@ -2587,11 +2577,9 @@ func XDeleteDbaasMysqlDatabase(paramServiceName string, paramDatabaseName string server = xServers()[viper.GetInt("server-index")]["url"] } - 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) + url := server + "/dbaas-integration-types" - req := cli.Client.Delete().URL(url) + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -2618,9 +2606,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" +// XDeleteDbaasIntegration Delete a DBaaS Integration +func XDeleteDbaasIntegration(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-dbaas-integration" if xSubcommand { handlerPath = "x " + handlerPath } @@ -2630,14 +2618,10 @@ func XCreateDbaasMysqlUser(paramServiceName string, params *viper.Viper, body st server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-mysql/{service-name}/user" - url = strings.Replace(url, "{service-name}", paramServiceName, 1) - - req := cli.Client.Post().URL(url) + url := server + "/dbaas-integration/{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) @@ -2664,9 +2648,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" +// XGetDbaasIntegration Get a DBaaS Integration +func XGetDbaasIntegration(paramId string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dbaas-integration" if xSubcommand { handlerPath = "x " + handlerPath } @@ -2676,11 +2660,10 @@ func XDeleteDbaasMysqlUser(paramServiceName string, paramUsername string, params 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) + url := server + "/dbaas-integration/{id}" + url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Delete().URL(url) + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -2707,9 +2690,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" +// XUpdateDbaasIntegration Update a existing 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 } @@ -2719,9 +2702,8 @@ 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) + url := server + "/dbaas-integration/{id}" + url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Put().URL(url) @@ -2754,9 +2736,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" +// 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 } @@ -2766,11 +2748,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-kafka/{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) @@ -2797,9 +2782,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" +// 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 } @@ -2809,14 +2794,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-kafka/{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) @@ -2843,9 +2824,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" +// 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 } @@ -2855,10 +2836,10 @@ func XDeleteDbaasServiceOpensearch(paramName string, params *viper.Viper) (*gent server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-opensearch/{name}" + url := server + "/dbaas-kafka/{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) @@ -2885,9 +2866,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" +// 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 } @@ -2897,10 +2878,14 @@ func XGetDbaasServiceOpensearch(paramName string, params *viper.Viper) (*gentlem server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-opensearch/{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) @@ -2927,9 +2912,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" +// 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 } @@ -2939,14 +2924,10 @@ func XUpdateDbaasServiceOpensearch(paramName string, params *viper.Viper, body s server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-opensearch/{name}" + url := server + "/dbaas-kafka/{name}/acl-config" 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 := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -2973,9 +2954,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" +// 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 } @@ -2985,10 +2966,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-kafka/{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) @@ -3015,9 +3000,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" +// 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 } @@ -3027,10 +3012,10 @@ 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-kafka/{name}/schema-registry/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", "application/json").BodyString(body) @@ -3061,9 +3046,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" +// 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 } @@ -3073,14 +3058,11 @@ func XStartDbaasOpensearchMaintenance(paramName string, params *viper.Viper, bod server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-opensearch/{name}/maintenance/start" + 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", "").BodyString(body) - } + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -3107,9 +3089,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" +// 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 } @@ -3119,8 +3101,8 @@ func XCreateDbaasOpensearchUser(paramServiceName string, params *viper.Viper, bo server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-opensearch/{service-name}/user" - url = strings.Replace(url, "{service-name}", paramServiceName, 1) + url := server + "/dbaas-kafka/{name}/topic/acl-config" + url = strings.Replace(url, "{name}", paramName, 1) req := cli.Client.Post().URL(url) @@ -3153,9 +3135,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" +// 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 } @@ -3165,9 +3147,9 @@ func XDeleteDbaasOpensearchUser(paramServiceName string, paramUsername string, p server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-opensearch/{service-name}/user/{username}" - url = strings.Replace(url, "{service-name}", paramServiceName, 1) - url = strings.Replace(url, "{username}", paramUsername, 1) + 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.Delete().URL(url) @@ -3196,9 +3178,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" +// 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 } @@ -3208,15 +3190,10 @@ 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-kafka/{service-name}/connect/password/reveal" url = strings.Replace(url, "{service-name}", paramServiceName, 1) - url = strings.Replace(url, "{username}", paramUsername, 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) @@ -3243,9 +3220,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" +// 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 } @@ -3255,11 +3232,14 @@ 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-kafka/{service-name}/user" url = strings.Replace(url, "{service-name}", paramServiceName, 1) - url = strings.Replace(url, "{username}", paramUsername, 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) @@ -3286,9 +3266,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" +// 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 } @@ -3298,14 +3278,11 @@ func XCreateDbaasServicePg(paramName string, params *viper.Viper, body string) ( server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-postgres/{name}" - url = strings.Replace(url, "{name}", paramName, 1) - - req := cli.Client.Post().URL(url) + url := server + "/dbaas-kafka/{service-name}/user/{username}" + url = strings.Replace(url, "{service-name}", paramServiceName, 1) + 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) @@ -3332,9 +3309,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" +// 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 } @@ -3344,10 +3321,15 @@ func XDeleteDbaasServicePg(paramName string, params *viper.Viper) (*gentleman.Re server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-postgres/{name}" - url = strings.Replace(url, "{name}", paramName, 1) + 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.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) @@ -3374,9 +3356,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" +// 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 } @@ -3386,8 +3368,9 @@ func XGetDbaasServicePg(paramName string, params *viper.Viper) (*gentleman.Respo server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-postgres/{name}" - url = strings.Replace(url, "{name}", paramName, 1) + 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.Get().URL(url) @@ -3416,9 +3399,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" +// 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 } @@ -3428,14 +3411,10 @@ func XUpdateDbaasServicePg(paramName string, params *viper.Viper, body string) ( server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-postgres/{name}" + url := server + "/dbaas-migration-status/{name}" 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 := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -3462,9 +3441,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" +// 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 } @@ -3474,13 +3453,13 @@ 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-mysql/{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", "").BodyString(body) + req = req.AddHeader("Content-Type", "application/json").BodyString(body) } cli.HandleBefore(handlerPath, params, req) @@ -3508,9 +3487,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" +// 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 } @@ -3520,14 +3499,10 @@ 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-mysql/{name}" url = strings.Replace(url, "{name}", paramName, 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) @@ -3554,9 +3529,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" +// 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 } @@ -3566,14 +3541,10 @@ 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) - - req := cli.Client.Post().URL(url) + url := server + "/dbaas-mysql/{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) @@ -3600,9 +3571,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" +// 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 } @@ -3612,11 +3583,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 = strings.Replace(url, "{service-name}", paramServiceName, 1) - url = strings.Replace(url, "{connection-pool-name}", paramConnectionPoolName, 1) + url := server + "/dbaas-mysql/{name}" + 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", "application/json").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -3643,9 +3617,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" +// 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 } @@ -3655,14 +3629,13 @@ func XUpdateDbaasPgConnectionPool(paramServiceName string, paramConnectionPoolNa server = xServers()[viper.GetInt("server-index")]["url"] } - 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) + 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) @@ -3690,9 +3663,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" +// 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 } @@ -3702,13 +3675,13 @@ func XCreateDbaasPgDatabase(paramServiceName string, params *viper.Viper, body s server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-postgres/{service-name}/database" - url = strings.Replace(url, "{service-name}", paramServiceName, 1) + url := server + "/dbaas-mysql/{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) @@ -3736,9 +3709,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" +// 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 } @@ -3748,11 +3721,14 @@ func XDeleteDbaasPgDatabase(paramServiceName string, paramDatabaseName string, p server = xServers()[viper.GetInt("server-index")]["url"] } - 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) + url := server + "/dbaas-mysql/{name}/migration/stop" + 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", "").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -3779,9 +3755,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" +// 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 } @@ -3791,7 +3767,7 @@ func XCreateDbaasPostgresUser(paramServiceName string, params *viper.Viper, body server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-postgres/{service-name}/user" + url := server + "/dbaas-mysql/{service-name}/database" url = strings.Replace(url, "{service-name}", paramServiceName, 1) req := cli.Client.Post().URL(url) @@ -3825,9 +3801,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" +// 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 } @@ -3837,9 +3813,9 @@ func XDeleteDbaasPostgresUser(paramServiceName string, paramUsername string, par server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-postgres/{service-name}/user/{username}" + url := server + "/dbaas-mysql/{service-name}/database/{database-name}" url = strings.Replace(url, "{service-name}", paramServiceName, 1) - url = strings.Replace(url, "{username}", paramUsername, 1) + url = strings.Replace(url, "{database-name}", paramDatabaseName, 1) req := cli.Client.Delete().URL(url) @@ -3868,9 +3844,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" +// 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 } @@ -3880,11 +3856,10 @@ func XUpdateDbaasPostgresAllowReplication(paramServiceName string, paramUsername server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-postgres/{service-name}/user/{username}/allow-replication" + url := server + "/dbaas-mysql/{service-name}/user" url = strings.Replace(url, "{service-name}", paramServiceName, 1) - url = strings.Replace(url, "{username}", paramUsername, 1) - req := cli.Client.Put().URL(url) + req := cli.Client.Post().URL(url) if body != "" { req = req.AddHeader("Content-Type", "application/json").BodyString(body) @@ -3915,9 +3890,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" +// 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 } @@ -3927,15 +3902,11 @@ func XResetDbaasPostgresUserPassword(paramServiceName string, paramUsername stri server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-postgres/{service-name}/user/{username}/password/reset" + url := server + "/dbaas-mysql/{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) - - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -3962,9 +3933,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" +// 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 } @@ -3974,11 +3945,15 @@ func XRevealDbaasPostgresUserPassword(paramServiceName string, paramUsername str server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-postgres/{service-name}/user/{username}/password/reveal" + 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.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) @@ -4005,9 +3980,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" +// 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 } @@ -4017,14 +3992,11 @@ 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) - - req := cli.Client.Post().URL(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) - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -4051,9 +4023,9 @@ func XCreateDbaasPgUpgradeCheck(paramService string, params *viper.Viper, body s return resp, decoded, nil } -// XCreateDbaasServiceRedis Create a DBaaS Redis service -func XCreateDbaasServiceRedis(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-dbaas-service-redis" +// 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 } @@ -4063,7 +4035,7 @@ func XCreateDbaasServiceRedis(paramName string, params *viper.Viper, body string server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-redis/{name}" + url := server + "/dbaas-opensearch/{name}" url = strings.Replace(url, "{name}", paramName, 1) req := cli.Client.Post().URL(url) @@ -4097,9 +4069,9 @@ func XCreateDbaasServiceRedis(paramName string, params *viper.Viper, body string return resp, decoded, nil } -// XDeleteDbaasServiceRedis Delete a Redis service -func XDeleteDbaasServiceRedis(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-dbaas-service-redis" +// 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 } @@ -4109,7 +4081,7 @@ func XDeleteDbaasServiceRedis(paramName string, params *viper.Viper) (*gentleman server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-redis/{name}" + url := server + "/dbaas-opensearch/{name}" url = strings.Replace(url, "{name}", paramName, 1) req := cli.Client.Delete().URL(url) @@ -4139,9 +4111,9 @@ func XDeleteDbaasServiceRedis(paramName string, params *viper.Viper) (*gentleman return resp, decoded, nil } -// XGetDbaasServiceRedis Get a DBaaS Redis service -func XGetDbaasServiceRedis(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-dbaas-service-redis" +// 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 } @@ -4151,7 +4123,7 @@ func XGetDbaasServiceRedis(paramName string, params *viper.Viper) (*gentleman.Re server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-redis/{name}" + url := server + "/dbaas-opensearch/{name}" url = strings.Replace(url, "{name}", paramName, 1) req := cli.Client.Get().URL(url) @@ -4181,9 +4153,9 @@ func XGetDbaasServiceRedis(paramName string, params *viper.Viper) (*gentleman.Re return resp, decoded, nil } -// XUpdateDbaasServiceRedis Update a DBaaS Redis service -func XUpdateDbaasServiceRedis(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "update-dbaas-service-redis" +// 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 } @@ -4193,7 +4165,7 @@ func XUpdateDbaasServiceRedis(paramName string, params *viper.Viper, body string server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-redis/{name}" + url := server + "/dbaas-opensearch/{name}" url = strings.Replace(url, "{name}", paramName, 1) req := cli.Client.Put().URL(url) @@ -4227,9 +4199,9 @@ func XUpdateDbaasServiceRedis(paramName string, params *viper.Viper, body string return resp, decoded, nil } -// XStartDbaasRedisMaintenance Initiate Redis maintenance update -func XStartDbaasRedisMaintenance(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "start-dbaas-redis-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 } @@ -4239,14 +4211,10 @@ func XStartDbaasRedisMaintenance(paramName string, params *viper.Viper, body str server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-redis/{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) @@ -4273,9 +4241,9 @@ func XStartDbaasRedisMaintenance(paramName string, params *viper.Viper, body str return resp, decoded, nil } -// XStopDbaasRedisMigration Stop a DBaaS Redis migration -func XStopDbaasRedisMigration(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "stop-dbaas-redis-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 } @@ -4285,13 +4253,13 @@ func XStopDbaasRedisMigration(paramName string, params *viper.Viper, body string server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-redis/{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) @@ -4319,9 +4287,9 @@ func XStopDbaasRedisMigration(paramName string, params *viper.Viper, body string return resp, decoded, nil } -// XCreateDbaasRedisUser Create a DBaaS Redis user -func XCreateDbaasRedisUser(paramServiceName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "create-dbaas-redis-user" +// 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 } @@ -4331,13 +4299,13 @@ func XCreateDbaasRedisUser(paramServiceName string, params *viper.Viper, body st server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-redis/{service-name}/user" - 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) @@ -4365,9 +4333,9 @@ func XCreateDbaasRedisUser(paramServiceName string, params *viper.Viper, body st return resp, decoded, nil } -// XDeleteDbaasRedisUser Delete a DBaaS Redis user -func XDeleteDbaasRedisUser(paramServiceName string, paramUsername string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "delete-dbaas-redis-user" +// 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 } @@ -4377,11 +4345,14 @@ func XDeleteDbaasRedisUser(paramServiceName string, paramUsername string, params server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-redis/{service-name}/user/{username}" + url := server + "/dbaas-opensearch/{service-name}/user" url = strings.Replace(url, "{service-name}", paramServiceName, 1) - url = strings.Replace(url, "{username}", paramUsername, 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) @@ -4408,9 +4379,9 @@ func XDeleteDbaasRedisUser(paramServiceName string, paramUsername string, params return resp, decoded, nil } -// XResetDbaasRedisUserPassword Reset the credentials of a DBaaS Redis user -func XResetDbaasRedisUserPassword(paramServiceName string, paramUsername string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "reset-dbaas-redis-user-password" +// 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 } @@ -4420,15 +4391,11 @@ func XResetDbaasRedisUserPassword(paramServiceName string, paramUsername string, server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-redis/{service-name}/user/{username}/password/reset" + url := server + "/dbaas-opensearch/{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) - - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -4455,9 +4422,9 @@ func XResetDbaasRedisUserPassword(paramServiceName string, paramUsername string, return resp, decoded, nil } -// XRevealDbaasRedisUserPassword Reveal the secrets of a DBaaS Redis user -func XRevealDbaasRedisUserPassword(paramServiceName string, paramUsername string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "reveal-dbaas-redis-user-password" +// 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 } @@ -4467,11 +4434,15 @@ func XRevealDbaasRedisUserPassword(paramServiceName string, paramUsername string server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-redis/{service-name}/user/{username}/password/reveal" + 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.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) @@ -4498,9 +4469,9 @@ func XRevealDbaasRedisUserPassword(paramServiceName string, paramUsername string return resp, decoded, nil } -// XListDbaasServices List DBaaS services -func XListDbaasServices(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "list-dbaas-services" +// 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 } @@ -4510,7 +4481,9 @@ func XListDbaasServices(params *viper.Viper) (*gentleman.Response, map[string]in server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-service" + url := server + "/dbaas-opensearch/{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) @@ -4539,9 +4512,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" +// 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 } @@ -4551,8 +4524,8 @@ func XGetDbaasServiceLogs(paramServiceName string, params *viper.Viper, body str server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-service-logs/{service-name}" - 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) @@ -4585,9 +4558,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" +// 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 } @@ -4597,14 +4570,10 @@ func XGetDbaasServiceMetrics(paramServiceName string, params *viper.Viper, body server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-service-metrics/{service-name}" - url = strings.Replace(url, "{service-name}", paramServiceName, 1) - - req := cli.Client.Post().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.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -4631,9 +4600,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" +// 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 } @@ -4643,7 +4612,8 @@ 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/{name}" + url = strings.Replace(url, "{name}", paramName, 1) req := cli.Client.Get().URL(url) @@ -4672,9 +4642,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" +// 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 } @@ -4684,10 +4654,14 @@ 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/{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) @@ -4714,9 +4688,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" +// 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 } @@ -4726,10 +4700,14 @@ func XDeleteDbaasService(paramName string, params *viper.Viper) (*gentleman.Resp server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-service/{name}" + url := server + "/dbaas-postgres/{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) @@ -4756,9 +4734,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" +// 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 } @@ -4768,9 +4746,14 @@ 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/{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) @@ -4797,9 +4780,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" +// 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 } @@ -4809,9 +4792,14 @@ 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}/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) @@ -4838,9 +4826,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" +// 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 } @@ -4850,9 +4838,11 @@ 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}/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.Get().URL(url) + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -4879,9 +4869,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" +// 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 } @@ -4891,9 +4881,15 @@ 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}/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.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) @@ -4920,9 +4916,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" +// 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 } @@ -4932,9 +4928,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-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) @@ -4961,9 +4962,9 @@ func XGetDbaasSettingsPg(params *viper.Viper) (*gentleman.Response, map[string]i return resp, decoded, nil } -// XGetDbaasSettingsRedis Get DBaaS Redis settings -func XGetDbaasSettingsRedis(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "get-dbaas-settings-redis" +// 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 } @@ -4973,9 +4974,11 @@ func XGetDbaasSettingsRedis(params *viper.Viper) (*gentleman.Response, map[strin server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dbaas-settings-redis" + 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) @@ -5002,9 +5005,9 @@ func XGetDbaasSettingsRedis(params *viper.Viper) (*gentleman.Response, map[strin 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" +// 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 } @@ -5014,8 +5017,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-postgres/{service-name}/user" + url = strings.Replace(url, "{service-name}", paramServiceName, 1) req := cli.Client.Post().URL(url) @@ -5048,9 +5051,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" +// 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 } @@ -5060,11 +5063,11 @@ 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-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) @@ -5091,9 +5094,9 @@ func XGetDbaasTask(paramService string, paramId string, params *viper.Viper) (*g return resp, decoded, nil } -// XListDeployTargets List Deploy Targets -func XListDeployTargets(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "list-deploy-targets" +// 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 } @@ -5103,9 +5106,15 @@ func XListDeployTargets(params *viper.Viper) (*gentleman.Response, map[string]in server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/deploy-target" + 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) @@ -5132,9 +5141,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" +// 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 } @@ -5144,10 +5153,15 @@ func XGetDeployTarget(paramId string, params *viper.Viper) (*gentleman.Response, server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/deploy-target/{id}" - url = strings.Replace(url, "{id}", paramId, 1) + 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) @@ -5174,9 +5188,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" +// 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 } @@ -5186,13 +5200,11 @@ func XCreateDnsDomain(params *viper.Viper, body string) (*gentleman.Response, ma server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dns-domain" - - req := cli.Client.Post().URL(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) - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -5219,9 +5231,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" +// 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 } @@ -5231,9 +5243,14 @@ func XListDnsDomains(params *viper.Viper) (*gentleman.Response, map[string]inter server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/dns-domain" + 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) @@ -5260,9 +5277,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" +// XCreateDbaasServiceRedis Create a DBaaS Redis service +func XCreateDbaasServiceRedis(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-dbaas-service-redis" if xSubcommand { handlerPath = "x " + handlerPath } @@ -5272,8 +5289,8 @@ 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) + url := server + "/dbaas-redis/{name}" + url = strings.Replace(url, "{name}", paramName, 1) req := cli.Client.Post().URL(url) @@ -5306,9 +5323,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" +// XDeleteDbaasServiceRedis Delete a Redis service +func XDeleteDbaasServiceRedis(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-dbaas-service-redis" if xSubcommand { handlerPath = "x " + handlerPath } @@ -5318,10 +5335,10 @@ 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-redis/{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) @@ -5348,9 +5365,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" +// XGetDbaasServiceRedis Get a DBaaS Redis service +func XGetDbaasServiceRedis(paramName string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dbaas-service-redis" if xSubcommand { handlerPath = "x " + handlerPath } @@ -5360,11 +5377,10 @@ 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-redis/{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) @@ -5391,9 +5407,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" +// XUpdateDbaasServiceRedis Update a DBaaS Redis service +func XUpdateDbaasServiceRedis(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "update-dbaas-service-redis" if xSubcommand { handlerPath = "x " + handlerPath } @@ -5403,11 +5419,14 @@ 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-redis/{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) @@ -5434,9 +5453,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" +// XStartDbaasRedisMaintenance Initiate Redis maintenance update +func XStartDbaasRedisMaintenance(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "start-dbaas-redis-maintenance" if xSubcommand { handlerPath = "x " + handlerPath } @@ -5446,14 +5465,13 @@ 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-redis/{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) @@ -5481,9 +5499,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" +// XStopDbaasRedisMigration Stop a DBaaS Redis migration +func XStopDbaasRedisMigration(paramName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "stop-dbaas-redis-migration" if xSubcommand { handlerPath = "x " + handlerPath } @@ -5493,10 +5511,14 @@ 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-redis/{name}/migration/stop" + 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", "").BodyString(body) + } cli.HandleBefore(handlerPath, params, req) @@ -5523,9 +5545,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" +// XCreateDbaasRedisUser Create a DBaaS Redis user +func XCreateDbaasRedisUser(paramServiceName string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "create-dbaas-redis-user" if xSubcommand { handlerPath = "x " + handlerPath } @@ -5535,10 +5557,14 @@ 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-redis/{service-name}/user" + 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) @@ -5565,10 +5591,10 @@ 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" - if xSubcommand { +// XDeleteDbaasRedisUser Delete a DBaaS Redis user +func XDeleteDbaasRedisUser(paramServiceName string, paramUsername string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "delete-dbaas-redis-user" + if xSubcommand { handlerPath = "x " + handlerPath } @@ -5577,10 +5603,11 @@ 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-redis/{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) @@ -5607,9 +5634,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" +// XResetDbaasRedisUserPassword Reset the credentials of a DBaaS Redis user +func XResetDbaasRedisUserPassword(paramServiceName string, paramUsername string, params *viper.Viper, body string) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "reset-dbaas-redis-user-password" if xSubcommand { handlerPath = "x " + handlerPath } @@ -5619,9 +5646,11 @@ func XCreateElasticIp(params *viper.Viper, body string) (*gentleman.Response, ma server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/elastic-ip" + url := server + "/dbaas-redis/{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) @@ -5652,9 +5681,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" +// XRevealDbaasRedisUserPassword Reveal the secrets of a DBaaS Redis user +func XRevealDbaasRedisUserPassword(paramServiceName string, paramUsername string, params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "reveal-dbaas-redis-user-password" if xSubcommand { handlerPath = "x " + handlerPath } @@ -5664,7 +5693,9 @@ func XListElasticIps(params *viper.Viper) (*gentleman.Response, map[string]inter server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/elastic-ip" + url := server + "/dbaas-redis/{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) @@ -5693,9 +5724,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" +// XListDbaasServices List DBaaS services +func XListDbaasServices(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-dbaas-services" if xSubcommand { handlerPath = "x " + handlerPath } @@ -5705,10 +5736,9 @@ 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-service" - req := cli.Client.Delete().URL(url) + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -5735,9 +5765,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" +// 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 } @@ -5747,10 +5777,14 @@ 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-service-logs/{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) @@ -5777,9 +5811,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" +// 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 } @@ -5789,10 +5823,10 @@ func XUpdateElasticIp(paramId string, params *viper.Viper, body string) (*gentle server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/elastic-ip/{id}" - 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.Put().URL(url) + req := cli.Client.Post().URL(url) if body != "" { req = req.AddHeader("Content-Type", "application/json").BodyString(body) @@ -5823,9 +5857,9 @@ func XUpdateElasticIp(paramId string, params *viper.Viper, body string) (*gentle 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" +// 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 } @@ -5835,11 +5869,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-service-type" - req := cli.Client.Delete().URL(url) + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -5866,9 +5898,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" +// 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 } @@ -5878,14 +5910,10 @@ 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) - - req := cli.Client.Put().URL(url) + url := server + "/dbaas-service-type/{service-type-name}" + url = strings.Replace(url, "{service-type-name}", paramServiceTypeName, 1) - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -5912,9 +5940,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" +// 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 } @@ -5924,14 +5952,10 @@ 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) - - req := cli.Client.Put().URL(url) + url := server + "/dbaas-service/{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) @@ -5958,9 +5982,9 @@ func XDetachInstanceFromElasticIp(paramId string, params *viper.Viper, body stri return resp, decoded, nil } -// XListEvents List Events -func XListEvents(params *viper.Viper) (*gentleman.Response, interface{}, error) { - handlerPath := "list-events" +// 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 } @@ -5970,19 +5994,10 @@ func XListEvents(params *viper.Viper) (*gentleman.Response, interface{}, error) server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/event" + url := server + "/dbaas-settings-grafana" 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() @@ -5990,7 +6005,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 { @@ -6002,15 +6017,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" +// 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 } @@ -6020,7 +6035,7 @@ func XGetIamOrganizationPolicy(params *viper.Viper) (*gentleman.Response, map[st server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/iam-organization-policy" + url := server + "/dbaas-settings-kafka" req := cli.Client.Get().URL(url) @@ -6049,9 +6064,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" +// 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 } @@ -6061,13 +6076,9 @@ func XUpdateIamOrganizationPolicy(params *viper.Viper, body string) (*gentleman. server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/iam-organization-policy" - - req := cli.Client.Put().URL(url) + url := server + "/dbaas-settings-mysql" - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -6094,9 +6105,9 @@ func XUpdateIamOrganizationPolicy(params *viper.Viper, body string) (*gentleman. 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" +// 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 } @@ -6106,13 +6117,9 @@ func XCreateIamRole(params *viper.Viper, body string) (*gentleman.Response, map[ server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/iam-role" - - 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) @@ -6139,9 +6146,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" +// 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 } @@ -6151,7 +6158,7 @@ func XListIamRoles(params *viper.Viper) (*gentleman.Response, map[string]interfa server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/iam-role" + url := server + "/dbaas-settings-pg" req := cli.Client.Get().URL(url) @@ -6180,9 +6187,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" +// XGetDbaasSettingsRedis Get DBaaS Redis settings +func XGetDbaasSettingsRedis(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-dbaas-settings-redis" if xSubcommand { handlerPath = "x " + handlerPath } @@ -6192,10 +6199,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 + "/dbaas-settings-redis" - req := cli.Client.Delete().URL(url) + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -6222,9 +6228,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" +// 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 } @@ -6234,10 +6240,14 @@ 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 + "/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) @@ -6264,9 +6274,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" +// 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 } @@ -6276,14 +6286,11 @@ func XUpdateIamRole(paramId string, params *viper.Viper, body string) (*gentlema server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/iam-role/{id}" + url := server + "/dbaas-task/{service}/{id}" + url = strings.Replace(url, "{service}", paramService, 1) 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) @@ -6310,9 +6317,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" +// XListDeployTargets List Deploy Targets +func XListDeployTargets(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-deploy-targets" if xSubcommand { handlerPath = "x " + handlerPath } @@ -6322,14 +6329,9 @@ func XUpdateIamRolePolicy(paramId string, params *viper.Viper, body string) (*ge server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/iam-role/{id}:policy" - url = strings.Replace(url, "{id}", paramId, 1) - - req := cli.Client.Put().URL(url) + url := server + "/deploy-target" - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -6356,9 +6358,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" +// 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 } @@ -6368,13 +6370,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 + "/deploy-target/{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) @@ -6401,9 +6400,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" +// 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 } @@ -6413,23 +6412,55 @@ func XListInstances(params *viper.Viper) (*gentleman.Response, map[string]interf server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance" + url := server + "/dns-domain" - req := cli.Client.Get().URL(url) + req := cli.Client.Post().URL(url) - paramManagerId := params.GetString("manager-id") - if paramManagerId != "" { - req = req.AddQuery("manager-id", fmt.Sprintf("%v", paramManagerId)) + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) } - paramManagerType := params.GetString("manager-type") - if paramManagerType != "" { - req = req.AddQuery("manager-type", fmt.Sprintf("%v", paramManagerType)) + + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") } - paramIpAddress := params.GetString("ip-address") - if paramIpAddress != "" { - req = req.AddQuery("ip-address", fmt.Sprintf("%v", paramIpAddress)) + + 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 +} + +// XListDnsDomains List DNS domains +func XListDnsDomains(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-dns-domains" + if xSubcommand { + handlerPath = "x " + handlerPath } + server := viper.GetString("server") + if server == "" { + server = xServers()[viper.GetInt("server-index")]["url"] + } + + url := server + "/dns-domain" + + req := cli.Client.Get().URL(url) + cli.HandleBefore(handlerPath, params, req) resp, err := req.Do() @@ -6455,9 +6486,9 @@ 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" +// 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 } @@ -6467,7 +6498,8 @@ func XCreateInstancePool(params *viper.Viper, body string) (*gentleman.Response, server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance-pool" + url := server + "/dns-domain/{domain-id}/record" + url = strings.Replace(url, "{domain-id}", paramDomainId, 1) req := cli.Client.Post().URL(url) @@ -6500,9 +6532,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" +// 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 } @@ -6512,7 +6544,8 @@ func XListInstancePools(params *viper.Viper) (*gentleman.Response, map[string]in server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance-pool" + url := server + "/dns-domain/{domain-id}/record" + url = strings.Replace(url, "{domain-id}", paramDomainId, 1) req := cli.Client.Get().URL(url) @@ -6541,9 +6574,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" +// 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 } @@ -6553,8 +6586,9 @@ func XDeleteInstancePool(paramId string, params *viper.Viper) (*gentleman.Respon server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance-pool/{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) @@ -6583,9 +6617,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" +// 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 } @@ -6595,8 +6629,9 @@ func XGetInstancePool(paramId string, params *viper.Viper) (*gentleman.Response, server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance-pool/{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) @@ -6625,9 +6660,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" +// 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 } @@ -6637,8 +6672,9 @@ func XUpdateInstancePool(paramId string, params *viper.Viper, body string) (*gen server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance-pool/{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) @@ -6671,9 +6707,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" +// 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 } @@ -6683,9 +6719,8 @@ func XResetInstancePoolField(paramId string, paramField string, params *viper.Vi server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance-pool/{id}/{field}" + url := server + "/dns-domain/{id}" url = strings.Replace(url, "{id}", paramId, 1) - url = strings.Replace(url, "{field}", paramField, 1) req := cli.Client.Delete().URL(url) @@ -6714,9 +6749,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" +// 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 } @@ -6726,14 +6761,10 @@ func XEvictInstancePoolMembers(paramId string, params *viper.Viper, body string) server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance-pool/{id}:evict" + 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.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -6760,9 +6791,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" +// 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 } @@ -6772,14 +6803,10 @@ 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 + "/dns-domain/{id}/zone" 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) @@ -6806,9 +6833,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" +// 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 } @@ -6818,9 +6845,13 @@ func XListInstanceTypes(params *viper.Viper) (*gentleman.Response, map[string]in server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance-type" + url := server + "/elastic-ip" - 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) @@ -6847,9 +6878,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" +// XListElasticIps List Elastic IPs +func XListElasticIps(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-elastic-ips" if xSubcommand { handlerPath = "x " + handlerPath } @@ -6859,8 +6890,7 @@ 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 + "/elastic-ip" req := cli.Client.Get().URL(url) @@ -6889,9 +6919,9 @@ func XGetInstanceType(paramId string, params *viper.Viper) (*gentleman.Response, 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" +// 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 } @@ -6901,7 +6931,7 @@ func XDeleteInstance(paramId string, params *viper.Viper) (*gentleman.Response, server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance/{id}" + url := server + "/elastic-ip/{id}" url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Delete().URL(url) @@ -6931,9 +6961,9 @@ func XDeleteInstance(paramId string, params *viper.Viper) (*gentleman.Response, 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" +// 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 } @@ -6943,7 +6973,7 @@ func XGetInstance(paramId string, params *viper.Viper) (*gentleman.Response, map server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance/{id}" + url := server + "/elastic-ip/{id}" url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Get().URL(url) @@ -6973,9 +7003,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" +// 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 } @@ -6985,7 +7015,7 @@ func XUpdateInstance(paramId string, params *viper.Viper, body string) (*gentlem server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance/{id}" + url := server + "/elastic-ip/{id}" url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Put().URL(url) @@ -7019,9 +7049,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" +// 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 } @@ -7031,7 +7061,7 @@ func XResetInstanceField(paramId string, paramField string, params *viper.Viper) server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance/{id}/{field}" + url := server + "/elastic-ip/{id}/{field}" url = strings.Replace(url, "{id}", paramId, 1) url = strings.Replace(url, "{field}", paramField, 1) @@ -7062,9 +7092,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" +// 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 } @@ -7074,13 +7104,13 @@ func XAddInstanceProtection(paramId string, params *viper.Viper, body string) (* server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance/{id}:add-protection" + url := server + "/elastic-ip/{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) @@ -7108,9 +7138,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" +// 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 } @@ -7120,13 +7150,13 @@ func XCreateSnapshot(paramId string, params *viper.Viper, body string) (*gentlem server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance/{id}:create-snapshot" + url := server + "/elastic-ip/{id}:detach" 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", "").BodyString(body) + req = req.AddHeader("Content-Type", "application/json").BodyString(body) } cli.HandleBefore(handlerPath, params, req) @@ -7154,9 +7184,9 @@ func XCreateSnapshot(paramId string, params *viper.Viper, body string) (*gentlem 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" +// XListEvents List Events +func XListEvents(params *viper.Viper) (*gentleman.Response, interface{}, error) { + handlerPath := "list-events" if xSubcommand { handlerPath = "x " + handlerPath } @@ -7166,11 +7196,19 @@ func XRevealInstancePassword(paramId string, params *viper.Viper) (*gentleman.Re server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance/{id}:password" - url = strings.Replace(url, "{id}", paramId, 1) + url := server + "/event" 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() @@ -7178,7 +7216,7 @@ func XRevealInstancePassword(paramId string, params *viper.Viper) (*gentleman.Re 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 { @@ -7190,15 +7228,15 @@ func XRevealInstancePassword(paramId string, params *viper.Viper) (*gentleman.Re after := cli.HandleAfter(handlerPath, params, resp, decoded) if after != nil { - decoded = after.(map[string]interface{}) + decoded = after } 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" +// 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 } @@ -7208,14 +7246,9 @@ func XRebootInstance(paramId string, params *viper.Viper, body string) (*gentlem server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance/{id}:reboot" - url = strings.Replace(url, "{id}", paramId, 1) + url := server + "/iam-organization-policy" - 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) @@ -7242,9 +7275,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" +// 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 } @@ -7254,13 +7287,12 @@ func XRemoveInstanceProtection(paramId string, params *viper.Viper, body string) server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance/{id}:remove-protection" - url = strings.Replace(url, "{id}", paramId, 1) + url := server + "/iam-organization-policy" 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) @@ -7288,9 +7320,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" +// 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 } @@ -7300,10 +7332,9 @@ func XResetInstance(paramId string, params *viper.Viper, body string) (*gentlema server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance/{id}:reset" - 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", "application/json").BodyString(body) @@ -7334,9 +7365,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" +// XListIamRoles List IAM Roles +func XListIamRoles(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-iam-roles" if xSubcommand { handlerPath = "x " + handlerPath } @@ -7346,14 +7377,9 @@ 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) - - req := cli.Client.Put().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) @@ -7380,9 +7406,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" +// 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 } @@ -7392,14 +7418,10 @@ func XResizeInstanceDisk(paramId string, params *viper.Viper, body string) (*gen server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance/{id}:resize-disk" + 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", "application/json").BodyString(body) - } + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -7426,9 +7448,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" +// 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 } @@ -7438,14 +7460,10 @@ func XScaleInstance(paramId string, params *viper.Viper, body string) (*gentlema server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance/{id}:scale" + 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", "application/json").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -7472,9 +7490,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" +// 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 } @@ -7484,7 +7502,7 @@ func XStartInstance(paramId string, params *viper.Viper, body string) (*gentlema server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance/{id}:start" + url := server + "/iam-role/{id}" url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Put().URL(url) @@ -7518,9 +7536,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" +// 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 } @@ -7530,13 +7548,13 @@ func XStopInstance(paramId string, params *viper.Viper, body string) (*gentleman server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/instance/{id}:stop" + url := server + "/iam-role/{id}: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) @@ -7564,9 +7582,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" +// 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 } @@ -7576,8 +7594,7 @@ 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) + url := server + "/instance" req := cli.Client.Post().URL(url) @@ -7610,9 +7627,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" +// XListInstances List Compute instances +func XListInstances(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-instances" if xSubcommand { handlerPath = "x " + handlerPath } @@ -7622,12 +7639,21 @@ func XCreateLoadBalancer(params *viper.Viper, body string) (*gentleman.Response, server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/load-balancer" + url := server + "/instance" - req := cli.Client.Post().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)) } cli.HandleBefore(handlerPath, params, req) @@ -7655,9 +7681,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" +// 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 } @@ -7667,9 +7693,13 @@ 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" - 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) @@ -7696,9 +7726,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" +// XListInstancePools List Instance Pools +func XListInstancePools(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-instance-pools" if xSubcommand { handlerPath = "x " + handlerPath } @@ -7708,10 +7738,9 @@ func XDeleteLoadBalancer(paramId string, params *viper.Viper) (*gentleman.Respon server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/load-balancer/{id}" - url = strings.Replace(url, "{id}", paramId, 1) + url := server + "/instance-pool" - req := cli.Client.Delete().URL(url) + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -7738,9 +7767,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" +// 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 } @@ -7750,10 +7779,10 @@ 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}" url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -7780,9 +7809,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" +// 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 } @@ -7792,14 +7821,10 @@ 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}" 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) @@ -7826,9 +7851,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" +// 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 } @@ -7838,10 +7863,10 @@ func XAddServiceToLoadBalancer(paramId string, params *viper.Viper, body string) server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/load-balancer/{id}/service" + url := server + "/instance-pool/{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) @@ -7872,9 +7897,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" +// 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 } @@ -7884,9 +7909,9 @@ 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-pool/{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.Delete().URL(url) @@ -7915,9 +7940,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" +// 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 } @@ -7927,11 +7952,14 @@ 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-pool/{id}:evict" url = strings.Replace(url, "{id}", paramId, 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) @@ -7958,9 +7986,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" +// 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 } @@ -7970,9 +7998,8 @@ 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-pool/{id}:scale" url = strings.Replace(url, "{id}", paramId, 1) - url = strings.Replace(url, "{service-id}", paramServiceId, 1) req := cli.Client.Put().URL(url) @@ -8005,9 +8032,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" +// 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 } @@ -8017,12 +8044,9 @@ func XResetLoadBalancerServiceField(paramId string, paramServiceId string, param server = xServers()[viper.GetInt("server-index")]["url"] } - 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) + url := server + "/instance-type" - req := cli.Client.Delete().URL(url) + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -8049,9 +8073,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" +// 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 } @@ -8061,11 +8085,10 @@ 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-type/{id}" url = strings.Replace(url, "{id}", paramId, 1) - url = strings.Replace(url, "{field}", paramField, 1) - req := cli.Client.Delete().URL(url) + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -8092,9 +8115,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" +// 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 } @@ -8104,10 +8127,10 @@ 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}" url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -8134,9 +8157,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" +// 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 } @@ -8146,7 +8169,8 @@ func XGetOrganization(params *viper.Viper) (*gentleman.Response, map[string]inte server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/organization" + url := server + "/instance/{id}" + url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Get().URL(url) @@ -8175,9 +8199,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" +// 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 } @@ -8187,9 +8211,10 @@ func XCreatePrivateNetwork(params *viper.Viper, body string) (*gentleman.Respons server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/private-network" + url := server + "/instance/{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) @@ -8220,9 +8245,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" +// 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 } @@ -8232,9 +8257,11 @@ func XListPrivateNetworks(params *viper.Viper) (*gentleman.Response, map[string] server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/private-network" + url := server + "/instance/{id}/{field}" + url = strings.Replace(url, "{id}", paramId, 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) @@ -8261,9 +8288,9 @@ 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" +// 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 } @@ -8273,10 +8300,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}:add-protection" 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) @@ -8303,9 +8334,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" +// 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 } @@ -8315,10 +8346,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}: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) @@ -8345,9 +8380,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" +// 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 } @@ -8357,14 +8392,10 @@ 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}:password" 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) @@ -8391,9 +8422,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" +// 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 } @@ -8403,11 +8434,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}:reboot" 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) @@ -8434,9 +8468,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" +// 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 } @@ -8446,13 +8480,13 @@ 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}:remove-protection" 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 = req.AddHeader("Content-Type", "").BodyString(body) } cli.HandleBefore(handlerPath, params, req) @@ -8480,9 +8514,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" +// 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 } @@ -8492,7 +8526,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}:reset" url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Put().URL(url) @@ -8526,9 +8560,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" +// 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 } @@ -8538,13 +8572,13 @@ 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}:reset-password" 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 = req.AddHeader("Content-Type", "").BodyString(body) } cli.HandleBefore(handlerPath, params, req) @@ -8572,9 +8606,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" +// 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 } @@ -8584,9 +8618,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}:resize-disk" + 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) @@ -8613,9 +8652,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" +// 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 } @@ -8625,10 +8664,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/{id}:scale" + 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) @@ -8655,9 +8698,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" +// 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 } @@ -8667,10 +8710,14 @@ func XDeleteReverseDnsElasticIp(paramId string, params *viper.Viper) (*gentleman server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/reverse-dns/elastic-ip/{id}" + url := server + "/instance/{id}:start" 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) @@ -8697,9 +8744,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" +// 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 } @@ -8709,10 +8756,14 @@ func XGetReverseDnsElasticIp(paramId string, params *viper.Viper) (*gentleman.Re server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/reverse-dns/elastic-ip/{id}" + 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) @@ -8739,9 +8790,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" +// 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 } @@ -8751,8 +8802,8 @@ func XUpdateReverseDnsElasticIp(paramId string, params *viper.Viper, body string server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/reverse-dns/elastic-ip/{id}" - url = strings.Replace(url, "{id}", paramId, 1) + url := server + "/instance/{instance-id}:revert-snapshot" + url = strings.Replace(url, "{instance-id}", paramInstanceId, 1) req := cli.Client.Post().URL(url) @@ -8785,9 +8836,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" +// 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 } @@ -8797,10 +8848,13 @@ func XDeleteReverseDnsInstance(paramId string, params *viper.Viper) (*gentleman. server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/reverse-dns/instance/{id}" - url = strings.Replace(url, "{id}", paramId, 1) + url := server + "/load-balancer" - 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) @@ -8827,9 +8881,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" +// XListLoadBalancers List Load Balancers +func XListLoadBalancers(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-load-balancers" if xSubcommand { handlerPath = "x " + handlerPath } @@ -8839,8 +8893,7 @@ func XGetReverseDnsInstance(paramId string, params *viper.Viper) (*gentleman.Res server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/reverse-dns/instance/{id}" - url = strings.Replace(url, "{id}", paramId, 1) + url := server + "/load-balancer" req := cli.Client.Get().URL(url) @@ -8869,9 +8922,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" +// 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 } @@ -8881,14 +8934,10 @@ func XUpdateReverseDnsInstance(paramId string, params *viper.Viper, body string) server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/reverse-dns/instance/{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.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -8915,9 +8964,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" +// 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 } @@ -8927,13 +8976,10 @@ func XCreateSecurityGroup(params *viper.Viper, body string) (*gentleman.Response server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/security-group" - - req := cli.Client.Post().URL(url) + url := server + "/load-balancer/{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) @@ -8960,9 +9006,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" +// 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 } @@ -8972,13 +9018,13 @@ func XListSecurityGroups(params *viper.Viper) (*gentleman.Response, map[string]i server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/security-group" + url := server + "/load-balancer/{id}" + url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Put().URL(url) - paramVisibility := params.GetString("visibility") - if paramVisibility != "" { - req = req.AddQuery("visibility", fmt.Sprintf("%v", paramVisibility)) + if body != "" { + req = req.AddHeader("Content-Type", "application/json").BodyString(body) } cli.HandleBefore(handlerPath, params, req) @@ -9006,9 +9052,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" +// 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 } @@ -9018,12 +9064,16 @@ func XDeleteSecurityGroup(paramId string, params *viper.Viper) (*gentleman.Respo server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/security-group/{id}" + url := server + "/load-balancer/{id}/service" url = strings.Replace(url, "{id}", paramId, 1) - req := cli.Client.Delete().URL(url) - - cli.HandleBefore(handlerPath, params, req) + 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 { @@ -9048,9 +9098,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" +// 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 } @@ -9060,10 +9110,11 @@ func XGetSecurityGroup(paramId string, params *viper.Viper) (*gentleman.Response server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/security-group/{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) @@ -9090,9 +9141,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" +// 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 } @@ -9102,14 +9153,11 @@ func XAddRuleToSecurityGroup(paramId string, params *viper.Viper, body string) ( server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/security-group/{id}/rules" + 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.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) @@ -9136,9 +9184,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" +// 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 } @@ -9148,11 +9196,15 @@ 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 + "/load-balancer/{id}/service/{service-id}" url = strings.Replace(url, "{id}", paramId, 1) - url = strings.Replace(url, "{rule-id}", paramRuleId, 1) + url = strings.Replace(url, "{service-id}", paramServiceId, 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) @@ -9179,9 +9231,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" +// 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 } @@ -9191,14 +9243,12 @@ func XAddExternalSourceToSecurityGroup(paramId string, params *viper.Viper, body server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/security-group/{id}:add-source" + 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.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) @@ -9225,9 +9275,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" +// 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 } @@ -9237,14 +9287,11 @@ func XAttachInstanceToSecurityGroup(paramId string, params *viper.Viper, body st server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/security-group/{id}:attach" + url := server + "/load-balancer/{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", "application/json").BodyString(body) - } + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -9271,9 +9318,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" +// 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 } @@ -9283,14 +9330,10 @@ func XDetachInstanceFromSecurityGroup(paramId string, params *viper.Viper, body server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/security-group/{id}:detach" + url := server + "/operation/{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) @@ -9317,9 +9360,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" +// XGetOrganization Retrieve an organization +func XGetOrganization(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "get-organization" if xSubcommand { handlerPath = "x " + handlerPath } @@ -9329,14 +9372,9 @@ func XRemoveExternalSourceFromSecurityGroup(paramId string, params *viper.Viper, server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/security-group/{id}:remove-source" - url = strings.Replace(url, "{id}", paramId, 1) - - req := cli.Client.Put().URL(url) + url := server + "/organization" - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -9363,9 +9401,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" +// 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 } @@ -9375,7 +9413,7 @@ func XCreateSksCluster(params *viper.Viper, body string) (*gentleman.Response, m server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/sks-cluster" + url := server + "/private-network" req := cli.Client.Post().URL(url) @@ -9408,9 +9446,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" +// XListPrivateNetworks List Private Networks +func XListPrivateNetworks(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-private-networks" if xSubcommand { handlerPath = "x " + handlerPath } @@ -9420,7 +9458,7 @@ func XListSksClusters(params *viper.Viper) (*gentleman.Response, map[string]inte server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/sks-cluster" + url := server + "/private-network" req := cli.Client.Get().URL(url) @@ -9449,9 +9487,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" +// 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 } @@ -9461,10 +9499,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 + "/private-network/{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) @@ -9473,7 +9511,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 { @@ -9485,15 +9523,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" +// 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 } @@ -9503,14 +9541,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 + "/private-network/{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) @@ -9537,9 +9571,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" +// 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 } @@ -9549,13 +9583,13 @@ func XListSksClusterVersions(params *viper.Viper) (*gentleman.Response, map[stri server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/sks-cluster-version" + url := server + "/private-network/{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) @@ -9583,9 +9617,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" +// 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 } @@ -9595,8 +9629,9 @@ func XDeleteSksCluster(paramId string, params *viper.Viper) (*gentleman.Response server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/sks-cluster/{id}" + url := server + "/private-network/{id}/{field}" url = strings.Replace(url, "{id}", paramId, 1) + url = strings.Replace(url, "{field}", paramField, 1) req := cli.Client.Delete().URL(url) @@ -9625,9 +9660,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" +// 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 } @@ -9637,10 +9672,14 @@ func XGetSksCluster(paramId string, params *viper.Viper) (*gentleman.Response, m server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/sks-cluster/{id}" + url := server + "/private-network/{id}:attach" 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) @@ -9667,9 +9706,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" +// 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 } @@ -9679,7 +9718,7 @@ func XUpdateSksCluster(paramId string, params *viper.Viper, body string) (*gentl server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/sks-cluster/{id}" + url := server + "/private-network/{id}:detach" url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Put().URL(url) @@ -9713,9 +9752,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" +// 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 } @@ -9725,11 +9764,14 @@ func XGetSksClusterAuthorityCert(paramId string, paramAuthority string, params * server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/sks-cluster/{id}/authority/{authority}/cert" + url := server + "/private-network/{id}:update-ip" url = strings.Replace(url, "{id}", paramId, 1) - url = strings.Replace(url, "{authority}", paramAuthority, 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) @@ -9756,9 +9798,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" +// XListQuotas List Organization Quotas +func XListQuotas(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-quotas" if xSubcommand { handlerPath = "x " + handlerPath } @@ -9768,8 +9810,7 @@ func XGetSksClusterInspection(paramId string, params *viper.Viper) (*gentleman.R server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/sks-cluster/{id}/inspection" - url = strings.Replace(url, "{id}", paramId, 1) + url := server + "/quota" req := cli.Client.Get().URL(url) @@ -9798,9 +9839,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" +// 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 } @@ -9810,14 +9851,10 @@ func XCreateSksNodepool(paramId string, params *viper.Viper, body string) (*gent 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) + url := server + "/quota/{entity}" + url = strings.Replace(url, "{entity}", paramEntity, 1) - if body != "" { - req = req.AddHeader("Content-Type", "application/json").BodyString(body) - } + req := cli.Client.Get().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -9844,9 +9881,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" +// 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 } @@ -9856,9 +9893,8 @@ 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 + "/reverse-dns/elastic-ip/{id}" url = strings.Replace(url, "{id}", paramId, 1) - url = strings.Replace(url, "{sks-nodepool-id}", paramSksNodepoolId, 1) req := cli.Client.Delete().URL(url) @@ -9887,9 +9923,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" +// 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 } @@ -9899,9 +9935,8 @@ 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 := server + "/reverse-dns/elastic-ip/{id}" url = strings.Replace(url, "{id}", paramId, 1) - url = strings.Replace(url, "{sks-nodepool-id}", paramSksNodepoolId, 1) req := cli.Client.Get().URL(url) @@ -9930,9 +9965,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" +// 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 } @@ -9942,11 +9977,10 @@ 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 := server + "/reverse-dns/elastic-ip/{id}" url = strings.Replace(url, "{id}", paramId, 1) - url = strings.Replace(url, "{sks-nodepool-id}", paramSksNodepoolId, 1) - req := cli.Client.Put().URL(url) + req := cli.Client.Post().URL(url) if body != "" { req = req.AddHeader("Content-Type", "application/json").BodyString(body) @@ -9977,9 +10011,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" +// 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 } @@ -9989,10 +10023,8 @@ 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 := server + "/reverse-dns/instance/{id}" url = strings.Replace(url, "{id}", paramId, 1) - url = strings.Replace(url, "{sks-nodepool-id}", paramSksNodepoolId, 1) - url = strings.Replace(url, "{field}", paramField, 1) req := cli.Client.Delete().URL(url) @@ -10021,9 +10053,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" +// 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 } @@ -10033,15 +10065,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 + "/reverse-dns/instance/{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) @@ -10068,9 +10095,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" +// 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 } @@ -10080,11 +10107,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 + "/reverse-dns/instance/{id}" url = strings.Replace(url, "{id}", paramId, 1) - url = strings.Replace(url, "{sks-nodepool-id}", paramSksNodepoolId, 1) - req := cli.Client.Put().URL(url) + req := cli.Client.Post().URL(url) if body != "" { req = req.AddHeader("Content-Type", "application/json").BodyString(body) @@ -10115,9 +10141,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" +// 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 } @@ -10127,13 +10153,12 @@ 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 = strings.Replace(url, "{id}", paramId, 1) + url := server + "/security-group" - 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) @@ -10161,9 +10186,9 @@ func XRotateSksCcmCredentials(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" +// XListSecurityGroups List Security Groups. +func XListSecurityGroups(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-security-groups" if xSubcommand { handlerPath = "x " + handlerPath } @@ -10173,13 +10198,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 = strings.Replace(url, "{id}", paramId, 1) + url := server + "/security-group" - req := cli.Client.Put().URL(url) + req := cli.Client.Get().URL(url) - if body != "" { - req = req.AddHeader("Content-Type", "").BodyString(body) + paramVisibility := params.GetString("visibility") + if paramVisibility != "" { + req = req.AddQuery("visibility", fmt.Sprintf("%v", paramVisibility)) } cli.HandleBefore(handlerPath, params, req) @@ -10207,9 +10232,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" +// 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 } @@ -10219,14 +10244,10 @@ 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 + "/security-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) @@ -10253,9 +10274,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" +// 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 } @@ -10265,14 +10286,10 @@ 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 + "/security-group/{id}" url = strings.Replace(url, "{id}", paramId, 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) @@ -10299,9 +10316,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" +// 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 } @@ -10311,11 +10328,14 @@ func XResetSksClusterField(paramId string, paramField string, params *viper.Vipe server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/sks-cluster/{id}/{field}" + url := server + "/security-group/{id}/rules" url = strings.Replace(url, "{id}", paramId, 1) - url = strings.Replace(url, "{field}", paramField, 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) @@ -10342,9 +10362,9 @@ 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" +// 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 } @@ -10354,9 +10374,11 @@ func XListSnapshots(params *viper.Viper) (*gentleman.Response, map[string]interf server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/snapshot" + url := server + "/security-group/{id}/rules/{rule-id}" + url = strings.Replace(url, "{id}", paramId, 1) + url = strings.Replace(url, "{rule-id}", paramRuleId, 1) - req := cli.Client.Get().URL(url) + req := cli.Client.Delete().URL(url) cli.HandleBefore(handlerPath, params, req) @@ -10383,9 +10405,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" +// 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 } @@ -10395,10 +10417,14 @@ func XDeleteSnapshot(paramId string, params *viper.Viper) (*gentleman.Response, server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/snapshot/{id}" + url := server + "/security-group/{id}:add-source" 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) @@ -10425,9 +10451,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" +// 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 } @@ -10437,10 +10463,14 @@ func XGetSnapshot(paramId string, params *viper.Viper) (*gentleman.Response, map server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/snapshot/{id}" + url := server + "/security-group/{id}:attach" 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) @@ -10467,9 +10497,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" +// 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 } @@ -10479,13 +10509,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 + "/security-group/{id}:detach" 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", "").BodyString(body) + req = req.AddHeader("Content-Type", "application/json").BodyString(body) } cli.HandleBefore(handlerPath, params, req) @@ -10513,9 +10543,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" +// 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 } @@ -10525,10 +10555,10 @@ func XPromoteSnapshotToTemplate(paramId string, params *viper.Viper, body string server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/snapshot/{id}:promote" + url := server + "/security-group/{id}:remove-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) @@ -10559,9 +10589,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" +// 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 } @@ -10571,9 +10601,13 @@ func XListSosBucketsUsage(params *viper.Viper) (*gentleman.Response, map[string] server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/sos-buckets-usage" + url := server + "/sks-cluster" - 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) @@ -10600,9 +10634,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" +// XListSksClusters List SKS clusters +func XListSksClusters(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { + handlerPath := "list-sks-clusters" if xSubcommand { handlerPath = "x " + handlerPath } @@ -10612,16 +10646,10 @@ 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 + "/sks-cluster" 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() @@ -10647,9 +10675,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" +// 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 } @@ -10659,7 +10687,8 @@ func XListSshKeys(params *viper.Viper) (*gentleman.Response, map[string]interfac server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/ssh-key" + url := server + "/sks-cluster-deprecated-resources/{id}" + url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Get().URL(url) @@ -10670,7 +10699,7 @@ func XListSshKeys(params *viper.Viper) (*gentleman.Response, map[string]interfac 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 { @@ -10682,15 +10711,15 @@ func XListSshKeys(params *viper.Viper) (*gentleman.Response, map[string]interfac after := cli.HandleAfter(handlerPath, params, resp, decoded) if after != nil { - decoded = after.(map[string]interface{}) + decoded = after } 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" +// 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 } @@ -10700,7 +10729,8 @@ func XRegisterSshKey(params *viper.Viper, body string) (*gentleman.Response, map server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/ssh-key" + url := server + "/sks-cluster-kubeconfig/{id}" + url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Post().URL(url) @@ -10733,9 +10763,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" +// 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 } @@ -10745,10 +10775,14 @@ 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 + "/sks-cluster-version" - req := cli.Client.Delete().URL(url) + 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) @@ -10775,9 +10809,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" +// 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 } @@ -10787,10 +10821,10 @@ 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 + "/sks-cluster/{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) @@ -10817,9 +10851,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" +// 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 } @@ -10829,17 +10863,55 @@ func XListTemplates(params *viper.Viper) (*gentleman.Response, map[string]interf server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/template" + url := server + "/sks-cluster/{id}" + url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Get().URL(url) - paramVisibility := params.GetString("visibility") - if paramVisibility != "" { - req = req.AddQuery("visibility", fmt.Sprintf("%v", paramVisibility)) + cli.HandleBefore(handlerPath, params, req) + + resp, err := req.Do() + if err != nil { + return nil, nil, errors.Wrap(err, "Request failed") } - paramFamily := params.GetString("family") - if paramFamily != "" { - req = req.AddQuery("family", fmt.Sprintf("%v", paramFamily)) + + 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) @@ -10867,9 +10939,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" +// 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 } @@ -10879,14 +10951,54 @@ func XRegisterTemplate(params *viper.Viper, body string) (*gentleman.Response, m server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/template" + 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.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 +} + +// 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"] + } + + 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() @@ -10912,9 +11024,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" +// 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 } @@ -10924,7 +11036,7 @@ func XCopyTemplate(paramId string, params *viper.Viper, body string) (*gentleman server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/template/{id}" + url := server + "/sks-cluster/{id}/nodepool" url = strings.Replace(url, "{id}", paramId, 1) req := cli.Client.Post().URL(url) @@ -10958,9 +11070,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" +// 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 } @@ -10970,8 +11082,9 @@ func XDeleteTemplate(paramId string, params *viper.Viper) (*gentleman.Response, server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/template/{id}" + 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) @@ -11000,9 +11113,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" +// 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 } @@ -11012,8 +11125,9 @@ func XGetTemplate(paramId string, params *viper.Viper) (*gentleman.Response, map server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/template/{id}" + 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) @@ -11042,9 +11156,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" +// 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 } @@ -11054,8 +11168,9 @@ func XUpdateTemplate(paramId string, params *viper.Viper, body string) (*gentlem server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/template/{id}" + 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) @@ -11088,9 +11203,9 @@ func XUpdateTemplate(paramId string, params *viper.Viper, body string) (*gentlem return resp, decoded, nil } -// XListZones List Zones -func XListZones(params *viper.Viper) (*gentleman.Response, map[string]interface{}, error) { - handlerPath := "list-zones" +// 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" if xSubcommand { handlerPath = "x " + handlerPath } @@ -11100,9 +11215,59 @@ func XListZones(params *viper.Viper) (*gentleman.Response, map[string]interface{ server = xServers()[viper.GetInt("server-index")]["url"] } - url := server + "/zone" + 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) - req := cli.Client.Get().URL(url) + 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 +} + +// 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) @@ -11129,20 +11294,1994 @@ func XListZones(params *viper.Viper) (*gentleman.Response, map[string]interface{ return resp, decoded, nil } -func xRegister(subcommand bool) { - root := cli.Root +// 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 +} + +// 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 +} + +// 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" + if xSubcommand { + handlerPath = "x " + handlerPath + } + + server := viper.GetString("server") + if server == "" { + 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) + + 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 +} + +// 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 +} + +// 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 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)"), + } + 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() + + 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-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: 10\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-target'\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.\n## Request Schema (application/json)\n\nproperties:\n size:\n description: Volume size in GiB\n format: int64\n minimum: 11\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 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) + + cli.SetCustomFlags(cmd) + + if cmd.Flags().HasFlags() { + params.BindPFlags(cmd.Flags()) + } + + }() + + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + Use: "get-dbaas-external-endpoint-datadog 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) { + + _, 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") + } + + }, + } + + root.AddCommand(cmd) + + 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() @@ -11150,18 +13289,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: "update-dbaas-external-endpoint-datadog 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 $ref: '#/components/schemas/dbaas-endpoint-datadog'\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 := XUpdateDbaasExternalEndpointDatadog(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -11189,14 +13328,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "list-anti-affinity-groups", - Short: "List Anti-affinity Groups", - Long: cli.Markdown(""), + 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 $ref: '#/components/schemas/dbaas-endpoint-datadog'\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 := XListAntiAffinityGroups(params) + _, decoded, err := XCreateDbaasExternalEndpointDatadog(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -11224,14 +13367,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: "delete-dbaas-external-endpoint-elasticsearch id", + Short: "delete-dbaas-external-endpoint-elasticsearch", + Long: cli.Markdown("[BETA] Delete ElasticSearch logs external integration endpoint"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XDeleteAntiAffinityGroup(args[0], params) + _, decoded, err := XDeleteDbaasExternalEndpointElasticsearch(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -11259,14 +13402,14 @@ 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: "get-dbaas-external-endpoint-elasticsearch 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 := XGetAntiAffinityGroup(args[0], params) + _, decoded, err := XGetDbaasExternalEndpointElasticsearch(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -11294,18 +13437,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: "update-dbaas-external-endpoint-elasticsearch 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 $ref: '#/components/schemas/dbaas-endpoint-elasticsearch'\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 := XUpdateDbaasExternalEndpointElasticsearch(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -11333,14 +13476,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "list-api-keys", - Short: "List API keys", - Long: cli.Markdown(""), + 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 $ref: '#/components/schemas/dbaas-endpoint-elasticsearch'\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 := XListApiKeys(params) + _, decoded, err := XCreateDbaasExternalEndpointElasticsearch(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -11368,14 +13515,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: "delete-dbaas-external-endpoint-opensearch id", + Short: "delete-dbaas-external-endpoint-opensearch", + Long: cli.Markdown("[BETA] Delete OpenSearch logs external integration endpoint"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XDeleteApiKey(args[0], params) + _, decoded, err := XDeleteDbaasExternalEndpointOpensearch(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -11403,14 +13550,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "get-api-key id", - Short: "Get API key", - Long: cli.Markdown(""), + Use: "get-dbaas-external-endpoint-opensearch 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 := XGetApiKey(args[0], params) + _, decoded, err := XGetDbaasExternalEndpointOpensearch(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -11438,18 +13585,18 @@ 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: 10\n type: integer\ntype: object\n"), + Use: "update-dbaas-external-endpoint-opensearch 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 $ref: '#/components/schemas/dbaas-endpoint-opensearch'\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 := XUpdateDbaasExternalEndpointOpensearch(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -11477,14 +13624,18 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "list-block-storage-volumes", - Short: "List block storage volumes", - Long: cli.Markdown(""), + 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 $ref: '#/components/schemas/dbaas-endpoint-opensearch'\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 := XListBlockStorageVolumes(params) + _, decoded, err := XCreateDbaasExternalEndpointOpensearch(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -11498,8 +13649,6 @@ func xRegister(subcommand bool) { root.AddCommand(cmd) - cmd.Flags().String("instance-id", "", "") - cli.SetCustomFlags(cmd) if cmd.Flags().HasFlags() { @@ -11514,14 +13663,14 @@ func xRegister(subcommand bool) { var examples string cmd := &cobra.Command{ - Use: "list-block-storage-snapshots", - Short: "List block storage snapshots", - Long: cli.Markdown(""), + Use: "delete-dbaas-external-endpoint-prometheus id", + Short: "delete-dbaas-external-endpoint-prometheus", + Long: cli.Markdown("[BETA] Delete Prometheus external integration endpoint"), Example: examples, - Args: cobra.MinimumNArgs(0), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XListBlockStorageSnapshots(params) + _, decoded, err := XDeleteDbaasExternalEndpointPrometheus(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -11549,14 +13698,14 @@ 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: "get-dbaas-external-endpoint-prometheus id", + Short: "get-dbaas-external-endpoint-prometheus", + Long: cli.Markdown("[BETA] Get Prometheus external integration endpoint settings"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XDeleteBlockStorageSnapshot(args[0], params) + _, decoded, err := XGetDbaasExternalEndpointPrometheus(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -11584,14 +13733,18 @@ 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: "update-dbaas-external-endpoint-prometheus 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 $ref: '#/components/schemas/dbaas-endpoint-prometheus'\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 := XGetBlockStorageSnapshot(args[0], params) + _, decoded, err := XUpdateDbaasExternalEndpointPrometheus(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -11619,9 +13772,9 @@ 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: "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 $ref: '#/components/schemas/dbaas-endpoint-prometheus'\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { @@ -11630,7 +13783,7 @@ func xRegister(subcommand bool) { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XUpdateBlockStorageSnapshot(args[0], params, body) + _, decoded, err := XCreateDbaasExternalEndpointPrometheus(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -11658,14 +13811,14 @@ 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: "delete-dbaas-external-endpoint-rsyslog 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 := XDeleteBlockStorageVolume(args[0], params) + _, decoded, err := XDeleteDbaasExternalEndpointRsyslog(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -11693,14 +13846,14 @@ 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: "get-dbaas-external-endpoint-rsyslog 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) { - _, decoded, err := XGetBlockStorageVolume(args[0], params) + _, decoded, err := XGetDbaasExternalEndpointRsyslog(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -11728,9 +13881,9 @@ 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: "update-dbaas-external-endpoint-rsyslog 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 $ref: '#/components/schemas/dbaas-endpoint-rsyslog'\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { @@ -11739,7 +13892,7 @@ func xRegister(subcommand bool) { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XUpdateBlockStorageVolume(args[0], params, body) + _, decoded, err := XUpdateDbaasExternalEndpointRsyslog(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -11767,9 +13920,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: "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 $ref: '#/components/schemas/dbaas-endpoint-rsyslog'\ntype: object\n"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { @@ -11778,7 +13931,7 @@ func xRegister(subcommand bool) { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XAttachBlockStorageVolumeToInstance(args[0], params, body) + _, decoded, err := XCreateDbaasExternalEndpointRsyslog(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -11806,18 +13959,14 @@ 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: "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 := XCreateBlockStorageSnapshot(args[0], params, body) + _, decoded, err := XListDbaasExternalEndpointTypes(params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -11845,18 +13994,18 @@ 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: "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) { - 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 := XDetachBlockStorageVolume(args[0], params, body) + _, decoded, err := XAttachDbaasServiceToEndpoint(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -11884,9 +14033,9 @@ 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 format: int64\n minimum: 11\n type: integer\nrequired:\n- size\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) { @@ -11895,7 +14044,7 @@ func xRegister(subcommand bool) { log.Fatal().Err(err).Msg("Unable to get body") } - _, decoded, err := XResizeBlockStorageVolume(args[0], params, body) + _, decoded, err := XDetachDbaasServiceFromEndpoint(args[0], params, body) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -11923,14 +14072,49 @@ 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: "list-dbaas-external-endpoints", + Short: "list-dbaas-external-endpoints", + Long: cli.Markdown("[BETA] List available external endpoints for integrations"), + Example: examples, + Args: cobra.MinimumNArgs(0), + Run: func(cmd *cobra.Command, args []string) { + + _, decoded, err := XListDbaasExternalEndpoints(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-external-integration id", + Short: "get-dbaas-external-integration", + Long: cli.Markdown("[BETA] Get a DBaaS external integration"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XGetConsoleProxyUrl(args[0], params) + _, decoded, err := XGetDbaasExternalIntegration(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -11958,14 +14142,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: "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(0), + Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - _, decoded, err := XGetDbaasCaCertificate(params) + _, decoded, err := XListDbaasExternalIntegrations(args[0], params) if err != nil { log.Fatal().Err(err).Msg("Error calling operation") } @@ -12836,6 +15020,41 @@ func xRegister(subcommand bool) { }() + func() { + params := viper.New() + + var examples string + + cmd := &cobra.Command{ + 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 := XRevealDbaasKafkaConnectPassword(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() @@ -13167,6 +15386,45 @@ func xRegister(subcommand bool) { }() + func() { + params := viper.New() + + 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", + 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 := XEnableDbaasMysqlWrites(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() @@ -19347,7 +21605,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)'\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/labels'\n name:\n description: Nodepool name\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 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'\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)'\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/labels'\n name:\n description: Nodepool name\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"), Example: examples, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { @@ -19456,7 +21714,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)'\n maxLength: 30\n minLength: 1\n type: string\n instance-type:\n $ref: '#/components/schemas/instance-type'\n labels:\n $ref: '#/components/schemas/labels'\n name:\n description: Nodepool name\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 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'\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)'\n maxLength: 30\n minLength: 1\n type: string\n instance-type:\n $ref: '#/components/schemas/instance-type'\n labels:\n $ref: '#/components/schemas/labels'\n name:\n description: Nodepool name\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"), Example: examples, Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) {