Cosmos DB アカウントのノートブック ワークスペースを作成します。
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/default?api-version=2023-11-15
URI パラメーター
名前 |
/ |
必須 |
型 |
説明 |
accountName
|
path |
True
|
string
|
Cosmos DB データベース アカウント名。
Regex pattern: ^[a-z0-9]+(-[a-z0-9]+)*
|
notebookWorkspaceName
|
path |
True
|
NotebookWorkspaceName
|
ノートブック ワークスペース リソースの名前。
|
resourceGroupName
|
path |
True
|
string
|
リソース グループの名前。 名前の大文字と小文字は区別されます。
|
subscriptionId
|
path |
True
|
string
|
ターゲット サブスクリプションの ID。
|
api-version
|
query |
True
|
string
|
この操作に使用する API バージョン。
|
応答
セキュリティ
azure_auth
Azure Active Directory OAuth2 フロー
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
名前 |
説明 |
user_impersonation
|
ユーザー アカウントの借用
|
例
CosmosDBNotebookWorkspaceCreate
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/notebookWorkspaces/default?api-version=2023-11-15
{}
import com.azure.resourcemanager.cosmos.models.NotebookWorkspaceCreateUpdateParameters;
import com.azure.resourcemanager.cosmos.models.NotebookWorkspaceName;
/**
* Samples for NotebookWorkspaces CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/
* CosmosDBNotebookWorkspaceCreate.json
*/
/**
* Sample code: CosmosDBNotebookWorkspaceCreate.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void cosmosDBNotebookWorkspaceCreate(com.azure.resourcemanager.AzureResourceManager azure) {
azure.cosmosDBAccounts().manager().serviceClient().getNotebookWorkspaces().createOrUpdate("rg1", "ddb1",
NotebookWorkspaceName.DEFAULT, new NotebookWorkspaceCreateUpdateParameters(),
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcosmos_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/41e4538ed7bb3ceac3c1322c9455a0812ed110ac/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBNotebookWorkspaceCreate.json
func ExampleNotebookWorkspacesClient_BeginCreateOrUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewNotebookWorkspacesClient().BeginCreateOrUpdate(ctx, "rg1", "ddb1", armcosmos.NotebookWorkspaceNameDefault, armcosmos.NotebookWorkspaceCreateUpdateParameters{}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.NotebookWorkspace = armcosmos.NotebookWorkspace{
// Name: to.Ptr("default"),
// Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts/notebookWorkspaces"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/notebookWorkspaces/default"),
// Properties: &armcosmos.NotebookWorkspaceProperties{
// NotebookServerEndpoint: to.Ptr("endpoint"),
// Status: to.Ptr("Online"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates the notebook workspace for a Cosmos DB account.
*
* @summary Creates the notebook workspace for a Cosmos DB account.
* x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBNotebookWorkspaceCreate.json
*/
async function cosmosDbNotebookWorkspaceCreate() {
const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1";
const accountName = "ddb1";
const notebookWorkspaceName = "default";
const notebookCreateUpdateParameters = {};
const credential = new DefaultAzureCredential();
const client = new CosmosDBManagementClient(credential, subscriptionId);
const result = await client.notebookWorkspaces.beginCreateOrUpdateAndWait(
resourceGroupName,
accountName,
notebookWorkspaceName,
notebookCreateUpdateParameters,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/notebookWorkspaces/default",
"name": "default",
"type": "Microsoft.DocumentDB/databaseAccounts/notebookWorkspaces",
"properties": {
"notebookServerEndpoint": "endpoint",
"status": "Online"
}
}
定義
ErrorResponse
エラー応答。
名前 |
型 |
説明 |
code
|
string
|
エラー コード。
|
message
|
string
|
操作が失敗した理由を示すエラー メッセージ。
|
NotebookWorkspace
ノートブック ワークスペース リソース
名前 |
型 |
説明 |
id
|
string
|
データベース アカウントの一意のリソース識別子。
|
name
|
string
|
データベース アカウントの名前。
|
properties.notebookServerEndpoint
|
string
|
Notebook サーバーのエンドポイントを指定します。
|
properties.status
|
string
|
ノートブック ワークスペースの状態。 指定できる値は、Creating、Online、Deleting、Failed、Updating です。
|
type
|
string
|
Azure リソースの種類。
|
NotebookWorkspaceCreateUpdateParameters
ノートブック ワークスペース リソースを作成するためのパラメーター
名前 |
型 |
説明 |
id
|
string
|
データベース アカウントの一意のリソース識別子。
|
name
|
string
|
データベース アカウントの名前。
|
type
|
string
|
Azure リソースの種類。
|
NotebookWorkspaceName
ノートブック ワークスペース リソースの名前。