Skip to content

Commit

Permalink
add automigration
Browse files Browse the repository at this point in the history
  • Loading branch information
nasc17 committed Sep 24, 2024
1 parent 651a75c commit d4230a2
Show file tree
Hide file tree
Showing 4 changed files with 539 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,165 @@
}
}
}
},
"/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/locations/{locationName}/getAutoMigrationFreeSlots": {
"post": {
"summary": "Get auto migration available/free slots",
"description": "This method gets the available slots for auto migration for a given single server resource id",
"tags": [
"Migrations"
],
"operationId": "GetAutoMigrationFreeSlots_List",
"x-ms-examples": {
"GetAutoMigrationFreeSlots": {
"$ref": "./examples/Migrations_GetAutoMigrationFreeSlots.json"
}
},
"parameters": [
{
"$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter"
},
{
"$ref": "#/parameters/TargetDbServerSubscriptionIdParameter"
},
{
"$ref": "../../../types/common-types.json#/parameters/LocationNameParameter"
},
{
"name": "migrationScheduleTimeRange",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/AutoMigrationScheduleTimeRange"
},
"description": "The required parameters for getting available/free slots for auto migration."
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/FreeSlotsListResult"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse"
}
}
}
}
},
"/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/locations/{locationName}/getLatestAutoMigrationSchedule": {
"post": {
"summary": "Get latest auto migration schedule",
"description": "This method gets the latest auto migration schedule for a given single server resource id",
"tags": [
"Migrations"
],
"operationId": "GetLatestAutoMigrationSchedule",
"x-ms-examples": {
"GetLatestAutoMigrationSchedule": {
"$ref": "./examples/Migrations_GetLatestAutoMigrationSchedule.json"
}
},
"parameters": [
{
"$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter"
},
{
"$ref": "#/parameters/TargetDbServerSubscriptionIdParameter"
},
{
"$ref": "../../../types/common-types.json#/parameters/LocationNameParameter"
},
{
"name": "migrationScheduleResource",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/AutoMigrationScheduleResource"
},
"description": "The schedule details containing source server details to fetch the latest schedule."
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/AutoMigrationScheduleResource"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse"
}
}
}
}
},
"/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/locations/{locationName}/updateAutoMigrationSchedule": {
"post": {
"summary": "Update auto migration schedule",
"description": "This method updates the auto migration schedule for a given single server resource id",
"tags": [
"Migrations"
],
"operationId": "UpdateAutoMigrationSchedule",
"x-ms-examples": {
"UpdateAutoMigrationSchedule": {
"$ref": "./examples/Migrations_Update_AutoMigrationSchedule.json"
}
},
"parameters": [
{
"$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter"
},
{
"$ref": "#/parameters/TargetDbServerSubscriptionIdParameter"
},
{
"$ref": "../../../types/common-types.json#/parameters/LocationNameParameter"
},
{
"name": "migrationScheduleResource",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/AutoMigrationScheduleResource"
},
"description": "The schedule details containing source server details to fetch the latest schedule."
}
],
"responses": {
"202": {
"description": "Accepted",
"headers": {
"Location": {
"type": "string"
}
}
},
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/AutoMigrationScheduleResource"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse"
}
}
},
"x-ms-long-running-operation": true,
"x-ms-long-running-operation-options": {
"final-state-via": "location"
}
}
}
},
"definitions": {
Expand Down Expand Up @@ -1237,6 +1396,110 @@
}
},
"description": "Represents a migration name's availability."
},
"AutoMigrationScheduleTimeRange": {
"type": "object",
"properties": {
"startTimeInUtc": {
"format": "date-time",
"type": "string",
"description": "Start time in UTC for migration window"
},
"endTimeInUtc": {
"format": "date-time",
"type": "string",
"description": "End time in UTC for migration window"
}
},
"description": "The time range between which the slots are required for."
},
"FreeSlotsListResult": {
"type": "object",
"properties": {
"value": {
"type": "array",
"items": {
"$ref": "#/definitions/FreeSlotsResult"
},
"readOnly": true,
"description": "A list of available/free slot dates.",
"x-ms-identifiers": []
},
"nextLink": {
"description": "The link used to get the next page of free slot dates.",
"type": "string",
"readOnly": true
}
},
"description": "A list of available/free slot dates."
},
"FreeSlotsResult": {
"type": "object",
"properties": {
"slotDate": {
"type": "string",
"description": "Date where there are slots available",
"readOnly": true
},
"timeSlots": {
"description": "A list of available/free slots.",
"type": "array",
"items": {
"$ref": "#/definitions/AutoMigrationScheduleTimeRange"
},
"readOnly": true,
"x-ms-identifiers": []
}
},
"description": "Capability for the PostgreSQL server"
},
"AutoMigrationScheduleResource": {
"type": "object",
"properties": {
"sourceDbServerResourceId": {
"type": "string",
"description": "The Resource ID for the single server"
},
"autoMigrationStartTimeInUtc": {
"type": "string",
"format": "date-time",
"description": "The auto migration schedule start time in UTC."
},
"autoMigrationEndTimeInUtc": {
"type": "string",
"format": "date-time",
"description": "The auto migration schedule end time in UTC."
},
"autoMigrationScheduleCreateTimeInUtc": {
"type": "string",
"format": "date-time",
"description": "The schedule create time in UTC"
},
"migrationName": {
"type": "string",
"description": "The migration name if the migration has started."
},
"scheduleId": {
"type": "string",
"pattern": "([a-z0-9]){8,8}[-]([a-z0-9]){4,4}[-]([a-z0-9]){4,4}[-]([a-z0-9]){4,4}[-]([a-z0-9]){12,12}",
"description": "The automigration schedule id"
},
"scheduleState": {
"enum": [
"InProgress",
"Canceled",
"Failed",
"Succeeded"
],
"type": "string",
"description": "The automigration schedule state.",
"x-ms-enum": {
"name": "ScheduleState",
"modelAsString": true
}
}
},
"description": "The schedule details containing source server details to fetch the latest schedule for."
}
},
"parameters": {
Expand Down
Loading

0 comments on commit d4230a2

Please sign in to comment.