diff --git a/managed/src/main/java/com/yugabyte/yw/controllers/ReleasesController.java b/managed/src/main/java/com/yugabyte/yw/controllers/ReleasesController.java index db426227f117..e240a8c564cc 100644 --- a/managed/src/main/java/com/yugabyte/yw/controllers/ReleasesController.java +++ b/managed/src/main/java/com/yugabyte/yw/controllers/ReleasesController.java @@ -48,8 +48,7 @@ @Api( value = "New Release management", - authorizations = @Authorization(AbstractPlatformController.API_KEY_AUTH), - hidden = true) + authorizations = @Authorization(AbstractPlatformController.API_KEY_AUTH)) @Slf4j public class ReleasesController extends AuthenticatedController { @Inject ReleasesUtils releasesUtils; @@ -58,8 +57,7 @@ public class ReleasesController extends AuthenticatedController { value = "Create a release", response = YBPCreateSuccess.class, nickname = "createNewRelease", - notes = "YbaApi Internal new releases list", - hidden = true) // TODO: remove hidden once complete. + notes = "WARNING: This is a preview API that could change: create a ybdb release") @ApiImplicitParams({ @ApiImplicitParam( name = "Release", @@ -74,7 +72,7 @@ public class ReleasesController extends AuthenticatedController { @PermissionAttribute(resourceType = ResourceType.OTHER, action = Action.CREATE), resourceLocation = @Resource(path = Util.CUSTOMERS, sourceType = SourceType.ENDPOINT)) }) - @YbaApi(visibility = YbaApiVisibility.INTERNAL, sinceYBAVersion = "2.21.1.0") + @YbaApi(visibility = YbaApiVisibility.PREVIEW, sinceYBAVersion = "2024.2.0.0") public Result create(UUID customerUUID, Http.Request request) { Customer.getOrBadRequest(customerUUID); CreateRelease reqRelease = @@ -132,15 +130,14 @@ public Result create(UUID customerUUID, Http.Request request) { response = ResponseRelease.class, responseContainer = "List", nickname = "listNewReleases", - notes = "YbaApi Internal new releases list", - hidden = true) // TODO: Remove hidden once complete + notes = "WARNING: This is a preview API that could change: list ybdb releases") @AuthzPath({ @RequiredPermissionOnResource( requiredPermission = - @PermissionAttribute(resourceType = ResourceType.OTHER, action = Action.CREATE), + @PermissionAttribute(resourceType = ResourceType.OTHER, action = Action.READ), resourceLocation = @Resource(path = Util.CUSTOMERS, sourceType = SourceType.ENDPOINT)) }) - @YbaApi(visibility = YbaApiVisibility.INTERNAL, sinceYBAVersion = "2.21.1.0") + @YbaApi(visibility = YbaApiVisibility.PREVIEW, sinceYBAVersion = "2024.2.0.0") public Result list(UUID customerUUID, @Nullable String deploymentType, Http.Request request) { Customer.getOrBadRequest(customerUUID); @@ -181,14 +178,14 @@ public Result list(UUID customerUUID, @Nullable String deploymentType, Http.Requ value = "Get a release", response = ResponseRelease.class, nickname = "getNewRelease", - notes = "YbaApi Internal new release get", - hidden = true) + notes = "WARNING: This is a preview API that could change: get a specific ybdb release") @AuthzPath({ @RequiredPermissionOnResource( requiredPermission = - @PermissionAttribute(resourceType = ResourceType.OTHER, action = Action.CREATE), + @PermissionAttribute(resourceType = ResourceType.OTHER, action = Action.READ), resourceLocation = @Resource(path = Util.CUSTOMERS, sourceType = SourceType.ENDPOINT)) }) + @YbaApi(visibility = YbaApiVisibility.PREVIEW, sinceYBAVersion = "2024.2.0.0") public Result get(UUID customerUUID, UUID releaseUUID, Http.Request request) { Customer.getOrBadRequest(customerUUID); Release release = Release.getOrBadRequest(releaseUUID); @@ -201,14 +198,14 @@ public Result get(UUID customerUUID, UUID releaseUUID, Http.Request request) { value = "delete a release", response = YBPSuccess.class, nickname = "deleteNewRelease", - notes = "YbaApi Internal new release delete", - hidden = true) + notes = "WARNING: This is a preview API that could change: delete a ybdb release") @AuthzPath({ @RequiredPermissionOnResource( requiredPermission = - @PermissionAttribute(resourceType = ResourceType.OTHER, action = Action.CREATE), + @PermissionAttribute(resourceType = ResourceType.OTHER, action = Action.DELETE), resourceLocation = @Resource(path = Util.CUSTOMERS, sourceType = SourceType.ENDPOINT)) }) + @YbaApi(visibility = YbaApiVisibility.PREVIEW, sinceYBAVersion = "2024.2.0.0") public Result delete(UUID customerUUID, UUID releaseUUID, Http.Request request) { Customer.getOrBadRequest(customerUUID); Release release = Release.get(releaseUUID); @@ -235,8 +232,7 @@ public Result delete(UUID customerUUID, UUID releaseUUID, Http.Request request) value = "Update a release", response = YBPSuccess.class, nickname = "updateNewRelease", - notes = "YbaApi Internal new releases update", - hidden = true) // TODO: remove hidden once complete. + notes = "WARNING: This is a preview API that could change: update or edit a ybdb release") @ApiImplicitParams({ @ApiImplicitParam( name = "Release", @@ -248,10 +244,10 @@ public Result delete(UUID customerUUID, UUID releaseUUID, Http.Request request) @AuthzPath({ @RequiredPermissionOnResource( requiredPermission = - @PermissionAttribute(resourceType = ResourceType.OTHER, action = Action.CREATE), + @PermissionAttribute(resourceType = ResourceType.OTHER, action = Action.UPDATE), resourceLocation = @Resource(path = Util.CUSTOMERS, sourceType = SourceType.ENDPOINT)) }) - @YbaApi(visibility = YbaApiVisibility.INTERNAL, sinceYBAVersion = "2.21.1.0") + @YbaApi(visibility = YbaApiVisibility.PREVIEW, sinceYBAVersion = "2024.2.0.0") public Result update(UUID customerUUID, UUID releaseUUID, Http.Request request) { Customer.getOrBadRequest(customerUUID); Release release = Release.getOrBadRequest(releaseUUID); diff --git a/managed/src/main/java/com/yugabyte/yw/controllers/ReleasesExtractMetadataController.java b/managed/src/main/java/com/yugabyte/yw/controllers/ReleasesExtractMetadataController.java index 0203cf09b310..4ed6bf02dc24 100644 --- a/managed/src/main/java/com/yugabyte/yw/controllers/ReleasesExtractMetadataController.java +++ b/managed/src/main/java/com/yugabyte/yw/controllers/ReleasesExtractMetadataController.java @@ -12,6 +12,8 @@ import com.yugabyte.yw.forms.PlatformResults.YBPCreateSuccess; import com.yugabyte.yw.forms.PlatformResults.YBPSuccess; import com.yugabyte.yw.models.Customer; +import com.yugabyte.yw.models.common.YbaApi; +import com.yugabyte.yw.models.common.YbaApi.YbaApiVisibility; import com.yugabyte.yw.rbac.annotations.AuthzPath; import com.yugabyte.yw.rbac.annotations.PermissionAttribute; import com.yugabyte.yw.rbac.annotations.RequiredPermissionOnResource; @@ -37,8 +39,7 @@ @Api( value = "Extract metadata from remote tarball", - authorizations = @Authorization(AbstractPlatformController.API_KEY_AUTH), - hidden = true) + authorizations = @Authorization(AbstractPlatformController.API_KEY_AUTH)) @Slf4j public class ReleasesExtractMetadataController extends AuthenticatedController { @@ -56,8 +57,9 @@ public class ReleasesExtractMetadataController extends AuthenticatedController { value = "helper to extract release metadata from a remote tarball", response = YBPSuccess.class, nickname = "extractMetadata", - notes = "YbaApi Internal extract metadata", - hidden = true) + notes = + "WARNING: This is a preview API that could change: start extracting metadata from a" + + " remote tgz url") @ApiImplicitParams({ @ApiImplicitParam( name = "Release URL", @@ -72,6 +74,7 @@ public class ReleasesExtractMetadataController extends AuthenticatedController { @PermissionAttribute(resourceType = ResourceType.OTHER, action = Action.CREATE), resourceLocation = @Resource(path = Util.CUSTOMERS, sourceType = SourceType.ENDPOINT)) }) + @YbaApi(visibility = YbaApiVisibility.PREVIEW, sinceYBAVersion = "2024.2.0.0") public Result extract_metadata(UUID customerUUID, Http.Request request) { Customer.getOrBadRequest(customerUUID); ExtractMetadata em = @@ -115,14 +118,16 @@ public void run() { value = "get the extract release metadata from a remote tarball", response = ResponseExtractMetadata.class, nickname = "extractMetadata", - notes = "YbaApi Internal extract metadata", - hidden = true) + notes = + "WARNING: This is a preview API that could change: Get extract metadata and its" + + " progress.") @AuthzPath({ @RequiredPermissionOnResource( requiredPermission = - @PermissionAttribute(resourceType = ResourceType.OTHER, action = Action.CREATE), + @PermissionAttribute(resourceType = ResourceType.OTHER, action = Action.READ), resourceLocation = @Resource(path = Util.CUSTOMERS, sourceType = SourceType.ENDPOINT)) }) + @YbaApi(visibility = YbaApiVisibility.PREVIEW, sinceYBAVersion = "2024.2.0.0") public Result getMetadata(UUID customerUUID, UUID metadataUUID, Http.Request request) { ResponseExtractMetadata metadata = metadataMap.get(metadataUUID); Customer.getOrBadRequest(customerUUID); diff --git a/managed/src/main/java/com/yugabyte/yw/controllers/ReleasesUploadController.java b/managed/src/main/java/com/yugabyte/yw/controllers/ReleasesUploadController.java index c313ddfe39bb..5adf57cd2088 100644 --- a/managed/src/main/java/com/yugabyte/yw/controllers/ReleasesUploadController.java +++ b/managed/src/main/java/com/yugabyte/yw/controllers/ReleasesUploadController.java @@ -35,8 +35,7 @@ @Api( value = "Upload Release packages", - authorizations = @Authorization(AbstractPlatformController.API_KEY_AUTH), - hidden = true) + authorizations = @Authorization(AbstractPlatformController.API_KEY_AUTH)) @Slf4j public class ReleasesUploadController extends AuthenticatedController { @@ -52,15 +51,14 @@ public ReleasesUploadController(Config appConfig, ReleasesUtils releasesUtils) { @ApiOperation( value = "upload a release tgz", nickname = "uploadRelease", - notes = "YbaApi Internal upload release", - hidden = true) // TODO: remove hidden once complete. + notes = "WARNING: This is a preview API that could change: upload release tgz file") @AuthzPath({ @RequiredPermissionOnResource( requiredPermission = @PermissionAttribute(resourceType = ResourceType.OTHER, action = Action.CREATE), resourceLocation = @Resource(path = Util.CUSTOMERS, sourceType = SourceType.ENDPOINT)) }) - @YbaApi(visibility = YbaApiVisibility.INTERNAL, sinceYBAVersion = "2.21.1.0") + @YbaApi(visibility = YbaApiVisibility.PREVIEW, sinceYBAVersion = "2024.2.0.0") public Result upload(UUID customerUUID, Http.Request request) { Customer.getOrBadRequest(customerUUID); @@ -98,16 +96,15 @@ public Result upload(UUID customerUUID, Http.Request request) { @ApiOperation( value = "get an uploaded release metadata", nickname = "getUploadRelease", - notes = "YbaApi Internal get uploaded release metadata", - response = ResponseExtractMetadata.class, - hidden = true) // TODO: remove hidden once complete. + notes = "WARNING: This is a preview API that could change: get uploaded release metadata", + response = ResponseExtractMetadata.class) @AuthzPath({ @RequiredPermissionOnResource( requiredPermission = - @PermissionAttribute(resourceType = ResourceType.OTHER, action = Action.CREATE), + @PermissionAttribute(resourceType = ResourceType.OTHER, action = Action.READ), resourceLocation = @Resource(path = Util.CUSTOMERS, sourceType = SourceType.ENDPOINT)) }) - @YbaApi(visibility = YbaApiVisibility.INTERNAL, sinceYBAVersion = "2.21.1.0") + @YbaApi(visibility = YbaApiVisibility.PREVIEW, sinceYBAVersion = "2024.2.0.0") public Result get(UUID customerUUID, UUID fileUUID, Http.Request request) { Customer.getOrBadRequest(customerUUID); ReleaseLocalFile rlf = ReleaseLocalFile.getOrBadRequest(fileUUID); diff --git a/managed/src/main/java/com/yugabyte/yw/controllers/apiModels/ResponseRelease.java b/managed/src/main/java/com/yugabyte/yw/controllers/apiModels/ResponseRelease.java index bbe9677d9217..b644515de075 100644 --- a/managed/src/main/java/com/yugabyte/yw/controllers/apiModels/ResponseRelease.java +++ b/managed/src/main/java/com/yugabyte/yw/controllers/apiModels/ResponseRelease.java @@ -1,8 +1,10 @@ package com.yugabyte.yw.controllers.apiModels; +import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonInclude; import com.yugabyte.yw.cloud.PublicCloudConstants; import com.yugabyte.yw.models.ReleaseArtifact; +import io.swagger.annotations.ApiModelProperty; import java.util.Date; import java.util.List; import java.util.UUID; @@ -33,6 +35,9 @@ public static class Artifact { public static class Universe { public UUID uuid; public String name; + + @ApiModelProperty(value = "Universe creation date", example = "2024-07-28T01:02:03Z") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss'Z'") public Date creation_date; public Universe(UUID uuid, String name, Date creation_date) { diff --git a/managed/src/main/resources/swagger-strict.json b/managed/src/main/resources/swagger-strict.json index ddfeea0c5fc2..88f7508fd6ba 100644 --- a/managed/src/main/resources/swagger-strict.json +++ b/managed/src/main/resources/swagger-strict.json @@ -1338,6 +1338,30 @@ }, "type" : "object" }, + "Artifact" : { + "properties" : { + "architecture" : { + "enum" : [ "x86_64", "aarch64" ], + "type" : "string" + }, + "package_file_id" : { + "format" : "uuid", + "type" : "string" + }, + "package_url" : { + "type" : "string" + }, + "platform" : { + "enum" : [ "LINUX", "KUBERNETES" ], + "type" : "string" + }, + "sha256" : { + "type" : "string" + } + }, + "required" : [ "architecture", "package_file_id", "package_url", "platform", "sha256" ], + "type" : "object" + }, "Audit" : { "description" : "Audit logging for requests and responses", "properties" : { @@ -4072,6 +4096,42 @@ "required" : [ "creatingUser", "platformUrl", "platformVersion", "sleepAfterMasterRestartMillis", "sleepAfterTServerRestartMillis" ], "type" : "object" }, + "CreateRelease" : { + "description" : "Release metadata required to create a new release", + "properties" : { + "artifacts" : { + "items" : { + "$ref" : "#/definitions/Artifact" + }, + "type" : "array" + }, + "release_date_msecs" : { + "format" : "int64", + "type" : "integer" + }, + "release_notes" : { + "type" : "string" + }, + "release_tag" : { + "type" : "string" + }, + "release_type" : { + "type" : "string" + }, + "release_uuid" : { + "format" : "uuid", + "type" : "string" + }, + "version" : { + "type" : "string" + }, + "yb_type" : { + "type" : "string" + } + }, + "required" : [ "artifacts", "release_date_msecs", "release_notes", "release_tag", "release_type", "release_uuid", "version", "yb_type" ], + "type" : "object" + }, "CreateTablespaceParams" : { "properties" : { "tablespaceInfos" : { @@ -5232,6 +5292,20 @@ }, "type" : "object" }, + "ExtractMetadata" : { + "description" : "url to release TGZ to extract metadata from", + "properties" : { + "url" : { + "type" : "string" + }, + "uuid" : { + "format" : "uuid", + "type" : "string" + } + }, + "required" : [ "url", "uuid" ], + "type" : "object" + }, "FailedSubtasks" : { "description" : "Failed Subtasks", "properties" : { @@ -10125,6 +10199,92 @@ "required" : [ "resourceDefinitionSet" ], "type" : "object" }, + "ResponseExtractMetadata" : { + "properties" : { + "architecture" : { + "enum" : [ "x86_64", "aarch64" ], + "type" : "string" + }, + "metadata_uuid" : { + "format" : "uuid", + "type" : "string" + }, + "platform" : { + "enum" : [ "LINUX", "KUBERNETES" ], + "type" : "string" + }, + "release_date_msecs" : { + "format" : "int64", + "type" : "integer" + }, + "release_notes" : { + "type" : "string" + }, + "release_type" : { + "type" : "string" + }, + "sha256" : { + "type" : "string" + }, + "status" : { + "enum" : [ "waiting", "running", "success", "failure" ], + "type" : "string" + }, + "version" : { + "type" : "string" + }, + "yb_type" : { + "enum" : [ "YBDB" ], + "type" : "string" + } + }, + "required" : [ "architecture", "metadata_uuid", "platform", "release_date_msecs", "release_notes", "release_type", "sha256", "status", "version", "yb_type" ], + "type" : "object" + }, + "ResponseRelease" : { + "properties" : { + "artifacts" : { + "items" : { + "$ref" : "#/definitions/Artifact" + }, + "type" : "array" + }, + "release_date_msecs" : { + "format" : "int64", + "type" : "integer" + }, + "release_notes" : { + "type" : "string" + }, + "release_tag" : { + "type" : "string" + }, + "release_type" : { + "type" : "string" + }, + "release_uuid" : { + "format" : "uuid", + "type" : "string" + }, + "state" : { + "type" : "string" + }, + "universes" : { + "items" : { + "$ref" : "#/definitions/Universe" + }, + "type" : "array" + }, + "version" : { + "type" : "string" + }, + "yb_type" : { + "type" : "string" + } + }, + "required" : [ "artifacts", "release_date_msecs", "release_notes", "release_tag", "release_type", "release_uuid", "state", "universes", "version", "yb_type" ], + "type" : "object" + }, "RestartBootstrapParams" : { "description" : "Bootstrap parameters for restarting", "properties" : { @@ -13460,6 +13620,25 @@ "required" : [ "apiToken", "customerUUID", "metricsScrapePeriodSecs", "metricsUrl", "tpUrl", "uuid", "ybaUrl" ], "type" : "object" }, + "Universe" : { + "properties" : { + "creation_date" : { + "description" : "Universe creation date", + "example" : "2024-07-28T01:02:03Z", + "format" : "date-time", + "type" : "string" + }, + "name" : { + "type" : "string" + }, + "uuid" : { + "format" : "uuid", + "type" : "string" + } + }, + "required" : [ "name", "uuid" ], + "type" : "object" + }, "Universe performance advisor status" : { "properties" : { "customerUUID" : { @@ -14476,6 +14655,32 @@ "required" : [ "firstTry", "name", "retryLimit", "sleepMultiplier", "taskInfo" ], "type" : "object" }, + "UpdateRelease" : { + "description" : "Release metadata required to create a new release", + "properties" : { + "artifacts" : { + "items" : { + "$ref" : "#/definitions/Artifact" + }, + "type" : "array" + }, + "release_date" : { + "format" : "int64", + "type" : "integer" + }, + "release_notes" : { + "type" : "string" + }, + "release_tag" : { + "type" : "string" + }, + "state" : { + "type" : "string" + } + }, + "required" : [ "artifacts", "release_date", "release_notes", "release_tag", "state" ], + "type" : "object" + }, "UpgradeTaskParams" : { "properties" : { "allowInsecure" : { @@ -15929,6 +16134,17 @@ }, "type" : "object" }, + "YBPCreateSuccess" : { + "properties" : { + "resourceUUID" : { + "description" : "UUID of the successfully created resource", + "format" : "uuid", + "readOnly" : true, + "type" : "string" + } + }, + "type" : "object" + }, "YBPError" : { "description" : "Generic error response from the YugabyteDB Anywhere API", "properties" : { @@ -27976,6 +28192,402 @@ "tags" : [ "Asynchronous Replication" ] } }, + "/api/v1/customers/{cUUID}/ybdb_release" : { + "get" : { + "description" : "WARNING: This is a preview API that could change: list ybdb releases", + "operationId" : "listNewReleases", + "parameters" : [ { + "format" : "uuid", + "in" : "path", + "name" : "cUUID", + "required" : true, + "type" : "string" + }, { + "default" : "null", + "in" : "query", + "name" : "deployment_type", + "required" : false, + "type" : "string" + }, { + "in" : "query", + "name" : "request", + "required" : false + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "items" : { + "$ref" : "#/definitions/ResponseRelease" + }, + "type" : "array" + } + } + }, + "responsesObject" : { + "200" : { + "description" : "successful operation", + "schema" : { + "items" : { + "$ref" : "#/definitions/ResponseRelease" + }, + "type" : "array" + } + } + }, + "security" : [ { + "apiKeyAuth" : [ ] + } ], + "summary" : "List releases", + "tags" : [ "New Release management" ] + }, + "post" : { + "description" : "WARNING: This is a preview API that could change: create a ybdb release", + "operationId" : "createNewRelease", + "parameters" : [ { + "format" : "uuid", + "in" : "path", + "name" : "cUUID", + "required" : true, + "type" : "string" + }, { + "in" : "query", + "name" : "request", + "required" : false + }, { + "description" : "Release data to be created", + "in" : "body", + "name" : "Release", + "required" : true, + "schema" : { + "$ref" : "#/definitions/CreateRelease" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/YBPCreateSuccess" + } + } + }, + "responsesObject" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/YBPCreateSuccess" + } + } + }, + "security" : [ { + "apiKeyAuth" : [ ] + } ], + "summary" : "Create a release", + "tags" : [ "New Release management" ] + } + }, + "/api/v1/customers/{cUUID}/ybdb_release/extract_metadata" : { + "post" : { + "description" : "WARNING: This is a preview API that could change: start extracting metadata from a remote tgz url", + "operationId" : "extractMetadata", + "parameters" : [ { + "format" : "uuid", + "in" : "path", + "name" : "cUUID", + "required" : true, + "type" : "string" + }, { + "in" : "query", + "name" : "request", + "required" : false + }, { + "description" : "Release URL to extract metadata from", + "in" : "body", + "name" : "Release URL", + "required" : true, + "schema" : { + "$ref" : "#/definitions/ExtractMetadata" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/YBPSuccess" + } + } + }, + "responsesObject" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/YBPSuccess" + } + } + }, + "security" : [ { + "apiKeyAuth" : [ ] + } ], + "summary" : "helper to extract release metadata from a remote tarball", + "tags" : [ "Extract metadata from remote tarball" ] + } + }, + "/api/v1/customers/{cUUID}/ybdb_release/extract_metadata/{rUUID}" : { + "get" : { + "description" : "WARNING: This is a preview API that could change: Get extract metadata and its progress.", + "operationId" : "extractMetadata", + "parameters" : [ { + "format" : "uuid", + "in" : "path", + "name" : "cUUID", + "required" : true, + "type" : "string" + }, { + "format" : "uuid", + "in" : "path", + "name" : "rUUID", + "required" : true, + "type" : "string" + }, { + "in" : "query", + "name" : "request", + "required" : false + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/ResponseExtractMetadata" + } + } + }, + "responsesObject" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/ResponseExtractMetadata" + } + } + }, + "security" : [ { + "apiKeyAuth" : [ ] + } ], + "summary" : "get the extract release metadata from a remote tarball", + "tags" : [ "Extract metadata from remote tarball" ] + } + }, + "/api/v1/customers/{cUUID}/ybdb_release/upload" : { + "post" : { + "description" : "WARNING: This is a preview API that could change: upload release tgz file", + "operationId" : "uploadRelease", + "parameters" : [ { + "format" : "uuid", + "in" : "path", + "name" : "cUUID", + "required" : true, + "type" : "string" + }, { + "in" : "query", + "name" : "request", + "required" : false + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + }, + "responsesObject" : { + "default" : { + "description" : "successful operation" + } + }, + "security" : [ { + "apiKeyAuth" : [ ] + } ], + "summary" : "upload a release tgz", + "tags" : [ "Upload Release packages" ] + } + }, + "/api/v1/customers/{cUUID}/ybdb_release/upload/{rUUID}" : { + "get" : { + "description" : "WARNING: This is a preview API that could change: get uploaded release metadata", + "operationId" : "getUploadRelease", + "parameters" : [ { + "format" : "uuid", + "in" : "path", + "name" : "cUUID", + "required" : true, + "type" : "string" + }, { + "format" : "uuid", + "in" : "path", + "name" : "rUUID", + "required" : true, + "type" : "string" + }, { + "in" : "query", + "name" : "request", + "required" : false + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/ResponseExtractMetadata" + } + } + }, + "responsesObject" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/ResponseExtractMetadata" + } + } + }, + "security" : [ { + "apiKeyAuth" : [ ] + } ], + "summary" : "get an uploaded release metadata", + "tags" : [ "Upload Release packages" ] + } + }, + "/api/v1/customers/{cUUID}/ybdb_release/{rUUID}" : { + "delete" : { + "description" : "WARNING: This is a preview API that could change: delete a ybdb release", + "operationId" : "deleteNewRelease", + "parameters" : [ { + "format" : "uuid", + "in" : "path", + "name" : "cUUID", + "required" : true, + "type" : "string" + }, { + "format" : "uuid", + "in" : "path", + "name" : "rUUID", + "required" : true, + "type" : "string" + }, { + "in" : "query", + "name" : "request", + "required" : false + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/YBPSuccess" + } + } + }, + "responsesObject" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/YBPSuccess" + } + } + }, + "security" : [ { + "apiKeyAuth" : [ ] + } ], + "summary" : "delete a release", + "tags" : [ "New Release management" ] + }, + "get" : { + "description" : "WARNING: This is a preview API that could change: get a specific ybdb release", + "operationId" : "getNewRelease", + "parameters" : [ { + "format" : "uuid", + "in" : "path", + "name" : "cUUID", + "required" : true, + "type" : "string" + }, { + "format" : "uuid", + "in" : "path", + "name" : "rUUID", + "required" : true, + "type" : "string" + }, { + "in" : "query", + "name" : "request", + "required" : false + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/ResponseRelease" + } + } + }, + "responsesObject" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/ResponseRelease" + } + } + }, + "security" : [ { + "apiKeyAuth" : [ ] + } ], + "summary" : "Get a release", + "tags" : [ "New Release management" ] + }, + "put" : { + "description" : "WARNING: This is a preview API that could change: update or edit a ybdb release", + "operationId" : "updateNewRelease", + "parameters" : [ { + "format" : "uuid", + "in" : "path", + "name" : "cUUID", + "required" : true, + "type" : "string" + }, { + "format" : "uuid", + "in" : "path", + "name" : "rUUID", + "required" : true, + "type" : "string" + }, { + "in" : "query", + "name" : "request", + "required" : false + }, { + "description" : "Release data to be updated", + "in" : "body", + "name" : "Release", + "required" : true, + "schema" : { + "$ref" : "#/definitions/UpdateRelease" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/YBPSuccess" + } + } + }, + "responsesObject" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/YBPSuccess" + } + } + }, + "security" : [ { + "apiKeyAuth" : [ ] + } ], + "summary" : "Update a release", + "tags" : [ "New Release management" ] + } + }, "/api/v1/customers/{cUUID}/zones/{azUUID}/nodes" : { "post" : { "description" : "", @@ -28735,6 +29347,8 @@ "name" : "Disaster Recovery" }, { "name" : "Encryption at rest" + }, { + "name" : "Extract metadata from remote tarball" }, { "name" : "Grafana Dashboard" }, { @@ -28753,6 +29367,8 @@ "name" : "Maintenance windows" }, { "name" : "Metrics" + }, { + "name" : "New Release management" }, { "name" : "Node Agents" }, { @@ -28789,6 +29405,8 @@ "name" : "Universe performance suggestions" }, { "name" : "UniverseClusterMutations" + }, { + "name" : "Upload Release packages" }, { "name" : "User management" }, { diff --git a/managed/src/main/resources/swagger.json b/managed/src/main/resources/swagger.json index 7aa55067f307..0192753be567 100644 --- a/managed/src/main/resources/swagger.json +++ b/managed/src/main/resources/swagger.json @@ -1350,6 +1350,30 @@ }, "type" : "object" }, + "Artifact" : { + "properties" : { + "architecture" : { + "enum" : [ "x86_64", "aarch64" ], + "type" : "string" + }, + "package_file_id" : { + "format" : "uuid", + "type" : "string" + }, + "package_url" : { + "type" : "string" + }, + "platform" : { + "enum" : [ "LINUX", "KUBERNETES" ], + "type" : "string" + }, + "sha256" : { + "type" : "string" + } + }, + "required" : [ "architecture", "package_file_id", "package_url", "platform", "sha256" ], + "type" : "object" + }, "Audit" : { "description" : "Audit logging for requests and responses", "properties" : { @@ -4107,6 +4131,42 @@ "required" : [ "creatingUser", "platformUrl", "platformVersion", "sleepAfterMasterRestartMillis", "sleepAfterTServerRestartMillis" ], "type" : "object" }, + "CreateRelease" : { + "description" : "Release metadata required to create a new release", + "properties" : { + "artifacts" : { + "items" : { + "$ref" : "#/definitions/Artifact" + }, + "type" : "array" + }, + "release_date_msecs" : { + "format" : "int64", + "type" : "integer" + }, + "release_notes" : { + "type" : "string" + }, + "release_tag" : { + "type" : "string" + }, + "release_type" : { + "type" : "string" + }, + "release_uuid" : { + "format" : "uuid", + "type" : "string" + }, + "version" : { + "type" : "string" + }, + "yb_type" : { + "type" : "string" + } + }, + "required" : [ "artifacts", "release_date_msecs", "release_notes", "release_tag", "release_type", "release_uuid", "version", "yb_type" ], + "type" : "object" + }, "CreateTablespaceParams" : { "properties" : { "tablespaceInfos" : { @@ -5267,6 +5327,20 @@ }, "type" : "object" }, + "ExtractMetadata" : { + "description" : "url to release TGZ to extract metadata from", + "properties" : { + "url" : { + "type" : "string" + }, + "uuid" : { + "format" : "uuid", + "type" : "string" + } + }, + "required" : [ "url", "uuid" ], + "type" : "object" + }, "FailedSubtasks" : { "description" : "Failed Subtasks", "properties" : { @@ -10229,6 +10303,92 @@ "required" : [ "resourceDefinitionSet" ], "type" : "object" }, + "ResponseExtractMetadata" : { + "properties" : { + "architecture" : { + "enum" : [ "x86_64", "aarch64" ], + "type" : "string" + }, + "metadata_uuid" : { + "format" : "uuid", + "type" : "string" + }, + "platform" : { + "enum" : [ "LINUX", "KUBERNETES" ], + "type" : "string" + }, + "release_date_msecs" : { + "format" : "int64", + "type" : "integer" + }, + "release_notes" : { + "type" : "string" + }, + "release_type" : { + "type" : "string" + }, + "sha256" : { + "type" : "string" + }, + "status" : { + "enum" : [ "waiting", "running", "success", "failure" ], + "type" : "string" + }, + "version" : { + "type" : "string" + }, + "yb_type" : { + "enum" : [ "YBDB" ], + "type" : "string" + } + }, + "required" : [ "architecture", "metadata_uuid", "platform", "release_date_msecs", "release_notes", "release_type", "sha256", "status", "version", "yb_type" ], + "type" : "object" + }, + "ResponseRelease" : { + "properties" : { + "artifacts" : { + "items" : { + "$ref" : "#/definitions/Artifact" + }, + "type" : "array" + }, + "release_date_msecs" : { + "format" : "int64", + "type" : "integer" + }, + "release_notes" : { + "type" : "string" + }, + "release_tag" : { + "type" : "string" + }, + "release_type" : { + "type" : "string" + }, + "release_uuid" : { + "format" : "uuid", + "type" : "string" + }, + "state" : { + "type" : "string" + }, + "universes" : { + "items" : { + "$ref" : "#/definitions/Universe" + }, + "type" : "array" + }, + "version" : { + "type" : "string" + }, + "yb_type" : { + "type" : "string" + } + }, + "required" : [ "artifacts", "release_date_msecs", "release_notes", "release_tag", "release_type", "release_uuid", "state", "universes", "version", "yb_type" ], + "type" : "object" + }, "RestartBootstrapParams" : { "description" : "Bootstrap parameters for restarting", "properties" : { @@ -13568,6 +13728,25 @@ "required" : [ "apiToken", "customerUUID", "metricsScrapePeriodSecs", "metricsUrl", "tpUrl", "uuid", "ybaUrl" ], "type" : "object" }, + "Universe" : { + "properties" : { + "creation_date" : { + "description" : "Universe creation date", + "example" : "2024-07-28T01:02:03Z", + "format" : "date-time", + "type" : "string" + }, + "name" : { + "type" : "string" + }, + "uuid" : { + "format" : "uuid", + "type" : "string" + } + }, + "required" : [ "name", "uuid" ], + "type" : "object" + }, "Universe performance advisor status" : { "properties" : { "customerUUID" : { @@ -14584,6 +14763,32 @@ "required" : [ "firstTry", "name", "retryLimit", "sleepMultiplier", "taskInfo" ], "type" : "object" }, + "UpdateRelease" : { + "description" : "Release metadata required to create a new release", + "properties" : { + "artifacts" : { + "items" : { + "$ref" : "#/definitions/Artifact" + }, + "type" : "array" + }, + "release_date" : { + "format" : "int64", + "type" : "integer" + }, + "release_notes" : { + "type" : "string" + }, + "release_tag" : { + "type" : "string" + }, + "state" : { + "type" : "string" + } + }, + "required" : [ "artifacts", "release_date", "release_notes", "release_tag", "state" ], + "type" : "object" + }, "UpgradeTaskParams" : { "properties" : { "allowInsecure" : { @@ -16078,6 +16283,17 @@ }, "type" : "object" }, + "YBPCreateSuccess" : { + "properties" : { + "resourceUUID" : { + "description" : "UUID of the successfully created resource", + "format" : "uuid", + "readOnly" : true, + "type" : "string" + } + }, + "type" : "object" + }, "YBPError" : { "description" : "Generic error response from the YugabyteDB Anywhere API", "properties" : { @@ -29484,6 +29700,402 @@ "tags" : [ "Asynchronous Replication" ] } }, + "/api/v1/customers/{cUUID}/ybdb_release" : { + "get" : { + "description" : "WARNING: This is a preview API that could change: list ybdb releases", + "operationId" : "listNewReleases", + "parameters" : [ { + "format" : "uuid", + "in" : "path", + "name" : "cUUID", + "required" : true, + "type" : "string" + }, { + "default" : "null", + "in" : "query", + "name" : "deployment_type", + "required" : false, + "type" : "string" + }, { + "in" : "query", + "name" : "request", + "required" : false + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "items" : { + "$ref" : "#/definitions/ResponseRelease" + }, + "type" : "array" + } + } + }, + "responsesObject" : { + "200" : { + "description" : "successful operation", + "schema" : { + "items" : { + "$ref" : "#/definitions/ResponseRelease" + }, + "type" : "array" + } + } + }, + "security" : [ { + "apiKeyAuth" : [ ] + } ], + "summary" : "List releases", + "tags" : [ "New Release management" ] + }, + "post" : { + "description" : "WARNING: This is a preview API that could change: create a ybdb release", + "operationId" : "createNewRelease", + "parameters" : [ { + "format" : "uuid", + "in" : "path", + "name" : "cUUID", + "required" : true, + "type" : "string" + }, { + "in" : "query", + "name" : "request", + "required" : false + }, { + "description" : "Release data to be created", + "in" : "body", + "name" : "Release", + "required" : true, + "schema" : { + "$ref" : "#/definitions/CreateRelease" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/YBPCreateSuccess" + } + } + }, + "responsesObject" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/YBPCreateSuccess" + } + } + }, + "security" : [ { + "apiKeyAuth" : [ ] + } ], + "summary" : "Create a release", + "tags" : [ "New Release management" ] + } + }, + "/api/v1/customers/{cUUID}/ybdb_release/extract_metadata" : { + "post" : { + "description" : "WARNING: This is a preview API that could change: start extracting metadata from a remote tgz url", + "operationId" : "extractMetadata", + "parameters" : [ { + "format" : "uuid", + "in" : "path", + "name" : "cUUID", + "required" : true, + "type" : "string" + }, { + "in" : "query", + "name" : "request", + "required" : false + }, { + "description" : "Release URL to extract metadata from", + "in" : "body", + "name" : "Release URL", + "required" : true, + "schema" : { + "$ref" : "#/definitions/ExtractMetadata" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/YBPSuccess" + } + } + }, + "responsesObject" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/YBPSuccess" + } + } + }, + "security" : [ { + "apiKeyAuth" : [ ] + } ], + "summary" : "helper to extract release metadata from a remote tarball", + "tags" : [ "Extract metadata from remote tarball" ] + } + }, + "/api/v1/customers/{cUUID}/ybdb_release/extract_metadata/{rUUID}" : { + "get" : { + "description" : "WARNING: This is a preview API that could change: Get extract metadata and its progress.", + "operationId" : "extractMetadata", + "parameters" : [ { + "format" : "uuid", + "in" : "path", + "name" : "cUUID", + "required" : true, + "type" : "string" + }, { + "format" : "uuid", + "in" : "path", + "name" : "rUUID", + "required" : true, + "type" : "string" + }, { + "in" : "query", + "name" : "request", + "required" : false + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/ResponseExtractMetadata" + } + } + }, + "responsesObject" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/ResponseExtractMetadata" + } + } + }, + "security" : [ { + "apiKeyAuth" : [ ] + } ], + "summary" : "get the extract release metadata from a remote tarball", + "tags" : [ "Extract metadata from remote tarball" ] + } + }, + "/api/v1/customers/{cUUID}/ybdb_release/upload" : { + "post" : { + "description" : "WARNING: This is a preview API that could change: upload release tgz file", + "operationId" : "uploadRelease", + "parameters" : [ { + "format" : "uuid", + "in" : "path", + "name" : "cUUID", + "required" : true, + "type" : "string" + }, { + "in" : "query", + "name" : "request", + "required" : false + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + }, + "responsesObject" : { + "default" : { + "description" : "successful operation" + } + }, + "security" : [ { + "apiKeyAuth" : [ ] + } ], + "summary" : "upload a release tgz", + "tags" : [ "Upload Release packages" ] + } + }, + "/api/v1/customers/{cUUID}/ybdb_release/upload/{rUUID}" : { + "get" : { + "description" : "WARNING: This is a preview API that could change: get uploaded release metadata", + "operationId" : "getUploadRelease", + "parameters" : [ { + "format" : "uuid", + "in" : "path", + "name" : "cUUID", + "required" : true, + "type" : "string" + }, { + "format" : "uuid", + "in" : "path", + "name" : "rUUID", + "required" : true, + "type" : "string" + }, { + "in" : "query", + "name" : "request", + "required" : false + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/ResponseExtractMetadata" + } + } + }, + "responsesObject" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/ResponseExtractMetadata" + } + } + }, + "security" : [ { + "apiKeyAuth" : [ ] + } ], + "summary" : "get an uploaded release metadata", + "tags" : [ "Upload Release packages" ] + } + }, + "/api/v1/customers/{cUUID}/ybdb_release/{rUUID}" : { + "delete" : { + "description" : "WARNING: This is a preview API that could change: delete a ybdb release", + "operationId" : "deleteNewRelease", + "parameters" : [ { + "format" : "uuid", + "in" : "path", + "name" : "cUUID", + "required" : true, + "type" : "string" + }, { + "format" : "uuid", + "in" : "path", + "name" : "rUUID", + "required" : true, + "type" : "string" + }, { + "in" : "query", + "name" : "request", + "required" : false + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/YBPSuccess" + } + } + }, + "responsesObject" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/YBPSuccess" + } + } + }, + "security" : [ { + "apiKeyAuth" : [ ] + } ], + "summary" : "delete a release", + "tags" : [ "New Release management" ] + }, + "get" : { + "description" : "WARNING: This is a preview API that could change: get a specific ybdb release", + "operationId" : "getNewRelease", + "parameters" : [ { + "format" : "uuid", + "in" : "path", + "name" : "cUUID", + "required" : true, + "type" : "string" + }, { + "format" : "uuid", + "in" : "path", + "name" : "rUUID", + "required" : true, + "type" : "string" + }, { + "in" : "query", + "name" : "request", + "required" : false + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/ResponseRelease" + } + } + }, + "responsesObject" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/ResponseRelease" + } + } + }, + "security" : [ { + "apiKeyAuth" : [ ] + } ], + "summary" : "Get a release", + "tags" : [ "New Release management" ] + }, + "put" : { + "description" : "WARNING: This is a preview API that could change: update or edit a ybdb release", + "operationId" : "updateNewRelease", + "parameters" : [ { + "format" : "uuid", + "in" : "path", + "name" : "cUUID", + "required" : true, + "type" : "string" + }, { + "format" : "uuid", + "in" : "path", + "name" : "rUUID", + "required" : true, + "type" : "string" + }, { + "in" : "query", + "name" : "request", + "required" : false + }, { + "description" : "Release data to be updated", + "in" : "body", + "name" : "Release", + "required" : true, + "schema" : { + "$ref" : "#/definitions/UpdateRelease" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/YBPSuccess" + } + } + }, + "responsesObject" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/YBPSuccess" + } + } + }, + "security" : [ { + "apiKeyAuth" : [ ] + } ], + "summary" : "Update a release", + "tags" : [ "New Release management" ] + } + }, "/api/v1/customers/{cUUID}/zones/{azUUID}/nodes" : { "post" : { "description" : "", @@ -30243,6 +30855,8 @@ "name" : "Disaster Recovery" }, { "name" : "Encryption at rest" + }, { + "name" : "Extract metadata from remote tarball" }, { "name" : "Grafana Dashboard" }, { @@ -30261,6 +30875,8 @@ "name" : "Maintenance windows" }, { "name" : "Metrics" + }, { + "name" : "New Release management" }, { "name" : "Node Agents" }, { @@ -30299,6 +30915,8 @@ "name" : "Universe performance suggestions" }, { "name" : "UniverseClusterMutations" + }, { + "name" : "Upload Release packages" }, { "name" : "User management" }, {