mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-13 17:22:15 -05:00
sample of how to contribute a deployment type (#7414)
This commit is contained in:
7
samples/sample-resource-deployment/images/book.svg
Normal file
7
samples/sample-resource-deployment/images/book.svg
Normal file
@@ -0,0 +1,7 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
||||
<title>Artboard 10</title>
|
||||
<g>
|
||||
<path d="M4,6h7V3H4ZM5,4h5V5H5Z"/>
|
||||
<path d="M3,0a1.732,1.732,0,0,0-.742.168,2.256,2.256,0,0,0-1.09,1.09A1.735,1.735,0,0,0,1,2V14a1.947,1.947,0,0,0,.156.777,2.018,2.018,0,0,0,1.067,1.067A1.947,1.947,0,0,0,3,16H14V0ZM3,15a.972.972,0,0,1-.391-.078,1.023,1.023,0,0,1-.531-.531,1.019,1.019,0,0,1,0-.782,1.024,1.024,0,0,1,.215-.316,1.012,1.012,0,0,1,.316-.215A.972.972,0,0,1,3,13H13v2Zm10-3H3a1.836,1.836,0,0,0-.523.074A2.194,2.194,0,0,0,2,12.281V2a.8.8,0,0,1,.09-.359,1.223,1.223,0,0,1,.23-.321,1.246,1.246,0,0,1,.321-.23A.792.792,0,0,1,3,1H13Z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 684 B |
11
samples/sample-resource-deployment/images/book_inverse.svg
Normal file
11
samples/sample-resource-deployment/images/book_inverse.svg
Normal file
@@ -0,0 +1,11 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0)">
|
||||
<path d="M4 6H11V3H4V6ZM5 4H10V5H5V4Z" fill="white"/>
|
||||
<path d="M2.99998 0C2.74326 0.000315985 2.48981 0.0577002 2.25798 0.168C1.77794 0.392083 1.39207 0.777956 1.16798 1.258C1.05778 1.48986 1.0004 1.74328 0.999984 2V14C0.998165 14.267 1.05127 14.5314 1.15598 14.777C1.36029 15.2573 1.74272 15.6397 2.22298 15.844C2.46855 15.9487 2.73303 16.0018 2.99998 16H14V0H2.99998ZM2.99998 15C2.86566 15.0013 2.73253 14.9747 2.60898 14.922C2.37107 14.8187 2.18127 14.6289 2.07798 14.391C2.02649 14.2671 1.99998 14.1342 1.99998 14C1.99998 13.8658 2.02649 13.7329 2.07798 13.609C2.12918 13.4911 2.20212 13.3839 2.29298 13.293C2.38371 13.2019 2.49095 13.1289 2.60898 13.078C2.73253 13.0253 2.86566 12.9987 2.99998 13H13V15H2.99998ZM13 12H2.99998C2.823 11.9993 2.64684 12.0243 2.47698 12.074C2.31034 12.1238 2.15022 12.1933 1.99998 12.281V2C2.00151 1.87494 2.03233 1.75199 2.08998 1.641C2.14876 1.52225 2.22643 1.41383 2.31998 1.32C2.41408 1.22676 2.52244 1.14912 2.64098 1.09C2.75186 1.03207 2.87489 1.00123 2.99998 1H13V12Z" fill="white"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0">
|
||||
<rect width="16" height="16" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
BIN
samples/sample-resource-deployment/images/sqlserver.png
Normal file
BIN
samples/sample-resource-deployment/images/sqlserver.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 37 KiB |
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"name": "python3",
|
||||
"display_name": "Python 3"
|
||||
},
|
||||
"language_info": {
|
||||
"name": "python",
|
||||
"version": "3.7.3",
|
||||
"mimetype": "text/x-python",
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
},
|
||||
"pygments_lexer": "ipython3",
|
||||
"nbconvert_exporter": "python",
|
||||
"file_extension": ".py"
|
||||
}
|
||||
},
|
||||
"nbformat_minor": 2,
|
||||
"nbformat": 4,
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": [
|
||||
"Deploy x data service"
|
||||
],
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "23954d96-3932-4a8e-ab73-da605f99b1a4"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"import os;\n",
|
||||
"print('Welcome')\n",
|
||||
"print(os.environ[\"AZDATA_NB_VAR_TEXT\"])\n",
|
||||
"print(os.environ[\"AZDATA_NB_VAR_PASSWORD\"])\n",
|
||||
"print(os.environ[\"AZDATA_NB_VAR_NUMBER\"])"
|
||||
],
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "26fa8bc4-4b8e-4c31-ae11-50484821cea8"
|
||||
},
|
||||
"outputs": [],
|
||||
"execution_count": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"name": "python3",
|
||||
"display_name": "Python 3"
|
||||
},
|
||||
"language_info": {
|
||||
"name": "python",
|
||||
"version": "3.7.3",
|
||||
"mimetype": "text/x-python",
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
},
|
||||
"pygments_lexer": "ipython3",
|
||||
"nbconvert_exporter": "python",
|
||||
"file_extension": ".py"
|
||||
}
|
||||
},
|
||||
"nbformat_minor": 2,
|
||||
"nbformat": 4,
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"source": [
|
||||
"Deploy x data service"
|
||||
],
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "23954d96-3932-4a8e-ab73-da605f99b1a4"
|
||||
}
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"import os;\n",
|
||||
"print('Welcome')\n",
|
||||
"print(os.environ[\"AZDATA_NB_VAR_TEXT\"])\n",
|
||||
"print(os.environ[\"AZDATA_NB_VAR_PASSWORD\"])\n",
|
||||
"print(os.environ[\"AZDATA_NB_VAR_NUMBER\"])"
|
||||
],
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "26fa8bc4-4b8e-4c31-ae11-50484821cea8"
|
||||
},
|
||||
"outputs": [],
|
||||
"execution_count": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
173
samples/sample-resource-deployment/package.json
Normal file
173
samples/sample-resource-deployment/package.json
Normal file
@@ -0,0 +1,173 @@
|
||||
{
|
||||
"name": "sample-resource-deployment",
|
||||
"displayName": "%extension-displayName%",
|
||||
"description": "%extension-description%",
|
||||
"version": "0.0.1",
|
||||
"publisher": "Contoso",
|
||||
"preview": true,
|
||||
"license": "https://raw.githubusercontent.com/Microsoft/azuredatastudio/master/LICENSE.txt",
|
||||
"icon": "images/sqlserver.png",
|
||||
"aiKey": "AIF-444c3af9-8e69-4462-ab49-4191e6ad1916",
|
||||
"engines": {
|
||||
"vscode": "*",
|
||||
"azdata": ">1.10.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Microsoft/azuredatastudio.git"
|
||||
},
|
||||
"extensionDependencies": [
|
||||
"microsoft.mssql",
|
||||
"microsoft.notebook",
|
||||
"microsoft.resource-deployment"
|
||||
],
|
||||
"contributes": {
|
||||
"resourceDeploymentTypes": [
|
||||
{
|
||||
"name": "x-data-service",
|
||||
"displayName": "%resource-type-display-name%",
|
||||
"description": "%resource-type-description%",
|
||||
"platforms": [
|
||||
"darwin",
|
||||
"win32",
|
||||
"linux"
|
||||
],
|
||||
"icon": {
|
||||
"light": "./images/book.svg",
|
||||
"dark": "./images/book_inverse.svg"
|
||||
},
|
||||
"options": [
|
||||
{
|
||||
"name": "edition",
|
||||
"displayName": "%option-display-name%",
|
||||
"values": [
|
||||
{
|
||||
"name": "evaluation",
|
||||
"displayName": "%option-value-name-1%"
|
||||
},
|
||||
{
|
||||
"name": "standard",
|
||||
"displayName": "%option-value-name-2%"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"providers": [
|
||||
{
|
||||
"dialog": {
|
||||
"notebook": "%deployment-notebook-1%",
|
||||
"title": "%dialog-title-1%",
|
||||
"name": "dialog1",
|
||||
"tabs": [
|
||||
{
|
||||
"title": "",
|
||||
"sections": [
|
||||
{
|
||||
"title": "",
|
||||
"fields": [
|
||||
{
|
||||
"label": "%text-field%",
|
||||
"variableName": "AZDATA_NB_VAR_TEXT",
|
||||
"type": "text",
|
||||
"defaultValue": "abc",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"label": "%password-field%",
|
||||
"variableName": "AZDATA_NB_VAR_PASSWORD",
|
||||
"type": "password",
|
||||
"confirmationRequired": true,
|
||||
"confirmationLabel": "%confirm-password%",
|
||||
"defaultValue": "",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"label": "%number-field%",
|
||||
"variableName": "AZDATA_NB_VAR_NUMBER",
|
||||
"type": "number",
|
||||
"defaultValue": "100",
|
||||
"required": true,
|
||||
"min": 1,
|
||||
"max": 65535
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"requiredTools": [
|
||||
{
|
||||
"name": "kubectl"
|
||||
}
|
||||
],
|
||||
"when": "edition=evaluation"
|
||||
},
|
||||
{
|
||||
"dialog": {
|
||||
"notebook": "%deployment-notebook-2%",
|
||||
"title": "%dialog-title-2%",
|
||||
"name": "dialog2",
|
||||
"tabs": [
|
||||
{
|
||||
"title": "",
|
||||
"sections": [
|
||||
{
|
||||
"title": "",
|
||||
"fields": [
|
||||
{
|
||||
"label": "%text-field%",
|
||||
"variableName": "AZDATA_NB_VAR_TEXT",
|
||||
"type": "text",
|
||||
"defaultValue": "abc",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"label": "%password-field%",
|
||||
"variableName": "AZDATA_NB_VAR_PASSWORD",
|
||||
"type": "password",
|
||||
"confirmationRequired": true,
|
||||
"confirmationLabel": "%confirm-password%",
|
||||
"defaultValue": "",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"label": "%number-field%",
|
||||
"variableName": "AZDATA_NB_VAR_NUMBER",
|
||||
"type": "number",
|
||||
"defaultValue": "100",
|
||||
"required": true,
|
||||
"min": 1,
|
||||
"max": 65535
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"requiredTools": [
|
||||
{
|
||||
"name": "docker"
|
||||
}
|
||||
],
|
||||
"when": "edition=standard"
|
||||
}
|
||||
],
|
||||
"agreement": {
|
||||
"template": "%agreement%",
|
||||
"links": [
|
||||
{
|
||||
"text": "%agreement-1-name%",
|
||||
"url": "https://www.microsoft.com"
|
||||
},
|
||||
{
|
||||
"text": "%agreement-2-name%",
|
||||
"url": "https://portal.azure.com"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
20
samples/sample-resource-deployment/package.nls.json
Normal file
20
samples/sample-resource-deployment/package.nls.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"extension-displayName": "Sample resource deployment extension for Azure Data Studio",
|
||||
"extension-description": "You can contribute a resource deployment type without any coding",
|
||||
"resource-type-display-name": "X Data Service",
|
||||
"resource-type-description": "X Data Service provides a full set of features...",
|
||||
"option-display-name": "Edition",
|
||||
"option-value-name-1": "Evaluation",
|
||||
"option-value-name-2": "Standard",
|
||||
"dialog-title-1": "Start Evaluation of X Data Service",
|
||||
"dialog-title-2": "Deploy X Data Service",
|
||||
"deployment-notebook-1": "./notebooks/deploy-x-data-service-1.ipynb",
|
||||
"deployment-notebook-2": "./notebooks/deploy-x-data-service-2.ipynb",
|
||||
"text-field": "text field",
|
||||
"password-field": "password field",
|
||||
"number-field": "numeric field",
|
||||
"confirm-password": "confirm password",
|
||||
"agreement": "I accept {0} and {1}.",
|
||||
"agreement-1-name": "Agreement 1",
|
||||
"agreement-2-name": "Agreement 2"
|
||||
}
|
||||
Reference in New Issue
Block a user