Yandex Cloud
  • Сервисы
  • Решения
  • Почему Yandex Cloud
  • Сообщество
  • Тарифы
  • Документация
  • Связаться с нами
Подключиться
Language / Region
© 2022 ООО «Яндекс.Облако»
Yandex Managed Service for SQL Server™
  • Начало работы
  • Пошаговые инструкции
    • Все инструкции
    • Информация об имеющихся кластерах
    • Создание кластера
    • Подключение к базе данных
    • Остановка и запуск кластера
    • Изменение настроек кластера и базы данных
    • Управление хостами SQL Server
    • Управление базами данных
    • Управление пользователями
    • Управление пользовательскими сеансами
    • Назначение привилегий и ролей
    • Управление резервными копиями
    • Удаление кластера
    • Диагностика производительности
    • Обслуживание баз данных
    • Мониторинг состояния кластера и хостов
  • Практические руководства
    • Все руководства
    • Миграция базы данных в Managed Service for Microsoft SQL Server
  • Концепции
    • Взаимосвязь ресурсов сервиса
    • Классы хостов
    • Сеть в Managed Service for SQL Server
    • Квоты и лимиты
    • Типы хранилища
    • Резервные копии
    • Репликация
    • Техническое обслуживание
    • Настройки SQL Server
    • Доступ к компонентам SQL Server
  • Управление доступом
  • Правила тарификации
  • Справочник API
    • Аутентификация в API
    • gRPC (англ.)
      • Overview
      • BackupService
      • ClusterService
      • DatabaseService
      • ResourcePresetService
      • UserService
      • OperationService
    • REST (англ.)
      • Overview
      • Backup
        • Overview
        • get
        • list
      • Cluster
        • Overview
        • backup
        • create
        • delete
        • get
        • list
        • listBackups
        • listHosts
        • listLogs
        • listOperations
        • move
        • restore
        • start
        • startFailover
        • stop
        • update
      • Database
        • Overview
        • create
        • delete
        • exportBackup
        • get
        • importBackup
        • list
        • restore
      • ResourcePreset
        • Overview
        • get
        • list
      • User
        • Overview
        • create
        • delete
        • get
        • grantPermission
        • list
        • revokePermission
        • update
      • Operation
        • Overview
        • get
  • История изменений
  • Вопросы и ответы
    • Общие вопросы
  1. Справочник API
  2. REST (англ.)
  3. Cluster
  4. restore

Method restore

Статья создана
Yandex Cloud
  • HTTP request
  • Body parameters
  • Response

Creates a new SQL Server cluster using the specified backup.

HTTP request

POST https://mdb.api.cloud.yandex.net/mdb/sqlserver/v1/clusters:restore

Body parameters

{
  "backupId": "string",
  "time": "string",
  "name": "string",
  "description": "string",
  "labels": "object",
  "environment": "string",
  "configSpec": {
    "version": "string",
    "resources": {
      "resourcePresetId": "string",
      "diskSize": "string",
      "diskTypeId": "string"
    },
    "backupWindowStart": {
      "hours": "integer",
      "minutes": "integer",
      "seconds": "integer",
      "nanos": "integer"
    },
    "access": {
      "dataLens": true,
      "webSql": true
    },

    // `configSpec` includes only one of the fields `sqlserverConfig_2016Sp2Std`, `sqlserverConfig_2016Sp2Ent`
    "sqlserverConfig_2016Sp2Std": {
      "maxDegreeOfParallelism": "integer",
      "costThresholdForParallelism": "integer",
      "auditLevel": "integer",
      "fillFactorPercent": "integer",
      "optimizeForAdHocWorkloads": true
    },
    "sqlserverConfig_2016Sp2Ent": {
      "maxDegreeOfParallelism": "integer",
      "costThresholdForParallelism": "integer",
      "auditLevel": "integer",
      "fillFactorPercent": "integer",
      "optimizeForAdHocWorkloads": true
    },
    // end of the list of possible fields`configSpec`

  },
  "hostSpecs": [
    {
      "zoneId": "string",
      "subnetId": "string",
      "assignPublicIp": true
    }
  ],
  "networkId": "string",
  "folderId": "string",
  "securityGroupIds": [
    "string"
  ],
  "deletionProtection": true,
  "hostGroupIds": [
    "string"
  ],
  "serviceAccountId": "string"
}
Field Description
backupId string

Required. ID of the backup to create a new cluster from.

To get the backup ID, use a listBackups request.

time string (date-time)

Required. Timestamp of the moment to which the SQL Server cluster should be restored.

String in RFC3339 text format.

name string

Required. Name of the new SQL Server cluster to be created from the backup. The name must be unique within the folder.

Value must match the regular expression [a-zA-Z0-9_-]*.

description string

Description of the new SQL Server cluster to be created from the backup.

The maximum string length in characters is 256.

labels object

