Descrição de Obtém a categoria de ResourceHealthMetadata a ser usada para o site determinado
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resourceHealthMetadata/default?api-version=2023-01-01
Parâmetros de URI
Nome |
Em |
Obrigatório |
Tipo |
Description |
name
|
path |
True
|
string
|
Nome do aplicativo Web
|
resourceGroupName
|
path |
True
|
string
|
Nome do grupo de recursos ao qual pertence o recurso.
Regex pattern: ^[-\w\._\(\)]+[^\.]$
|
slot
|
path |
True
|
string
|
Nome do slot do aplicativo Web. Se não for especificado, o padrão será o slot de produção.
|
subscriptionId
|
path |
True
|
string
|
Sua ID da assinatura do Azure. Essa é uma cadeia de caracteres formatada por GUID (por exemplo, 000000000-0000-0000-0000-0000000000000).
|
api-version
|
query |
True
|
string
|
Versão da API
|
Respostas
Segurança
azure_auth
Fluxo do OAuth2 do Azure Active Directory
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Nome |
Description |
user_impersonation
|
representar sua conta de usuário
|
Exemplos
Sample Request
GET https://management.azure.com/subscriptions/4adb32ad-8327-4cbb-b775-b84b4465bb38/resourceGroups/Default-Web-NorthCentralUS/providers/Microsoft.Web/sites/newsiteinnewASE-NCUS/slots/Production/resourceHealthMetadata/default?api-version=2023-01-01
/**
* Samples for ResourceHealthMetadata GetBySite.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetResourceHealthMetadataBySite.json
*/
/**
* Sample code: Get ResourceHealthMetadata.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void getResourceHealthMetadata(com.azure.resourcemanager.AzureResourceManager azure) {
azure.webApps().manager().serviceClient().getResourceHealthMetadatas().getBySiteWithResponse(
"Default-Web-NorthCentralUS", "newsiteinnewASE-NCUS", 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.web import WebSiteManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-web
# USAGE
python get_resource_health_metadata_by_site.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 = WebSiteManagementClient(
credential=DefaultAzureCredential(),
subscription_id="4adb32ad-8327-4cbb-b775-b84b4465bb38",
)
response = client.resource_health_metadata.get_by_site(
resource_group_name="Default-Web-NorthCentralUS",
name="newsiteinnewASE-NCUS",
)
print(response)
# x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetResourceHealthMetadataBySite.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 armappservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appservice/armappservice/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/738ab25fe76324897f273645906d4a0415068a6c/specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetResourceHealthMetadataBySite.json
func ExampleResourceHealthMetadataClient_GetBySite() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armappservice.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewResourceHealthMetadataClient().GetBySite(ctx, "Default-Web-NorthCentralUS", "newsiteinnewASE-NCUS", 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.ResourceHealthMetadata = armappservice.ResourceHealthMetadata{
// Name: to.Ptr("default"),
// Type: to.Ptr("Microsoft.Web/sites/resourceHealthMetadata"),
// ID: to.Ptr("/subscriptions/4adb32ad-8327-4cbb-b775-b84b4465bb38/resourceGroups/Default-Web-NorthCentralUS/providers/Microsoft.Web/sites/newsiteinnewASE-NCUS/resourceHealthMetadata/default"),
// Properties: &armappservice.ResourceHealthMetadataProperties{
// Category: to.Ptr("Shared"),
// SignalAvailability: to.Ptr(true),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { WebSiteManagementClient } = require("@azure/arm-appservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Description for Gets the category of ResourceHealthMetadata to use for the given site
*
* @summary Description for Gets the category of ResourceHealthMetadata to use for the given site
* x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetResourceHealthMetadataBySite.json
*/
async function getResourceHealthMetadata() {
const subscriptionId =
process.env["APPSERVICE_SUBSCRIPTION_ID"] || "4adb32ad-8327-4cbb-b775-b84b4465bb38";
const resourceGroupName =
process.env["APPSERVICE_RESOURCE_GROUP"] || "Default-Web-NorthCentralUS";
const name = "newsiteinnewASE-NCUS";
const slot = "Production";
const credential = new DefaultAzureCredential();
const client = new WebSiteManagementClient(credential, subscriptionId);
const result = await client.resourceHealthMetadataOperations.getBySiteSlot(
resourceGroupName,
name,
slot
);
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
{
"properties": {
"category": "Shared",
"signalAvailability": true
},
"id": "/subscriptions/4adb32ad-8327-4cbb-b775-b84b4465bb38/resourceGroups/Default-Web-NorthCentralUS/providers/Microsoft.Web/sites/newsiteinnewASE-NCUS/resourceHealthMetadata/default",
"name": "default",
"type": "Microsoft.Web/sites/resourceHealthMetadata"
}
Definições
DefaultErrorResponse
Serviço de Aplicativo resposta de erro.
Nome |
Tipo |
Description |
error
|
Error
|
Modelo de erro.
|
Details
Nome |
Tipo |
Description |
code
|
string
|
Cadeia de caracteres padronizada para identificar programaticamente o erro.
|
message
|
string
|
Informações detalhadas de descrição e depuração de erros.
|
target
|
string
|
Informações detalhadas de descrição e depuração de erros.
|
Error
Modelo de erro.
Nome |
Tipo |
Description |
code
|
string
|
Cadeia de caracteres padronizada para identificar programaticamente o erro.
|
details
|
Details[]
|
Erros detalhados.
|
innererror
|
string
|
Mais informações sobre o erro de depuração.
|
message
|
string
|
Informações detalhadas de descrição e depuração de erros.
|
target
|
string
|
Informações detalhadas de descrição e depuração de erros.
|
Usado para obter as configurações de ResourceHealthCheck.
Nome |
Tipo |
Description |
id
|
string
|
ID do recurso.
|
kind
|
string
|
Tipo de recurso.
|
name
|
string
|
Nome do recurso.
|
properties.category
|
string
|
A categoria que o recurso corresponde no arquivo de política rhc
|
properties.signalAvailability
|
boolean
|
Há um sinal de integridade para o recurso
|
type
|
string
|
Tipo de recurso.
|