Cosmos DB 계정에 대한 Notebook 작업 영역을 만듭니다.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/default?api-version=2023-11-15
URI 매개 변수
Name |
In(다음 안에) |
필수 |
형식 |
Description |
accountName
|
path |
True
|
string
|
Cosmos DB 데이터베이스 계정 이름입니다.
Regex pattern: ^[a-z0-9]+(-[a-z0-9]+)*
|
notebookWorkspaceName
|
path |
True
|
NotebookWorkspaceName
|
Notebook 작업 영역 리소스의 이름입니다.
|
resourceGroupName
|
path |
True
|
string
|
리소스 그룹의 이름. 이름은 대소문자를 구분하지 않습니다.
|
subscriptionId
|
path |
True
|
string
|
대상 구독의 ID입니다.
|
api-version
|
query |
True
|
string
|
이 작업에 사용할 API 버전입니다.
|
응답
보안
azure_auth
Azure Active Directory OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name |
Description |
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
오류 응답.
Name |
형식 |
Description |
code
|
string
|
오류 코드
|
message
|
string
|
작업이 실패한 이유를 나타내는 오류 메시지입니다.
|
NotebookWorkspace
Notebook 작업 영역 리소스
Name |
형식 |
Description |
id
|
string
|
데이터베이스 계정의 고유 리소스 식별자입니다.
|
name
|
string
|
데이터베이스 계정의 이름입니다.
|
properties.notebookServerEndpoint
|
string
|
Notebook 서버의 엔드포인트를 지정합니다.
|
properties.status
|
string
|
Notebook 작업 영역의 상태입니다. 가능한 값은 만들기, 온라인, 삭제, 실패, 업데이트입니다.
|
type
|
string
|
Azure 리소스의 유형입니다.
|
NotebookWorkspaceCreateUpdateParameters
Notebook 작업 영역 리소스를 만드는 매개 변수
Name |
형식 |
Description |
id
|
string
|
데이터베이스 계정의 고유 리소스 식별자입니다.
|
name
|
string
|
데이터베이스 계정의 이름입니다.
|
type
|
string
|
Azure 리소스의 유형입니다.
|
NotebookWorkspaceName
Notebook 작업 영역 리소스의 이름입니다.
Name |
형식 |
Description |
default
|
string
|
|