Custom labels for the new SQL Server cluster to be created from the backup as key:value pairs. Maximum 64 per resource. For example, "project": "mvp" or "source": "dictionary".

No more than 64 per resource. The string length in characters for each key must be 1-63. Each key must match the regular expression [a-z][-_0-9a-z]*. The maximum string length in characters for each value is 63. Each value must match the regular expression [-_0-9a-z]*.

environment string

Deployment environment of the new SQL Server cluster to be created from the backup.

  • PRODUCTION: Stable environment with a conservative update policy: only hotfixes are applied during regular maintenance.
  • PRESTABLE: Environment with more aggressive update policy: new versions are rolled out irrespective of backward compatibility.
configSpec object

Configuration for the new SQL Server cluster to be created from the backup.

configSpec.
version
string

Version of SQL Server used in the cluster.

Possible values:

  • 2016sp2
configSpec.
resources
object
Resources allocated to SQL Server hosts.
configSpec.
resources.
resourcePresetId
string

ID of the preset for computational resources available to a host (CPU, memory etc.). All available presets are listed in the documentation.

configSpec.
resources.
diskSize
string (int64)

Volume of the storage available to a host.

configSpec.
resources.
diskTypeId
string

Type of the storage environment for the host.

Possible values:

  • network-hdd - network HDD drive,
  • network-ssd - network SSD drive,
  • local-ssd - local SSD storage.
configSpec.
backupWindowStart
object
Start time for the daily backup in UTC timezone

Represents a time of day. The date and time zone are either not significant or are specified elsewhere. An API may choose to allow leap seconds. Related types are google.type.Date and google.protobuf.Timestamp.

configSpec.
backupWindowStart.
hours
integer (int32)

Hours of day in 24 hour format. Should be from 0 to 23. An API may choose to allow the value "24:00:00" for scenarios like business closing time.

configSpec.
backupWindowStart.
minutes
integer (int32)

Minutes of hour of day. Must be from 0 to 59.

configSpec.
backupWindowStart.
seconds
integer (int32)

Seconds of minutes of the time. Must normally be from 0 to 59. An API may allow the value 60 if it allows leap-seconds.

configSpec.
backupWindowStart.
nanos
integer (int32)

Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999.

configSpec.
access
object
Access policy to DB
configSpec.
access.
dataLens
boolean (boolean)

Allow access for DataLens

configSpec.
access.
webSql
boolean (boolean)

Allow access for Web SQL.

configSpec.
sqlserverConfig_2016Sp2Std
object
Configuration for an SQL Server 2016 SP2 Standard edition cluster.
configSpec includes only one of the fields sqlserverConfig_2016Sp2Std, sqlserverConfig_2016Sp2Ent

SQL Server 2016 SP2 Standard edition supported configuration options are listed here.

Detailed description for each set of options is available in SQL Server documentation.

Any options that are not listed here are not supported.

configSpec.
sqlserverConfig_2016Sp2Std.
maxDegreeOfParallelism
integer (int64)

Limits the number of processors to use in parallel plan execution per task.

See in-depth description in SQL Server documentation.

Acceptable values are 1 to 99, inclusive.

configSpec.
sqlserverConfig_2016Sp2Std.
costThresholdForParallelism
integer (int64)

Specifies the threshold at which SQL Server creates and runs parallel plans for queries.

SQL Server creates and runs a parallel plan for a query only when the estimated cost to run a serial plan for the same query is higher than the value of the option.

See in-depth description in SQL Server documentation.

Acceptable values are 5 to 32767, inclusive.

configSpec.
sqlserverConfig_2016Sp2Std.
auditLevel
integer (int64)

Describes how to configure login auditing to monitor SQL Server Database Engine login activity. Possible values:

  • 0 - do not log login attempts,
  • 1 - log only failed login attempts,
  • 2 - log only successful login attempts (not recommended),
  • 3 - log all login attempts (not recommended).

See in-depth description in SQL Server documentation.

Acceptable values are 0 to 3, inclusive.

configSpec.
sqlserverConfig_2016Sp2Std.
fillFactorPercent
integer (int64)

Manages the fill factor server configuration option. When an index is created or rebuilt the fill factor determines the percentage of space on each index leaf-level page to be filled with data, reserving the rest as free space for future growth.

Values 0 and 100 mean full page usage (no space reserved).

See in-depth description in SQL Server documentation.

Acceptable values are 0 to 100, inclusive.

configSpec.
sqlserverConfig_2016Sp2Std.
optimizeForAdHocWorkloads
boolean (boolean)

Determines whether plans should be cached only after second execution. Allows to avoid SQL cache bloat because of single-use plans.

See in-depth description in SQL Server documentation.

configSpec.
sqlserverConfig_2016Sp2Ent
object
Configuration for an SQL Server 2016 SP2 Enterprise edition cluster.
configSpec includes only one of the fields sqlserverConfig_2016Sp2Std, sqlserverConfig_2016Sp2Ent

