Obtém as propriedades de uma instância de provedor para a assinatura, o grupo de recursos, o nome do monitor SAP e o nome do recurso especificados.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/providerInstances/{providerInstanceName}?api-version=2023-04-01
Parâmetros de URI
Nome |
Em |
Obrigatório |
Tipo |
Description |
monitorName
|
path |
True
|
string
|
Nome do recurso do monitor SAP.
|
providerInstanceName
|
path |
True
|
string
|
Nome da instância do provedor.
|
resourceGroupName
|
path |
True
|
string
minLength: 1 maxLength: 90
|
O nome do grupo de recursos. O nome não diferencia maiúsculas de minúsculas.
|
subscriptionId
|
path |
True
|
string
minLength: 1
|
A ID da assinatura de destino.
|
api-version
|
query |
True
|
string
minLength: 1
|
A versão da API a ser usada para esta operação.
|
Respostas
Exemplos
Get properties of a Db2 provider
Solicitação de exemplo
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/monitors/mySapMonitor/providerInstances/myProviderInstance?api-version=2023-04-01
/**
* Samples for ProviderInstances Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/
* Db2ProviderInstances_Get.json
*/
/**
* Sample code: Get properties of a Db2 provider.
*
* @param manager Entry point to WorkloadsManager.
*/
public static void getPropertiesOfADb2Provider(com.azure.resourcemanager.workloads.WorkloadsManager manager) {
manager.providerInstances().getWithResponse("myResourceGroup", "mySapMonitor", "myProviderInstance",
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.workloads import WorkloadsMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-workloads
# USAGE
python db2_provider_instances_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 = WorkloadsMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.provider_instances.get(
resource_group_name="myResourceGroup",
monitor_name="mySapMonitor",
provider_instance_name="myProviderInstance",
)
print(response)
# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/Db2ProviderInstances_Get.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 armworkloads_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/workloads/armworkloads"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/Db2ProviderInstances_Get.json
func ExampleProviderInstancesClient_Get_getPropertiesOfADb2Provider() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armworkloads.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewProviderInstancesClient().Get(ctx, "myResourceGroup", "mySapMonitor", "myProviderInstance", 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.ProviderInstance = armworkloads.ProviderInstance{
// Name: to.Ptr("myProviderInstance"),
// Type: to.Ptr("Microsoft.Workloads/monitors/providerInstances"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/monitors/mySapMonitor/providerInstances/myProviderInstance"),
// SystemData: &armworkloads.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()),
// CreatedBy: to.Ptr("user@xyz.com"),
// CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()),
// LastModifiedBy: to.Ptr("user@xyz.com"),
// LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser),
// },
// Properties: &armworkloads.ProviderInstanceProperties{
// ProviderSettings: &armworkloads.DB2ProviderInstanceProperties{
// ProviderType: to.Ptr("Db2"),
// DbName: to.Ptr("OPA"),
// DbPasswordURI: to.Ptr(""),
// DbPort: to.Ptr("5912"),
// DbUsername: to.Ptr("Db2OPA"),
// Hostname: to.Ptr("vmname.azure.com"),
// SapSid: to.Ptr("SID"),
// SSLCertificateURI: to.Ptr("https://storageaccount.blob.core.windows.net/containername/filename"),
// SSLPreference: to.Ptr(armworkloads.SSLPreferenceServerCertificate),
// },
// ProvisioningState: to.Ptr(armworkloads.WorkloadMonitorProvisioningStateSucceeded),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { WorkloadsClient } = require("@azure/arm-workloads");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name.
*
* @summary Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name.
* x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/Db2ProviderInstances_Get.json
*/
async function getPropertiesOfADb2Provider() {
const subscriptionId =
process.env["WORKLOADS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup";
const monitorName = "mySapMonitor";
const providerInstanceName = "myProviderInstance";
const credential = new DefaultAzureCredential();
const client = new WorkloadsClient(credential, subscriptionId);
const result = await client.providerInstances.get(
resourceGroupName,
monitorName,
providerInstanceName
);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Workloads.Models;
using Azure.ResourceManager.Workloads;
// Generated from example definition: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/Db2ProviderInstances_Get.json
// this example is just showing the usage of "ProviderInstances_Get" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SapMonitorResource created on azure
// for more information of creating SapMonitorResource, please refer to the document of SapMonitorResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "myResourceGroup";
string monitorName = "mySapMonitor";
ResourceIdentifier sapMonitorResourceId = SapMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName);
SapMonitorResource sapMonitor = client.GetSapMonitorResource(sapMonitorResourceId);
// get the collection of this SapProviderInstanceResource
SapProviderInstanceCollection collection = sapMonitor.GetSapProviderInstances();
// invoke the operation
string providerInstanceName = "myProviderInstance";
NullableResponse<SapProviderInstanceResource> response = await collection.GetIfExistsAsync(providerInstanceName);
SapProviderInstanceResource result = response.HasValue ? response.Value : null;
if (result == null)
{
Console.WriteLine("Succeeded with null as result");
}
else
{
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SapProviderInstanceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Resposta de exemplo
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/monitors/mySapMonitor/providerInstances/myProviderInstance",
"name": "myProviderInstance",
"type": "Microsoft.Workloads/monitors/providerInstances",
"systemData": {
"createdBy": "user@xyz.com",
"createdByType": "User",
"createdAt": "2021-08-19T15:10:46.196Z",
"lastModifiedBy": "user@xyz.com",
"lastModifiedByType": "User",
"lastModifiedAt": "2021-08-19T15:10:46.196Z"
},
"properties": {
"provisioningState": "Succeeded",
"providerSettings": {
"providerType": "Db2",
"sapSid": "SID",
"hostname": "vmname.azure.com",
"dbUsername": "Db2OPA",
"dbName": "OPA",
"dbPort": "5912",
"dbPasswordUri": "",
"sslCertificateUri": "https://storageaccount.blob.core.windows.net/containername/filename",
"sslPreference": "ServerCertificate"
}
}
}
Get properties of a MsSqlServer provider
Solicitação de exemplo
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/monitors/mySapMonitor/providerInstances/myProviderInstance?api-version=2023-04-01
/**
* Samples for ProviderInstances Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/
* MsSqlServerProviderInstance_Get.json
*/
/**
* Sample code: Get properties of a MsSqlServer provider.
*
* @param manager Entry point to WorkloadsManager.
*/
public static void
getPropertiesOfAMsSqlServerProvider(com.azure.resourcemanager.workloads.WorkloadsManager manager) {
manager.providerInstances().getWithResponse("myResourceGroup", "mySapMonitor", "myProviderInstance",
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.workloads import WorkloadsMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-workloads
# USAGE
python ms_sql_server_provider_instance_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 = WorkloadsMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.provider_instances.get(
resource_group_name="myResourceGroup",
monitor_name="mySapMonitor",
provider_instance_name="myProviderInstance",
)
print(response)
# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/MsSqlServerProviderInstance_Get.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 armworkloads_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/workloads/armworkloads"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/MsSqlServerProviderInstance_Get.json
func ExampleProviderInstancesClient_Get_getPropertiesOfAMsSqlServerProvider() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armworkloads.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewProviderInstancesClient().Get(ctx, "myResourceGroup", "mySapMonitor", "myProviderInstance", 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.ProviderInstance = armworkloads.ProviderInstance{
// Name: to.Ptr("myProviderInstance"),
// Type: to.Ptr("Microsoft.Workloads/monitors/providerInstances"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/monitors/mySapMonitor/providerInstances/myProviderInstance"),
// SystemData: &armworkloads.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()),
// CreatedBy: to.Ptr("user@xyz.com"),
// CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()),
// LastModifiedBy: to.Ptr("user@xyz.com"),
// LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser),
// },
// Properties: &armworkloads.ProviderInstanceProperties{
// ProviderSettings: &armworkloads.MsSQLServerProviderInstanceProperties{
// ProviderType: to.Ptr("MsSqlServer"),
// DbPasswordURI: to.Ptr(""),
// DbPort: to.Ptr("5912"),
// DbUsername: to.Ptr("user"),
// Hostname: to.Ptr("hostname"),
// SapSid: to.Ptr("sid"),
// SSLCertificateURI: to.Ptr("https://storageaccount.blob.core.windows.net/containername/filename"),
// SSLPreference: to.Ptr(armworkloads.SSLPreferenceServerCertificate),
// },
// ProvisioningState: to.Ptr(armworkloads.WorkloadMonitorProvisioningStateSucceeded),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { WorkloadsClient } = require("@azure/arm-workloads");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name.
*
* @summary Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name.
* x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/MsSqlServerProviderInstance_Get.json
*/
async function getPropertiesOfAMSSqlServerProvider() {
const subscriptionId =
process.env["WORKLOADS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup";
const monitorName = "mySapMonitor";
const providerInstanceName = "myProviderInstance";
const credential = new DefaultAzureCredential();
const client = new WorkloadsClient(credential, subscriptionId);
const result = await client.providerInstances.get(
resourceGroupName,
monitorName,
providerInstanceName
);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Workloads.Models;
using Azure.ResourceManager.Workloads;
// Generated from example definition: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/MsSqlServerProviderInstance_Get.json
// this example is just showing the usage of "ProviderInstances_Get" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SapMonitorResource created on azure
// for more information of creating SapMonitorResource, please refer to the document of SapMonitorResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "myResourceGroup";
string monitorName = "mySapMonitor";
ResourceIdentifier sapMonitorResourceId = SapMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName);
SapMonitorResource sapMonitor = client.GetSapMonitorResource(sapMonitorResourceId);
// get the collection of this SapProviderInstanceResource
SapProviderInstanceCollection collection = sapMonitor.GetSapProviderInstances();
// invoke the operation
string providerInstanceName = "myProviderInstance";
NullableResponse<SapProviderInstanceResource> response = await collection.GetIfExistsAsync(providerInstanceName);
SapProviderInstanceResource result = response.HasValue ? response.Value : null;
if (result == null)
{
Console.WriteLine("Succeeded with null as result");
}
else
{
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SapProviderInstanceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Resposta de exemplo
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/monitors/mySapMonitor/providerInstances/myProviderInstance",
"name": "myProviderInstance",
"type": "Microsoft.Workloads/monitors/providerInstances",
"systemData": {
"createdBy": "user@xyz.com",
"createdByType": "User",
"createdAt": "2021-08-19T15:10:46.196Z",
"lastModifiedBy": "user@xyz.com",
"lastModifiedByType": "User",
"lastModifiedAt": "2021-08-19T15:10:46.196Z"
},
"properties": {
"provisioningState": "Succeeded",
"providerSettings": {
"providerType": "MsSqlServer",
"dbUsername": "user",
"dbPort": "5912",
"hostname": "hostname",
"dbPasswordUri": "",
"sapSid": "sid",
"sslCertificateUri": "https://storageaccount.blob.core.windows.net/containername/filename",
"sslPreference": "ServerCertificate"
}
}
}
Get properties of a OS provider
Solicitação de exemplo
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/monitors/mySapMonitor/providerInstances/myProviderInstance?api-version=2023-04-01
/**
* Samples for ProviderInstances Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/
* PrometheusOSProviderInstances_Get.json
*/
/**
* Sample code: Get properties of a OS provider.
*
* @param manager Entry point to WorkloadsManager.
*/
public static void getPropertiesOfAOSProvider(com.azure.resourcemanager.workloads.WorkloadsManager manager) {
manager.providerInstances().getWithResponse("myResourceGroup", "mySapMonitor", "myProviderInstance",
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.workloads import WorkloadsMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-workloads
# USAGE
python prometheus_os_provider_instances_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 = WorkloadsMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.provider_instances.get(
resource_group_name="myResourceGroup",
monitor_name="mySapMonitor",
provider_instance_name="myProviderInstance",
)
print(response)
# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/PrometheusOSProviderInstances_Get.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 armworkloads_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/workloads/armworkloads"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/PrometheusOSProviderInstances_Get.json
func ExampleProviderInstancesClient_Get_getPropertiesOfAOsProvider() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armworkloads.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewProviderInstancesClient().Get(ctx, "myResourceGroup", "mySapMonitor", "myProviderInstance", 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.ProviderInstance = armworkloads.ProviderInstance{
// Name: to.Ptr("myProviderInstance"),
// Type: to.Ptr("Microsoft.Workloads/monitors/providerInstances"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/monitors/mySapMonitor/providerInstances/myProviderInstance"),
// SystemData: &armworkloads.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()),
// CreatedBy: to.Ptr("user@xyz.com"),
// CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()),
// LastModifiedBy: to.Ptr("user@xyz.com"),
// LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser),
// },
// Properties: &armworkloads.ProviderInstanceProperties{
// ProviderSettings: &armworkloads.PrometheusOSProviderInstanceProperties{
// ProviderType: to.Ptr("PrometheusOS"),
// PrometheusURL: to.Ptr("http://192.168.0.0:9090/metrics"),
// SapSid: to.Ptr("SID"),
// SSLCertificateURI: to.Ptr("https://storageaccount.blob.core.windows.net/containername/filename"),
// SSLPreference: to.Ptr(armworkloads.SSLPreferenceServerCertificate),
// },
// ProvisioningState: to.Ptr(armworkloads.WorkloadMonitorProvisioningStateSucceeded),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { WorkloadsClient } = require("@azure/arm-workloads");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name.
*
* @summary Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name.
* x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/PrometheusOSProviderInstances_Get.json
*/
async function getPropertiesOfAOSProvider() {
const subscriptionId =
process.env["WORKLOADS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup";
const monitorName = "mySapMonitor";
const providerInstanceName = "myProviderInstance";
const credential = new DefaultAzureCredential();
const client = new WorkloadsClient(credential, subscriptionId);
const result = await client.providerInstances.get(
resourceGroupName,
monitorName,
providerInstanceName
);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Workloads.Models;
using Azure.ResourceManager.Workloads;
// Generated from example definition: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/PrometheusOSProviderInstances_Get.json
// this example is just showing the usage of "ProviderInstances_Get" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SapMonitorResource created on azure
// for more information of creating SapMonitorResource, please refer to the document of SapMonitorResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "myResourceGroup";
string monitorName = "mySapMonitor";
ResourceIdentifier sapMonitorResourceId = SapMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName);
SapMonitorResource sapMonitor = client.GetSapMonitorResource(sapMonitorResourceId);
// get the collection of this SapProviderInstanceResource
SapProviderInstanceCollection collection = sapMonitor.GetSapProviderInstances();
// invoke the operation
string providerInstanceName = "myProviderInstance";
NullableResponse<SapProviderInstanceResource> response = await collection.GetIfExistsAsync(providerInstanceName);
SapProviderInstanceResource result = response.HasValue ? response.Value : null;
if (result == null)
{
Console.WriteLine("Succeeded with null as result");
}
else
{
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SapProviderInstanceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Resposta de exemplo
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/monitors/mySapMonitor/providerInstances/myProviderInstance",
"name": "myProviderInstance",
"type": "Microsoft.Workloads/monitors/providerInstances",
"systemData": {
"createdBy": "user@xyz.com",
"createdByType": "User",
"createdAt": "2021-08-19T15:10:46.196Z",
"lastModifiedBy": "user@xyz.com",
"lastModifiedByType": "User",
"lastModifiedAt": "2021-08-19T15:10:46.196Z"
},
"properties": {
"provisioningState": "Succeeded",
"providerSettings": {
"providerType": "PrometheusOS",
"prometheusUrl": "http://192.168.0.0:9090/metrics",
"sslCertificateUri": "https://storageaccount.blob.core.windows.net/containername/filename",
"sslPreference": "ServerCertificate",
"sapSid": "SID"
}
}
}
Get properties of a PrometheusHaCluster provider
Solicitação de exemplo
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/monitors/mySapMonitor/providerInstances/myProviderInstance?api-version=2023-04-01
/**
* Samples for ProviderInstances Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/
* PrometheusHaClusterProviderInstances_Get.json
*/
/**
* Sample code: Get properties of a PrometheusHaCluster provider.
*
* @param manager Entry point to WorkloadsManager.
*/
public static void
getPropertiesOfAPrometheusHaClusterProvider(com.azure.resourcemanager.workloads.WorkloadsManager manager) {
manager.providerInstances().getWithResponse("myResourceGroup", "mySapMonitor", "myProviderInstance",
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.workloads import WorkloadsMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-workloads
# USAGE
python prometheus_ha_cluster_provider_instances_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 = WorkloadsMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.provider_instances.get(
resource_group_name="myResourceGroup",
monitor_name="mySapMonitor",
provider_instance_name="myProviderInstance",
)
print(response)
# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/PrometheusHaClusterProviderInstances_Get.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 armworkloads_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/workloads/armworkloads"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/PrometheusHaClusterProviderInstances_Get.json
func ExampleProviderInstancesClient_Get_getPropertiesOfAPrometheusHaClusterProvider() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armworkloads.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewProviderInstancesClient().Get(ctx, "myResourceGroup", "mySapMonitor", "myProviderInstance", 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.ProviderInstance = armworkloads.ProviderInstance{
// Name: to.Ptr("myProviderInstance"),
// Type: to.Ptr("Microsoft.Workloads/monitors/providerInstances"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/monitors/mySapMonitor/providerInstances/myProviderInstance"),
// SystemData: &armworkloads.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()),
// CreatedBy: to.Ptr("user@xyz.com"),
// CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()),
// LastModifiedBy: to.Ptr("user@xyz.com"),
// LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser),
// },
// Properties: &armworkloads.ProviderInstanceProperties{
// ProviderSettings: &armworkloads.PrometheusHaClusterProviderInstanceProperties{
// ProviderType: to.Ptr("PrometheusHaCluster"),
// ClusterName: to.Ptr("clusterName"),
// Hostname: to.Ptr("hostname"),
// PrometheusURL: to.Ptr("http://192.168.0.0:9090/metrics"),
// Sid: to.Ptr("sid"),
// SSLCertificateURI: to.Ptr("https://storageaccount.blob.core.windows.net/containername/filename"),
// SSLPreference: to.Ptr(armworkloads.SSLPreferenceServerCertificate),
// },
// ProvisioningState: to.Ptr(armworkloads.WorkloadMonitorProvisioningStateSucceeded),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { WorkloadsClient } = require("@azure/arm-workloads");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name.
*
* @summary Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name.
* x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/PrometheusHaClusterProviderInstances_Get.json
*/
async function getPropertiesOfAPrometheusHaClusterProvider() {
const subscriptionId =
process.env["WORKLOADS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup";
const monitorName = "mySapMonitor";
const providerInstanceName = "myProviderInstance";
const credential = new DefaultAzureCredential();
const client = new WorkloadsClient(credential, subscriptionId);
const result = await client.providerInstances.get(
resourceGroupName,
monitorName,
providerInstanceName
);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Workloads.Models;
using Azure.ResourceManager.Workloads;
// Generated from example definition: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/PrometheusHaClusterProviderInstances_Get.json
// this example is just showing the usage of "ProviderInstances_Get" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SapMonitorResource created on azure
// for more information of creating SapMonitorResource, please refer to the document of SapMonitorResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "myResourceGroup";
string monitorName = "mySapMonitor";
ResourceIdentifier sapMonitorResourceId = SapMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName);
SapMonitorResource sapMonitor = client.GetSapMonitorResource(sapMonitorResourceId);
// get the collection of this SapProviderInstanceResource
SapProviderInstanceCollection collection = sapMonitor.GetSapProviderInstances();
// invoke the operation
string providerInstanceName = "myProviderInstance";
NullableResponse<SapProviderInstanceResource> response = await collection.GetIfExistsAsync(providerInstanceName);
SapProviderInstanceResource result = response.HasValue ? response.Value : null;
if (result == null)
{
Console.WriteLine("Succeeded with null as result");
}
else
{
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SapProviderInstanceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Resposta de exemplo
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/monitors/mySapMonitor/providerInstances/myProviderInstance",
"name": "myProviderInstance",
"type": "Microsoft.Workloads/monitors/providerInstances",
"systemData": {
"createdBy": "user@xyz.com",
"createdByType": "User",
"createdAt": "2021-08-19T15:10:46.196Z",
"lastModifiedBy": "user@xyz.com",
"lastModifiedByType": "User",
"lastModifiedAt": "2021-08-19T15:10:46.196Z"
},
"properties": {
"provisioningState": "Succeeded",
"providerSettings": {
"providerType": "PrometheusHaCluster",
"prometheusUrl": "http://192.168.0.0:9090/metrics",
"hostname": "hostname",
"sid": "sid",
"clusterName": "clusterName",
"sslCertificateUri": "https://storageaccount.blob.core.windows.net/containername/filename",
"sslPreference": "ServerCertificate"
}
}
}
Get properties of a SAP monitor Hana provider
Solicitação de exemplo
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/monitors/mySapMonitor/providerInstances/myProviderInstance?api-version=2023-04-01
/**
* Samples for ProviderInstances Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/
* ProviderInstances_Get.json
*/
/**
* Sample code: Get properties of a SAP monitor Hana provider.
*
* @param manager Entry point to WorkloadsManager.
*/
public static void
getPropertiesOfASAPMonitorHanaProvider(com.azure.resourcemanager.workloads.WorkloadsManager manager) {
manager.providerInstances().getWithResponse("myResourceGroup", "mySapMonitor", "myProviderInstance",
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.workloads import WorkloadsMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-workloads
# USAGE
python provider_instances_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 = WorkloadsMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.provider_instances.get(
resource_group_name="myResourceGroup",
monitor_name="mySapMonitor",
provider_instance_name="myProviderInstance",
)
print(response)
# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ProviderInstances_Get.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 armworkloads_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/workloads/armworkloads"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ProviderInstances_Get.json
func ExampleProviderInstancesClient_Get_getPropertiesOfASapMonitorHanaProvider() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armworkloads.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewProviderInstancesClient().Get(ctx, "myResourceGroup", "mySapMonitor", "myProviderInstance", 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.ProviderInstance = armworkloads.ProviderInstance{
// Name: to.Ptr("myProviderInstance"),
// Type: to.Ptr("Microsoft.Workloads/monitors/providerInstances"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/monitors/mySapMonitor/providerInstances/myProviderInstance"),
// SystemData: &armworkloads.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()),
// CreatedBy: to.Ptr("user@xyz.com"),
// CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()),
// LastModifiedBy: to.Ptr("user@xyz.com"),
// LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser),
// },
// Properties: &armworkloads.ProviderInstanceProperties{
// ProviderSettings: &armworkloads.HanaDbProviderInstanceProperties{
// ProviderType: to.Ptr("SapHana"),
// DbName: to.Ptr("db"),
// DbPasswordURI: to.Ptr(""),
// DbUsername: to.Ptr("user"),
// Hostname: to.Ptr("name"),
// InstanceNumber: to.Ptr("00"),
// SapSid: to.Ptr("SID"),
// SQLPort: to.Ptr("0000"),
// SSLCertificateURI: to.Ptr("https://storageaccount.blob.core.windows.net/containername/filename"),
// SSLHostNameInCertificate: to.Ptr("xyz.domain.com"),
// SSLPreference: to.Ptr(armworkloads.SSLPreferenceServerCertificate),
// },
// ProvisioningState: to.Ptr(armworkloads.WorkloadMonitorProvisioningStateSucceeded),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { WorkloadsClient } = require("@azure/arm-workloads");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name.
*
* @summary Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name.
* x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ProviderInstances_Get.json
*/
async function getPropertiesOfASapMonitorHanaProvider() {
const subscriptionId =
process.env["WORKLOADS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup";
const monitorName = "mySapMonitor";
const providerInstanceName = "myProviderInstance";
const credential = new DefaultAzureCredential();
const client = new WorkloadsClient(credential, subscriptionId);
const result = await client.providerInstances.get(
resourceGroupName,
monitorName,
providerInstanceName
);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Workloads.Models;
using Azure.ResourceManager.Workloads;
// Generated from example definition: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ProviderInstances_Get.json
// this example is just showing the usage of "ProviderInstances_Get" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SapMonitorResource created on azure
// for more information of creating SapMonitorResource, please refer to the document of SapMonitorResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "myResourceGroup";
string monitorName = "mySapMonitor";
ResourceIdentifier sapMonitorResourceId = SapMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName);
SapMonitorResource sapMonitor = client.GetSapMonitorResource(sapMonitorResourceId);
// get the collection of this SapProviderInstanceResource
SapProviderInstanceCollection collection = sapMonitor.GetSapProviderInstances();
// invoke the operation
string providerInstanceName = "myProviderInstance";
NullableResponse<SapProviderInstanceResource> response = await collection.GetIfExistsAsync(providerInstanceName);
SapProviderInstanceResource result = response.HasValue ? response.Value : null;
if (result == null)
{
Console.WriteLine("Succeeded with null as result");
}
else
{
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SapProviderInstanceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Resposta de exemplo
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/monitors/mySapMonitor/providerInstances/myProviderInstance",
"name": "myProviderInstance",
"type": "Microsoft.Workloads/monitors/providerInstances",
"systemData": {
"createdBy": "user@xyz.com",
"createdByType": "User",
"createdAt": "2021-08-19T15:10:46.196Z",
"lastModifiedBy": "user@xyz.com",
"lastModifiedByType": "User",
"lastModifiedAt": "2021-08-19T15:10:46.196Z"
},
"properties": {
"provisioningState": "Succeeded",
"providerSettings": {
"providerType": "SapHana",
"hostname": "name",
"dbName": "db",
"sqlPort": "0000",
"instanceNumber": "00",
"dbUsername": "user",
"dbPasswordUri": "",
"sslHostNameInCertificate": "xyz.domain.com",
"sslPreference": "ServerCertificate",
"sslCertificateUri": "https://storageaccount.blob.core.windows.net/containername/filename",
"sapSid": "SID"
}
}
}
Get properties of a SAP monitor NetWeaver provider
Solicitação de exemplo
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/monitors/mySapMonitor/providerInstances/myProviderInstance?api-version=2023-04-01
/**
* Samples for ProviderInstances Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/
* NetWeaverProviderInstances_Get.json
*/
/**
* Sample code: Get properties of a SAP monitor NetWeaver provider.
*
* @param manager Entry point to WorkloadsManager.
*/
public static void
getPropertiesOfASAPMonitorNetWeaverProvider(com.azure.resourcemanager.workloads.WorkloadsManager manager) {
manager.providerInstances().getWithResponse("myResourceGroup", "mySapMonitor", "myProviderInstance",
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.workloads import WorkloadsMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-workloads
# USAGE
python net_weaver_provider_instances_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 = WorkloadsMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.provider_instances.get(
resource_group_name="myResourceGroup",
monitor_name="mySapMonitor",
provider_instance_name="myProviderInstance",
)
print(response)
# x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/NetWeaverProviderInstances_Get.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 armworkloads_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/workloads/armworkloads"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/NetWeaverProviderInstances_Get.json
func ExampleProviderInstancesClient_Get_getPropertiesOfASapMonitorNetWeaverProvider() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armworkloads.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewProviderInstancesClient().Get(ctx, "myResourceGroup", "mySapMonitor", "myProviderInstance", 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.ProviderInstance = armworkloads.ProviderInstance{
// Name: to.Ptr("myProviderInstance"),
// Type: to.Ptr("Microsoft.Workloads/monitors/providerInstances"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/monitors/mySapMonitor/providerInstances/myProviderInstance"),
// SystemData: &armworkloads.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()),
// CreatedBy: to.Ptr("user@xyz.com"),
// CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()),
// LastModifiedBy: to.Ptr("user@xyz.com"),
// LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser),
// },
// Properties: &armworkloads.ProviderInstanceProperties{
// ProviderSettings: &armworkloads.SapNetWeaverProviderInstanceProperties{
// ProviderType: to.Ptr("SapNetWeaver"),
// SapClientID: to.Ptr("111"),
// SapHostFileEntries: []*string{
// to.Ptr("127.0.0.1 name fqdn")},
// SapHostname: to.Ptr("name"),
// SapInstanceNr: to.Ptr("00"),
// SapPasswordURI: to.Ptr(""),
// SapPortNumber: to.Ptr("1234"),
// SapSid: to.Ptr("SID"),
// SapUsername: to.Ptr("username"),
// SSLCertificateURI: to.Ptr("https://storageaccount.blob.core.windows.net/containername/filename"),
// SSLPreference: to.Ptr(armworkloads.SSLPreferenceServerCertificate),
// },
// ProvisioningState: to.Ptr(armworkloads.WorkloadMonitorProvisioningStateSucceeded),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { WorkloadsClient } = require("@azure/arm-workloads");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name.
*
* @summary Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name.
* x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/NetWeaverProviderInstances_Get.json
*/
async function getPropertiesOfASapMonitorNetWeaverProvider() {
const subscriptionId =
process.env["WORKLOADS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup";
const monitorName = "mySapMonitor";
const providerInstanceName = "myProviderInstance";
const credential = new DefaultAzureCredential();
const client = new WorkloadsClient(credential, subscriptionId);
const result = await client.providerInstances.get(
resourceGroupName,
monitorName,
providerInstanceName
);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Workloads.Models;
using Azure.ResourceManager.Workloads;
// Generated from example definition: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/NetWeaverProviderInstances_Get.json
// this example is just showing the usage of "ProviderInstances_Get" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SapMonitorResource created on azure
// for more information of creating SapMonitorResource, please refer to the document of SapMonitorResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "myResourceGroup";
string monitorName = "mySapMonitor";
ResourceIdentifier sapMonitorResourceId = SapMonitorResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, monitorName);
SapMonitorResource sapMonitor = client.GetSapMonitorResource(sapMonitorResourceId);
// get the collection of this SapProviderInstanceResource
SapProviderInstanceCollection collection = sapMonitor.GetSapProviderInstances();
// invoke the operation
string providerInstanceName = "myProviderInstance";
NullableResponse<SapProviderInstanceResource> response = await collection.GetIfExistsAsync(providerInstanceName);
SapProviderInstanceResource result = response.HasValue ? response.Value : null;
if (result == null)
{
Console.WriteLine("Succeeded with null as result");
}
else
{
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SapProviderInstanceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Resposta de exemplo
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/monitors/mySapMonitor/providerInstances/myProviderInstance",
"name": "myProviderInstance",
"type": "Microsoft.Workloads/monitors/providerInstances",
"systemData": {
"createdBy": "user@xyz.com",
"createdByType": "User",
"createdAt": "2021-08-19T15:10:46.196Z",
"lastModifiedBy": "user@xyz.com",
"lastModifiedByType": "User",
"lastModifiedAt": "2021-08-19T15:10:46.196Z"
},
"properties": {
"provisioningState": "Succeeded",
"providerSettings": {
"providerType": "SapNetWeaver",
"sapSid": "SID",
"sapHostname": "name",
"sapInstanceNr": "00",
"sapHostFileEntries": [
"127.0.0.1 name fqdn"
],
"sapUsername": "username",
"sapPasswordUri": "",
"sapPortNumber": "1234",
"sapClientId": "111",
"sslPreference": "ServerCertificate",
"sslCertificateUri": "https://storageaccount.blob.core.windows.net/containername/filename"
}
}
}
Definições
createdByType
Enumeração
O tipo de identidade que criou o recurso.
Valor |
Description |
Application
|
|
Key
|
|
ManagedIdentity
|
|
User
|
|
DB2ProviderInstanceProperties
Objeto
Obtém ou define as propriedades do provedor DB2.
Nome |
Tipo |
Description |
dbName
|
string
|
Obtém ou define o nome do banco de dados db2.
|
dbPassword
|
string
|
Obtém ou define a senha do banco de dados db2.
|
dbPasswordUri
|
string
|
Obtém ou define o URI do cofre de chaves para segredo com a senha do banco de dados.
|
dbPort
|
string
|
Obtém ou define a porta sql do banco de dados db2.
|
dbUsername
|
string
|
Obtém ou define o nome de usuário do banco de dados db2.
|
hostname
|
string
|
Obtém ou define o nome da máquina virtual de destino.
|
providerType
|
string:
Db2
|
O tipo de provedor. Por exemplo, o valor pode ser SapHana.
|
sapSid
|
string
|
Obtém ou define o Identificador do Sistema SAP
|
sslCertificateUri
|
string
|
Obtém ou define o URI do blob como certificado SSL para o Banco de Dados DB2.
|
sslPreference
|
sslPreference
|
Obtém ou define a preferência do certificado se a comunicação segura estiver habilitada.
|
Error
Objeto
Objeto de erro padrão.
Nome |
Tipo |
Description |
code
|
string
|
Conjunto definido pelo servidor de códigos de erro.
|
details
|
Error[]
|
Matriz de detalhes sobre erros específicos que levaram a esse erro relatado.
|
innerError
|
InnerError
|
Objeto que contém informações mais específicas do que o objeto atual sobre o erro.
|
message
|
string
|
Representação legível por humanos do erro.
|
target
|
string
|
Destino do erro.
|
ErrorAdditionalInfo
Objeto
As informações adicionais do erro de gerenciamento de recursos.
Nome |
Tipo |
Description |
info
|
object
|
As informações adicionais.
|
type
|
string
|
O tipo de informação adicional.
|
ErrorDetail
Objeto
O detalhe do erro.
Nome |
Tipo |
Description |
additionalInfo
|
ErrorAdditionalInfo[]
|
As informações adicionais do erro.
|
code
|
string
|
O código de erro.
|
details
|
ErrorDetail[]
|
Os detalhes do erro.
|
message
|
string
|
A mensagem de erro.
|
target
|
string
|
O destino do erro.
|
ErrorResponse
Objeto
Resposta de erro
Nome |
Tipo |
Description |
error
|
ErrorDetail
|
O objeto de erro.
|
Errors
Objeto
Define os erros de instância do provedor.
Nome |
Tipo |
Description |
code
|
string
|
Conjunto definido pelo servidor de códigos de erro.
|
details
|
Error[]
|
Matriz de detalhes sobre erros específicos que levaram a esse erro relatado.
|
innerError
|
InnerError
|
Objeto que contém informações mais específicas do que o objeto atual sobre o erro.
|
message
|
string
|
Representação legível por humanos do erro.
|
target
|
string
|
Destino do erro.
|
HanaDbProviderInstanceProperties
Objeto
Obtém ou define as propriedades do provedor.
Nome |
Tipo |
Description |
dbName
|
string
|
Obtém ou define o nome do banco de dados do hana.
|
dbPassword
|
string
|
Obtém ou define a senha do banco de dados.
|
dbPasswordUri
|
string
|
Obtém ou define o URI do cofre de chaves para segredo com a senha do banco de dados.
|
dbUsername
|
string
|
Obtém ou define o nome de usuário do banco de dados.
|
hostname
|
string
|
Obtém ou define o tamanho da máquina virtual de destino.
|
instanceNumber
|
string
|
Obtém ou define o número da instância do banco de dados.
|
providerType
|
string:
SapHana
|
O tipo de provedor. Por exemplo, o valor pode ser SapHana.
|
sapSid
|
string
|
Obtém ou define o Identificador do Sistema SAP.
|
sqlPort
|
string
|
Obtém ou define a porta sql do banco de dados.
|
sslCertificateUri
|
string
|
Obtém ou define o URI do blob como certificado SSL para o BD.
|
sslHostNameInCertificate
|
string
|
Obtém ou define os nomes de host no certificado SSL.
|
sslPreference
|
sslPreference
|
Obtém ou define a preferência do certificado se a comunicação segura estiver habilitada.
|
InnerError
Objeto
Objeto que contém informações mais específicas do que o objeto atual sobre o erro.
Nome |
Tipo |
Description |
innerError
|
Error
|
Objeto de erro padrão.
|
ManagedServiceIdentityType
Enumeração
Tipo de identidade de serviço gerenciado (somente nenhum, tipos UserAssigned são permitidos).
Valor |
Description |
None
|
|
UserAssigned
|
|
MsSqlServerProviderInstanceProperties
Objeto
Obtém ou define as propriedades do provedor do SQL Server.
Nome |
Tipo |
Description |
dbPassword
|
string
|
Obtém ou define a senha do banco de dados.
|
dbPasswordUri
|
string
|
Obtém ou define o URI do cofre de chaves para segredo com a senha do banco de dados.
|
dbPort
|
string
|
Obtém ou define a porta sql do banco de dados.
|
dbUsername
|
string
|
Obtém ou define o nome de usuário do banco de dados.
|
hostname
|
string
|
Obtém ou define o nome do host do SQL Server.
|
providerType
|
string:
MsSqlServer
|
O tipo de provedor. Por exemplo, o valor pode ser SapHana.
|
sapSid
|
string
|
Obtém ou define o Identificador do Sistema SAP
|
sslCertificateUri
|
string
|
Obtém ou define o URI do blob como certificado SSL para o Banco de Dados SQL.
|
sslPreference
|
sslPreference
|
Obtém ou define a preferência do certificado se a comunicação segura estiver habilitada.
|
PrometheusHaClusterProviderInstanceProperties
Objeto
Obtém ou define as propriedades do provedor PrometheusHaCluster.
Nome |
Tipo |
Description |
clusterName
|
string
|
Obtém ou define o clusterName.
|
hostname
|
string
|
Obtém ou define o nome do computador de destino.
|
prometheusUrl
|
string
|
URL do ponto de extremidade exportador de nó.
|
providerType
|
string:
PrometheusHaCluster
|
O tipo de provedor. Por exemplo, o valor pode ser SapHana.
|
sid
|
string
|
Obtém ou define o sid do cluster.
|
sslCertificateUri
|
string
|
Obtém ou define o URI do blob como certificado SSL para o exportador de cluster de HA.
|
sslPreference
|
sslPreference
|
Obtém ou define a preferência do certificado se a comunicação segura estiver habilitada.
|
PrometheusOSProviderInstanceProperties
Objeto
Obtém ou define as propriedades do provedor PrometheusOS.
Nome |
Tipo |
Description |
prometheusUrl
|
string
|
URL do ponto de extremidade exportador de nós
|
providerType
|
string:
PrometheusOS
|
O tipo de provedor. Por exemplo, o valor pode ser SapHana.
|
sapSid
|
string
|
Obtém ou define o Identificador do Sistema SAP
|
sslCertificateUri
|
string
|
Obtém ou define o URI do blob como certificado SSL para o exportador de nós prometheus.
|
sslPreference
|
sslPreference
|
Obtém ou define a preferência do certificado se a comunicação segura estiver habilitada.
|
ProviderInstance
Objeto
Uma instância de provedor associada ao monitor SAP.
Nome |
Tipo |
Description |
id
|
string
|
ID de recurso totalmente qualificada para o recurso. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
identity
|
UserAssignedServiceIdentity
|
[atualmente não está em uso] Identidade de serviço gerenciada (identidades atribuídas pelo usuário)
|
name
|
string
|
O nome do recurso
|
properties.errors
|
Errors
|
Define os erros de instância do provedor.
|
properties.providerSettings
|
ProviderSpecificProperties:
|
Define as propriedades específicas do provedor.
|
properties.provisioningState
|
WorkloadMonitorProvisioningState
|
Estado do provisionamento da instância do provedor
|
systemData
|
systemData
|
Metadados do Azure Resource Manager que contêm informações createdBy e modifiedBy.
|
type
|
string
|
O tipo do recurso. Por exemplo, "Microsoft.Compute/virtualMachines" ou "Microsoft.Storage/storageAccounts"
|
SapNetWeaverProviderInstanceProperties
Objeto
Obtém ou define as propriedades do provedor.
Nome |
Tipo |
Description |
providerType
|
string:
SapNetWeaver
|
O tipo de provedor. Por exemplo, o valor pode ser SapHana.
|
sapClientId
|
string
|
Obtém ou define a ID do cliente SAP.
|
sapHostFileEntries
|
string[]
|
Obtém ou define a lista de Entradas hostFile
|
sapHostname
|
string
|
Obtém ou define o endereço IP da máquina virtual de destino/FQDN.
|
sapInstanceNr
|
string
|
Obtém ou define o número da instância do SAP NetWeaver.
|
sapPassword
|
string
|
Define a senha do SAP.
|
sapPasswordUri
|
string
|
Obtém ou define o URI do cofre de chaves para segredo com a senha sap.
|
sapPortNumber
|
string
|
Obtém ou define o número da porta HTTP do SAP.
|
sapSid
|
string
|
Obtém ou define o Identificador do Sistema SAP
|
sapUsername
|
string
|
Obtém ou define o nome de usuário sap.
|
sslCertificateUri
|
string
|
Obtém ou define o URI do blob como certificado SSL para o sistema SAP.
|
sslPreference
|
sslPreference
|
Obtém ou define a preferência do certificado se a comunicação segura estiver habilitada.
|
sslPreference
Enumeração
Obtém ou define a preferência do certificado se a comunicação segura estiver habilitada.
Valor |
Description |
Disabled
|
|
RootCertificate
|
|
ServerCertificate
|
|
systemData
Objeto
Metadados relativos à criação e última modificação do recurso.
Nome |
Tipo |
Description |
createdAt
|
string
(date-time)
|
O carimbo de data/hora da criação de recursos (UTC).
|
createdBy
|
string
|
A identidade que criou o recurso.
|
createdByType
|
createdByType
|
O tipo de identidade que criou o recurso.
|
lastModifiedAt
|
string
(date-time)
|
O carimbo de data/hora da última modificação do recurso (UTC)
|
lastModifiedBy
|
string
|
A identidade que modificou o recurso pela última vez.
|
lastModifiedByType
|
createdByType
|
O tipo de identidade que modificou o recurso pela última vez.
|
UserAssignedIdentity
Objeto
Propriedades de identidade atribuídas pelo usuário
Nome |
Tipo |
Description |
clientId
|
string
(uuid)
|
A ID do cliente da identidade atribuída.
|
principalId
|
string
(uuid)
|
A ID da entidade de segurança da identidade atribuída.
|
UserAssignedServiceIdentity
Objeto
Uma identidade atribuída pelo usuário pré-criada com as funções apropriadas atribuídas. Para saber mais sobre a identidade e as funções necessárias, visite o guia de instruções do ACSS.
WorkloadMonitorProvisioningState
Enumeração
Estado do provisionamento do monitor SAP.
Valor |
Description |
Accepted
|
|
Creating
|
|
Deleting
|
|
Failed
|
|
Migrating
|
|
Succeeded
|
|
Updating
|
|