|
| 1 | +--- |
| 2 | +name: cloud-sql-sqlserver-admin |
| 3 | +description: Use these skills when you need to provision new Cloud SQL for SQL Server instances, create databases and users, clone existing environments, and monitor the progress of long-running operations. |
| 4 | +--- |
| 5 | + |
| 6 | +## Usage |
| 7 | + |
| 8 | +All scripts can be executed using Node.js. Replace `<param_name>` and `<param_value>` with actual values. |
| 9 | + |
| 10 | +**Bash:** |
| 11 | +`node <skill_dir>/scripts/<script_name>.js '{"<param_name>": "<param_value>"}'` |
| 12 | + |
| 13 | +**PowerShell:** |
| 14 | +`node <skill_dir>/scripts/<script_name>.js '{\"<param_name>\": \"<param_value>\"}'` |
| 15 | + |
| 16 | +Note: The scripts automatically load the environment variables from various .env files. Do not ask the user to set vars unless skill executions fails due to env var absence. |
| 17 | + |
| 18 | + |
| 19 | +## Scripts |
| 20 | + |
| 21 | + |
| 22 | +### create_database |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | +#### Parameters |
| 27 | + |
| 28 | +| Name | Type | Description | Required | Default | |
| 29 | +| :--- | :--- | :--- | :--- | :--- | |
| 30 | +| project | string | The GCP project ID. This is pre-configured; do not ask for it unless the user explicitly provides a different one. | No | | |
| 31 | +| instance | string | The ID of the instance where the database will be created. | Yes | | |
| 32 | +| name | string | The name for the new database. Must be unique within the instance. | Yes | | |
| 33 | + |
| 34 | + |
| 35 | +--- |
| 36 | + |
| 37 | +### create_instance |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | +#### Parameters |
| 42 | + |
| 43 | +| Name | Type | Description | Required | Default | |
| 44 | +| :--- | :--- | :--- | :--- | :--- | |
| 45 | +| project | string | The GCP project ID. This is pre-configured; do not ask for it unless the user explicitly provides a different one. | No | | |
| 46 | +| name | string | The name of the instance | Yes | | |
| 47 | +| databaseVersion | string | The database version for SQL Server. If not specified, defaults to SQLSERVER_2022_STANDARD. | No | `SQLSERVER_2022_STANDARD` | |
| 48 | +| rootPassword | string | The root password for the instance | Yes | | |
| 49 | +| editionPreset | string | The edition of the instance. Can be `Production` or `Development`. This determines the default machine type and availability. Defaults to `Development`. | No | `Development` | |
| 50 | + |
| 51 | + |
| 52 | +--- |
| 53 | + |
| 54 | +### create_user |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | +#### Parameters |
| 59 | + |
| 60 | +| Name | Type | Description | Required | Default | |
| 61 | +| :--- | :--- | :--- | :--- | :--- | |
| 62 | +| project | string | The GCP project ID. This is pre-configured; do not ask for it unless the user explicitly provides a different one. | No | | |
| 63 | +| instance | string | The ID of the instance where the user will be created. | Yes | | |
| 64 | +| name | string | The name for the new user. Must be unique within the instance. | Yes | | |
| 65 | +| password | string | A secure password for the new user. Not required for IAM users. | No | | |
| 66 | +| iamUser | boolean | Set to true to create a Cloud IAM user. | Yes | | |
| 67 | + |
| 68 | + |
| 69 | +--- |
| 70 | + |
| 71 | +### get_instance |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | +#### Parameters |
| 76 | + |
| 77 | +| Name | Type | Description | Required | Default | |
| 78 | +| :--- | :--- | :--- | :--- | :--- | |
| 79 | +| projectId | string | The GCP project ID. This is pre-configured; do not ask for it unless the user explicitly provides a different one. | No | | |
| 80 | +| instanceId | string | The instance ID | Yes | | |
| 81 | + |
| 82 | + |
| 83 | +--- |
| 84 | + |
| 85 | +### list_databases |
| 86 | + |
| 87 | +Lists all databases for a Cloud SQL instance. |
| 88 | + |
| 89 | +#### Parameters |
| 90 | + |
| 91 | +| Name | Type | Description | Required | Default | |
| 92 | +| :--- | :--- | :--- | :--- | :--- | |
| 93 | +| project | string | The GCP project ID. This is pre-configured; do not ask for it unless the user explicitly provides a different one. | No | | |
| 94 | +| instance | string | The instance ID | Yes | | |
| 95 | + |
| 96 | + |
| 97 | +--- |
| 98 | + |
| 99 | +### list_instances |
| 100 | + |
| 101 | +Lists all type of Cloud SQL instances for a project. |
| 102 | + |
| 103 | +#### Parameters |
| 104 | + |
| 105 | +| Name | Type | Description | Required | Default | |
| 106 | +| :--- | :--- | :--- | :--- | :--- | |
| 107 | +| project | string | The GCP project ID. This is pre-configured; do not ask for it unless the user explicitly provides a different one. | No | | |
| 108 | + |
| 109 | + |
| 110 | +--- |
| 111 | + |
| 112 | +### wait_for_operation |
| 113 | + |
| 114 | + |
| 115 | + |
| 116 | +#### Parameters |
| 117 | + |
| 118 | +| Name | Type | Description | Required | Default | |
| 119 | +| :--- | :--- | :--- | :--- | :--- | |
| 120 | +| project | string | The GCP project ID. This is pre-configured; do not ask for it unless the user explicitly provides a different one. | No | | |
| 121 | +| operation | string | The operation ID | Yes | | |
| 122 | + |
| 123 | + |
| 124 | +--- |
| 125 | + |
0 commit comments