SQL Server 2016 SP2 Enterprise edition supported configuration options are listed here.

Detailed description for each set of options is available in SQL Server documentation.

Any options that are not listed here are not supported.

configSpec.
sqlserverConfig_2016Sp2Ent.
maxDegreeOfParallelism
integer (int64)

Limits the number of processors to use in parallel plan execution per task.

See in-depth description in SQL Server documentation.

Acceptable values are 1 to 99, inclusive.

configSpec.
sqlserverConfig_2016Sp2Ent.
costThresholdForParallelism
integer (int64)

Specifies the threshold at which SQL Server creates and runs parallel plans for queries.

SQL Server creates and runs a parallel plan for a query only when the estimated cost to run a serial plan for the same query is higher than the value of the option.

See in-depth description in SQL Server documentation.

Acceptable values are 5 to 32767, inclusive.

configSpec.
sqlserverConfig_2016Sp2Ent.
auditLevel
integer (int64)

Describes how to configure login auditing to monitor SQL Server Database Engine login activity. Possible values:

  • 0 - do not log login attempts,
  • 1 - log only failed login attempts,
  • 2 - log only successful login attempts (not recommended),
  • 3 - log all login attempts (not recommended).

See in-depth description in SQL Server documentation.

Acceptable values are 0 to 3, inclusive.

configSpec.
sqlserverConfig_2016Sp2Ent.
fillFactorPercent
integer (int64)

Manages the fill factor server configuration option. When an index is created or rebuilt the fill factor determines the percentage of space on each index leaf-level page to be filled with data, reserving the rest as free space for future growth.

Values 0 and 100 mean full page usage (no space reserved).

See in-depth description in SQL Server documentation.

Acceptable values are 0 to 100, inclusive.

configSpec.
sqlserverConfig_2016Sp2Ent.
optimizeForAdHocWorkloads
boolean (boolean)

Determines whether plans should be cached only after second execution. Allows to avoid SQL cache bloat because of single-use plans.

See in-depth description in SQL Server documentation.

hostSpecs[] object

Configurations for SQL Server hosts that should be added to the cluster being created from the backup.

hostSpecs[].
zoneId
string

ID of the availability zone where the host resides.

To get the list of available zones, use the list request.

The maximum string length in characters is 50.

hostSpecs[].
subnetId
string

ID of the subnet that the host should belong to. This subnet should be a part of the network that the cluster belongs to. The ID of the network is set in the field Cluster.networkId.

The maximum string length in characters is 50.

hostSpecs[].
assignPublicIp
boolean (boolean)

Whether the host should get a public IP address on creation.

After a host has been created, this setting cannot be changed. To remove an assigned public IP, or to assign a public IP to a host without one, recreate the host with assignPublicIp set as needed.

Possible values:

  • false - don't assign a public IP to the host.
  • true - the host should have a public IP address.
networkId string

ID of the network to create the SQL Server cluster in.

The maximum string length in characters is 50.

folderId string

ID of the folder to create the SQL Server cluster in.

To get the folder ID, use a list request.

The maximum string length in characters is 50.

securityGroupIds[] string

User security groups

deletionProtection boolean (boolean)

Deletion Protection inhibits deletion of the cluster

hostGroupIds[] string

Host groups hosting VMs of the cluster.

serviceAccountId string

ID of the service account used for access to Yandex Object Storage.

Response

HTTP Code: 200 - OK

{
  "id": "string",
  "description": "string",
  "createdAt": "string",
  "createdBy": "string",
  "modifiedAt": "string",
  "done": true,
  "metadata": "object",

  //  includes only one of the fields `error`, `response`
  "error": {
    "code": "integer",
    "message": "string",
    "details": [
      "object"
    ]
  },
  "response": "object",
  // end of the list of possible fields

}

An Operation resource. For more information, see Operation.

Field Description
id string

ID of the operation.

description string

Description of the operation. 0-256 characters long.

createdAt string (date-time)

Creation timestamp.

String in RFC3339 text format.

createdBy string

ID of the user or service account who initiated the operation.

modifiedAt string (date-time)

The time when the Operation resource was last modified.

String in RFC3339 text format.

done boolean (boolean)

If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.

metadata object

Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any.

error object
The error result of the operation in case of failure or cancellation.
includes only one of the fields error, response

The error result of the operation in case of failure or cancellation.

error.
code
integer (int32)

Error code. An enum value of google.rpc.Code.

error.
message
string

An error message.

error.
details[]
object

A list of messages that carry the error details.

response object
includes only one of the fields error, response

The normal response of the operation in case of success. If the original method returns no data on success, such as Delete, the response is google.protobuf.Empty. If the original method is the standard Create/Update, the response should be the target resource of the operation. Any method that returns a long-running operation should document the response type, if any.

Была ли статья полезна?

Language / Region
© 2022 ООО «Яндекс.Облако»
В этой статье:
  • HTTP request
  • Body parameters
  • Response