diff --git a/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkbookAdd.json b/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkbookAdd.json index 0e7c71f15345..e39be4602011 100644 --- a/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkbookAdd.json +++ b/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkbookAdd.json @@ -4,24 +4,28 @@ "resourceGroupName": "my-resource-group", "resourceName": "deadb33f-8bee-4d3b-a059-9be8dac93960", "subscriptionId": "subid", - "workbookProperties": { - "id": "c0deea5e-3344-40f2-96f8-6f8e1c3b5722", - "name": "deadb33f-8bee-4d3b-a059-9be8dac93960", - "location": "west us", - "properties": { - "sourceResourceId": "/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/MyGroup/providers/Microsoft.Web/sites/MyTestApp-CodeLens", - "name": "Blah Blah Blah", - "userId": "userId", - "serializedData": "{\"version\":\"Notebook/1.0\",\"items\":[{\"type\":1,\"content\":\"{\"json\":\"## New workbook\\r\\n---\\r\\n\\r\\nWelcome to your new workbook. This area will display text formatted as markdown.\\r\\n\\r\\n\\r\\nWe've included a basic analytics query to get you started. Use the `Edit` button below each section to configure it or add more sections.\"}\",\"halfWidth\":null,\"conditionalVisibility\":null},{\"type\":3,\"content\":\"{\"version\":\"KqlItem/1.0\",\"query\":\"union withsource=TableName *\\n| summarize Count=count() by TableName\\n| render barchart\",\"showQuery\":false,\"size\":1,\"aggregation\":0,\"showAnnotations\":false}\",\"halfWidth\":null,\"conditionalVisibility\":null}],\"isLocked\":false}", - "workbookId": "deadb33f-8bee-4d3b-a059-9be8dac93960", - "kind": "shared", - "category": "workbook", - "timeModified": null + "workbookPayload": { + "workbook": { + "id": "c0deea5e-3344-40f2-96f8-6f8e1c3b5722", + "name": "deadb33f-8bee-4d3b-a059-9be8dac93960", + "location": "west us", + "properties": { + "sourceResourceId": "/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/MyGroup/providers/Microsoft.Web/sites/MyTestApp-CodeLens", + "name": "Blah Blah Blah", + "userId": "userId", + "serializedData": "{\"version\":\"Notebook/1.0\",\"items\":[{\"type\":1,\"content\":\"{\"json\":\"## New workbook\\r\\n---\\r\\n\\r\\nWelcome to your new workbook. This area will display text formatted as markdown.\\r\\n\\r\\n\\r\\nWe've included a basic analytics query to get you started. Use the `Edit` button below each section to configure it or add more sections.\"}\",\"halfWidth\":null,\"conditionalVisibility\":null},{\"type\":3,\"content\":\"{\"version\":\"KqlItem/1.0\",\"query\":\"union withsource=TableName *\\n| summarize Count=count() by TableName\\n| render barchart\",\"showQuery\":false,\"size\":1,\"aggregation\":0,\"showAnnotations\":false}\",\"halfWidth\":null,\"conditionalVisibility\":null}],\"isLocked\":false}", + "workbookId": "deadb33f-8bee-4d3b-a059-9be8dac93960", + "kind": "shared", + "category": "workbook", + "timeModified": null + }, + "tags": [ + "TagSample01", + "TagSample02" + ] }, - "tags": [ - "TagSample01", - "TagSample02" - ] + "linkResource": { + } } }, "responses": { diff --git a/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkbookUpdate.json b/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkbookUpdate.json index f135343b34df..bb9cd81cc240 100644 --- a/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkbookUpdate.json +++ b/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkbookUpdate.json @@ -4,24 +4,28 @@ "subscriptionId": "subid", "resourceGroupName": "my-resource-group", "resourceName": "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", - "workbookProperties": { - "name": "deadb33f-8bee-4d3b-a059-9be8dac93960", - "location": "west us", - "tags": [ - "TagSample01", - "TagSample02" - ], - "properties": { - "name": "Blah Blah Blah", - "userId": "userId", - "serializedData": "{\"version\":\"Notebook/1.0\",\"items\":[{\"type\":1,\"content\":\"{\"json\":\"## New workbook\\r\\n---\\r\\n\\r\\nWelcome to your new workbook. This area will display text formatted as markdown.\\r\\n\\r\\n\\r\\nWe've included a basic analytics query to get you started. Use the `Edit` button below each section to configure it or add more sections.\"}\",\"halfWidth\":null,\"conditionalVisibility\":null},{\"type\":3,\"content\":\"{\"version\":\"KqlItem/1.0\",\"query\":\"union withsource=TableName *\\n| summarize Count=count() by TableName\\n| render barchart\",\"showQuery\":false,\"size\":1,\"aggregation\":0,\"showAnnotations\":false}\",\"halfWidth\":null,\"conditionalVisibility\":null}],\"isLocked\":false}", - "version": "ME", - "workbookId": "deadb33f-8bee-4d3b-a059-9be8dac93960", - "kind": "shared", - "category": "workbook", - "timeModified": null + "workbookPayload": { + "workbook": { + "name": "deadb33f-8bee-4d3b-a059-9be8dac93960", + "location": "west us", + "properties": { + "name": "Blah Blah Blah", + "userId": "userId", + "serializedData": "{\"version\":\"Notebook/1.0\",\"items\":[{\"type\":1,\"content\":\"{\"json\":\"## New workbook\\r\\n---\\r\\n\\r\\nWelcome to your new workbook. This area will display text formatted as markdown.\\r\\n\\r\\n\\r\\nWe've included a basic analytics query to get you started. Use the `Edit` button below each section to configure it or add more sections.\"}\",\"halfWidth\":null,\"conditionalVisibility\":null},{\"type\":3,\"content\":\"{\"version\":\"KqlItem/1.0\",\"query\":\"union withsource=TableName *\\n| summarize Count=count() by TableName\\n| render barchart\",\"showQuery\":false,\"size\":1,\"aggregation\":0,\"showAnnotations\":false}\",\"halfWidth\":null,\"conditionalVisibility\":null}],\"isLocked\":false}", + "version": "ME", + "workbookId": "deadb33f-8bee-4d3b-a059-9be8dac93960", + "kind": "shared", + "category": "workbook", + "timeModified": null + }, + "tags": [ + "TagSample01", + "TagSample02" + ] + }, + "linkResource": { } -} + } }, "responses": { "200": { diff --git a/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkbooksList.json b/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkbooksList.json index e762584335e6..48cd4fda78c8 100644 --- a/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkbooksList.json +++ b/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkbooksList.json @@ -2,9 +2,9 @@ "parameters": { "api-version": "2015-05-01", "subscriptionId": "subid", - "resourceGroupName": "my-resource-group", "location": "west us", - "category": "workbook" + "category": "workbook", + "resourceId": "resource id" }, "responses": { "200": { diff --git a/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/workbooks_API.json b/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/workbooks_API.json index 28e4b6584cf7..a62da0b59b55 100644 --- a/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/workbooks_API.json +++ b/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/workbooks_API.json @@ -34,17 +34,14 @@ } }, "paths": { - "/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks": { + "/subscriptions/{subscriptionId}/providers/microsoft.insights/workbooks": { "get": { - "description": "Get all Workbooks defined within a specified resource group and category.", + "description": "Get all Workbooks defined within a specified subscriptionId. It will get a list of workbooks or linked workbooks based on $filter clause. If sourceId is specified, it will get a list of linked workbboks. If a targetId is specified, it will get a list of workboks. When a targetId is specified, a resourceName is not required. Even if it is provided, it will be ignored.", "operationId": "Workbooks_ListByResourceGroup", "parameters": [ { "$ref": "#/parameters/SubscriptionIdParameter" }, - { - "$ref": "#/parameters/ResourceGroupNameParameter" - }, { "$ref": "#/parameters/LocationParameter" }, @@ -59,6 +56,9 @@ }, { "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ResourceIdParameter" } ], "responses": { @@ -140,12 +140,12 @@ "$ref": "#/parameters/ApiVersionParameter" }, { - "name": "workbookProperties", - "description": "Properties that need to be specified to create a new workbook.", + "name": "workbookPayload", + "description": "Properties that need to be specified to create a new workbook or link.", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/Workbook" + "$ref": "#/definitions/WorkbookPayload" } } ], @@ -186,12 +186,12 @@ "$ref": "#/parameters/ApiVersionParameter" }, { - "name": "workbookProperties", - "description": "Properties that need to be specified to create a new workbook.", + "name": "workbookPayload", + "description": "Properties that need to be specified to create a new workbook or link.", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/Workbook" + "$ref": "#/definitions/WorkbookPayload" } } ], @@ -254,208 +254,7 @@ } } } - }, - "/subscriptions/{subscriptionId}/providers/microsoft.insights/workbooks/links": { - "get": { - "description": "Gets a list of workbooks.", - "operationId": "Workbooks_List", - "parameters": [ - { - "$ref": "#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/SourceIdParameter" - }, - { - "$ref": "#/parameters/CategoryParameter" - }, - { - "$ref": "#/parameters/TagsParameter" - }, - { - "$ref": "#/parameters/CanFetchWorkbookContentParameter" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "A list containing 0 or more workbook definitions.", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Workbook" - } - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/WorkbookErrorResponse" - } - } - }, - "x-ms-examples": { - "WorkbooksListLink": { - "$ref": "./examples/WorkbooksListLink.json" - } - } - }, - "put": { - "description": "Create a new workbook link.", - "operationId": "Workbooks_CreateLink", - "parameters": [ - { - "$ref": "#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "name": "linkProperties", - "description": "Properties that need to be specified to create a workbook link.", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/LinkProperties" - } - } - ], - "responses": { - "200": { - "description": "The link has been created." - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/WorkbookErrorResponse" - } - } - }, - "x-ms-examples": { - "WorkbookAdd": { - "$ref": "./examples/LinkedWorkbookResponseOnly.json" - } - } - }, - "patch": { - "description": "Updates a workbook that has already been added.", - "operationId": "Workbooks_UpdateLink", - "parameters": [ - { - "$ref": "#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "name": "linkProperties", - "description": "Properties that need to be specified to create a workbook link.", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/LinkProperties" - } - } - ], - "responses": { - "200": { - "description": "The workbook link updated.", - "schema": { - "$ref": "#/definitions/Workbook" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/WorkbookErrorResponse" - } - } - }, - "x-ms-examples": { - "WorkbookUpdateLink": { - "$ref": "./examples/LinkedWorkbookResponseOnly.json" - } - } - }, - "delete": { - "description": "Delete a link between a source resource and workbook resource.", - "operationId": "Workbooks_DeleteLink", - "parameters": [ - { - "$ref": "#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/ResourceIdParameter" - }, - { - "$ref": "#/parameters/CategoryParameter" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "The workbook link has been successfully deleted." - }, - "204": { - "description": "The resource doens't exisit." - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/WorkbookErrorResponse" - } - } - }, - "x-ms-examples": { - "WorkbookDeleteLink": { - "$ref": "./examples/WorkbookDeleteLink.json" - } - } - } - }, - "/subscriptions/{subscriptionId}/providers/microsoft.insights/workbooks/{resourceName}/links": { - "get": { - "description": "Gets a workbook link by a workbook resource name.", - "operationId": "Workbooks_ListBySourceId", - "parameters": [ - { - "$ref": "#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/WorkbookResourceNameParameter" - }, - { - "$ref": "#/parameters/CanFetchWorkbookContentParameter" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "A workbook definition.", - "schema": { - "$ref": "#/definitions/Workbook" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/WorkbookErrorResponse" - } - } - }, - "x-ms-examples": { - "WorkbookGet": { - "$ref": "./examples/WorkbookGet.json" - } - } - } - } + } }, "definitions": { "Resource": { @@ -532,6 +331,19 @@ } } }, + "WorkbookPayload": { + "description": "This wraps either Workbook definition or LinkReource properties.", + "properties": { + "workbook": { + "$ref": "#/definitions/Workbook", + "description": "Workbook properties. If provided, it will be used to create new workbook." + }, + "linkResource": { + "$ref": "#/definitions/LinkProperties", + "description": "LinkProperties. If provided, it will be used to create a link." + } + } + }, "LinkProperties": { "description": "Contains a sourceId and workbook resource id to link two resources.", "properties": { @@ -724,7 +536,7 @@ "in": "query", "required": true, "type": "string", - "description": "Azure Resource Id or any target workbook resource id.", + "description": "Azure Resource id or any target workbook resource id.", "x-ms-parameter-location": "method" }, "CanFetchWorkbookContentParameter": {