Obtém a área de trabalho do bloco de notas de uma conta do Cosmos DB.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/default?api-version=2023-11-15
Parâmetros do URI
Name |
Em |
Necessário |
Tipo |
Description |
accountName
|
path |
True
|
string
|
Nome da conta de base de dados do Cosmos DB.
Regex pattern: ^[a-z0-9]+(-[a-z0-9]+)*
|
notebookWorkspaceName
|
path |
True
|
NotebookWorkspaceName
|
O nome do recurso da área de trabalho do bloco de notas.
|
resourceGroupName
|
path |
True
|
string
|
O nome do grupo de recursos. O nome não é sensível a maiúsculas e minúsculas.
|
subscriptionId
|
path |
True
|
string
|
O ID da subscrição de destino.
|
api-version
|
query |
True
|
string
|
A versão da API a utilizar para esta operação.
|
Respostas
Name |
Tipo |
Description |
200 OK
|
NotebookWorkspace
|
Foi obtido com êxito um recurso de área de trabalho de bloco de notas especificado.
|
Other Status Codes
|
ErrorResponse
|
Resposta de erro que descreve o motivo pela qual a operação falhou.
|
Segurança
azure_auth
Fluxo OAuth2 do Azure Active Directory
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name |
Description |
user_impersonation
|
Representar a sua conta de utilizador
|
Exemplos
CosmosDBNotebookWorkspaceGet
Sample Request
GET 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.NotebookWorkspaceName;
/**
* Samples for NotebookWorkspaces Get.
*/
public final class Main {
/*
* x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/
* CosmosDBNotebookWorkspaceGet.json
*/
/**
* Sample code: CosmosDBNotebookWorkspaceGet.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void cosmosDBNotebookWorkspaceGet(com.azure.resourcemanager.AzureResourceManager azure) {
azure.cosmosDBAccounts().manager().serviceClient().getNotebookWorkspaces().getWithResponse("rg1", "ddb1",
NotebookWorkspaceName.DEFAULT, 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
from azure.identity import DefaultAzureCredential
from azure.mgmt.cosmosdb import CosmosDBManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-cosmosdb
# USAGE
python cosmos_db_notebook_workspace_get.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = CosmosDBManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.notebook_workspaces.get(
resource_group_name="rg1",
account_name="ddb1",
notebook_workspace_name="default",
)
print(response)
# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBNotebookWorkspaceGet.json
if __name__ == "__main__":
main()
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/CosmosDBNotebookWorkspaceGet.json
func ExampleNotebookWorkspacesClient_Get() {
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)
}
res, err := clientFactory.NewNotebookWorkspacesClient().Get(ctx, "rg1", "ddb1", armcosmos.NotebookWorkspaceNameDefault, nil)
if err != nil {
log.Fatalf("failed to finish the request: %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 Gets the notebook workspace for a Cosmos DB account.
*
* @summary Gets the notebook workspace for a Cosmos DB account.
* x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/examples/CosmosDBNotebookWorkspaceGet.json
*/
async function cosmosDbNotebookWorkspaceGet() {
const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1";
const accountName = "ddb1";
const notebookWorkspaceName = "default";
const credential = new DefaultAzureCredential();
const client = new CosmosDBManagementClient(credential, subscriptionId);
const result = await client.notebookWorkspaces.get(
resourceGroupName,
accountName,
notebookWorkspaceName,
);
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"
}
}
Definições
ErrorResponse
Resposta do Erro.
Name |
Tipo |
Description |
code
|
string
|
Código de erro.
|
message
|
string
|
Mensagem de erro a indicar o motivo pela qual a operação falhou.
|
NotebookWorkspace
Um recurso de área de trabalho do bloco de notas
Name |
Tipo |
Description |
id
|
string
|
O identificador de recurso exclusivo da conta de base de dados.
|
name
|
string
|
O nome da conta da base de dados.
|
properties.notebookServerEndpoint
|
string
|
Especifica o ponto final do Servidor de blocos de notas.
|
properties.status
|
string
|
Estado da área de trabalho do bloco de notas. Os valores possíveis são: Criar, Online, Eliminar, Falhar, Atualizar.
|
type
|
string
|
O tipo de recurso do Azure.
|
NotebookWorkspaceName
O nome do recurso da área de trabalho do bloco de notas.
Name |
Tipo |
Description |
default
|
string
|
|