Возвращает свойства экземпляра поставщика для указанной подписки, группы ресурсов, имени монитора SAP и имени ресурса.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/providerInstances/{providerInstanceName}?api-version=2023-04-01
Параметры URI
| Имя |
В |
Обязательно |
Тип |
Описание |
|
monitorName
|
path |
True
|
string
|
Имя ресурса монитора SAP.
|
|
providerInstanceName
|
path |
True
|
string
|
Имя экземпляра поставщика.
|
|
resourceGroupName
|
path |
True
|
string
minLength: 1 maxLength: 90
|
Имя группы ресурсов. Имя не учитывает регистр.
|
|
subscriptionId
|
path |
True
|
string
minLength: 1
|
Идентификатор целевой подписки.
|
|
api-version
|
query |
True
|
string
minLength: 1
|
Версия API, используемая для этой операции.
|
Ответы
Примеры
Get properties of a Db2 provider
Образец запроса
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
Пример ответа
{
"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
Образец запроса
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
Пример ответа
{
"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
Образец запроса
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
Пример ответа
{
"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
Образец запроса
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
Пример ответа
{
"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
Образец запроса
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
Пример ответа
{
"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
Образец запроса
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
Пример ответа
{
"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"
}
}
}
Определения
createdByType
Перечисление
Тип удостоверения, создавшего ресурс.
| Значение |
Описание |
|
User
|
|
|
Application
|
|
|
ManagedIdentity
|
|
|
Key
|
|
DB2ProviderInstanceProperties
Object
Возвращает или задает свойства поставщика DB2.
| Имя |
Тип |
Описание |
|
dbName
|
string
|
Возвращает или задает имя базы данных db2.
|
|
dbPassword
|
string
|
Возвращает или задает пароль базы данных db2.
|
|
dbPasswordUri
|
string
|
Возвращает или задает универсальный код ресурса (URI) хранилища ключей для секрета с помощью пароля базы данных.
|
|
dbPort
|
string
|
Возвращает или задает порт sql базы данных db2.
|
|
dbUsername
|
string
|
Возвращает или задает имя пользователя базы данных db2.
|
|
hostname
|
string
|
Возвращает или задает имя целевой виртуальной машины.
|
|
providerType
|
string:
Db2
|
Тип поставщика. Например, значение может быть SapHana.
|
|
sapSid
|
string
|
Возвращает или задает идентификатор системы SAP
|
|
sslCertificateUri
|
string
|
Возвращает или задает универсальный код ресурса (URI) БОЛЬШОго двоичного объекта в SSL-сертификат для базы данных DB2.
|
|
sslPreference
|
sslPreference
|
Возвращает или задает предпочтения сертификата, если включена безопасная связь.
|
Error
Object
Стандартный объект ошибки.
| Имя |
Тип |
Описание |
|
code
|
string
|
Определяемый сервером набор кодов ошибок.
|
|
details
|
Error[]
|
Массив сведений об определенных ошибках, которые привели к этой сообщаемой ошибке.
|
|
innerError
|
InnerError
|
Объект, содержащий более конкретные сведения, чем текущий объект об ошибке.
|
|
message
|
string
|
Читаемое человеком представление ошибки.
|
|
target
|
string
|
Цель ошибки.
|
ErrorAdditionalInfo
Object
Дополнительные сведения об ошибке управления ресурсами.
| Имя |
Тип |
Описание |
|
info
|
object
|
Дополнительные сведения.
|
|
type
|
string
|
Дополнительный тип сведений.
|
ErrorDetail
Object
Сведения об ошибке.
| Имя |
Тип |
Описание |
|
additionalInfo
|
ErrorAdditionalInfo[]
|
Дополнительные сведения об ошибке.
|
|
code
|
string
|
Код ошибки.
|
|
details
|
ErrorDetail[]
|
Сведения об ошибке.
|
|
message
|
string
|
Сообщение об ошибке.
|
|
target
|
string
|
Целевой объект ошибки.
|
ErrorResponse
Object
Ответ на ошибку
Errors
Object
Определяет ошибки экземпляра поставщика.
| Имя |
Тип |
Описание |
|
code
|
string
|
Определяемый сервером набор кодов ошибок.
|
|
details
|
Error[]
|
Массив сведений об определенных ошибках, которые привели к этой сообщаемой ошибке.
|
|
innerError
|
InnerError
|
Объект, содержащий более конкретные сведения, чем текущий объект об ошибке.
|
|
message
|
string
|
Читаемое человеком представление ошибки.
|
|
target
|
string
|
Цель ошибки.
|
HanaDbProviderInstanceProperties
Object
Возвращает или задает свойства поставщика.
| Имя |
Тип |
Описание |
|
dbName
|
string
|
Возвращает или задает имя базы данных hana.
|
|
dbPassword
|
string
|
Возвращает или задает пароль базы данных.
|
|
dbPasswordUri
|
string
|
Возвращает или задает универсальный код ресурса (URI) хранилища ключей для секрета с помощью пароля базы данных.
|
|
dbUsername
|
string
|
Возвращает или задает имя пользователя базы данных.
|
|
hostname
|
string
|
Возвращает или задает размер целевой виртуальной машины.
|
|
instanceNumber
|
string
|
Возвращает или задает номер экземпляра базы данных.
|
|
providerType
|
string:
SapHana
|
Тип поставщика. Например, значение может быть SapHana.
|
|
sapSid
|
string
|
Возвращает или задает идентификатор системы SAP.
|
|
sqlPort
|
string
|
Возвращает или задает порт sql базы данных.
|
|
sslCertificateUri
|
string
|
Возвращает или задает универсальный код ресурса (URI) большого двоичного объекта для SSL-сертификата для базы данных.
|
|
sslHostNameInCertificate
|
string
|
Возвращает или задает имена узлов в SSL-сертификате.
|
|
sslPreference
|
sslPreference
|
Возвращает или задает предпочтения сертификата, если включена безопасная связь.
|
InnerError
Object
Объект, содержащий более конкретные сведения, чем текущий объект об ошибке.
| Имя |
Тип |
Описание |
|
innerError
|
Error
|
Стандартный объект ошибки.
|
ManagedServiceIdentityType
Перечисление
Тип управляемого удостоверения службы (разрешены только типы UserAssigned).
| Значение |
Описание |
|
None
|
|
|
UserAssigned
|
|
MsSqlServerProviderInstanceProperties
Object
Возвращает или задает свойства поставщика SQL Server.
| Имя |
Тип |
Описание |
|
dbPassword
|
string
|
Возвращает или задает пароль базы данных.
|
|
dbPasswordUri
|
string
|
Возвращает или задает универсальный код ресурса (URI) хранилища ключей для секрета с помощью пароля базы данных.
|
|
dbPort
|
string
|
Возвращает или задает порт sql базы данных.
|
|
dbUsername
|
string
|
Возвращает или задает имя пользователя базы данных.
|
|
hostname
|
string
|
Возвращает или задает имя узла SQL Server.
|
|
providerType
|
string:
MsSqlServer
|
Тип поставщика. Например, значение может быть SapHana.
|
|
sapSid
|
string
|
Возвращает или задает идентификатор системы SAP
|
|
sslCertificateUri
|
string
|
Возвращает или задает универсальный код ресурса (URI) БОЛЬШОго двоичного объекта в SSL-сертификат для базы данных SQL.
|
|
sslPreference
|
sslPreference
|
Возвращает или задает предпочтения сертификата, если включена безопасная связь.
|
PrometheusHaClusterProviderInstanceProperties
Object
Возвращает или задает свойства поставщика PrometheusHaCluster.
| Имя |
Тип |
Описание |
|
clusterName
|
string
|
Возвращает или задает имя кластера.
|
|
hostname
|
string
|
Возвращает или задает имя целевого компьютера.
|
|
prometheusUrl
|
string
|
URL-адрес конечной точки экспортера узлов.
|
|
providerType
|
string:
PrometheusHaCluster
|
Тип поставщика. Например, значение может быть SapHana.
|
|
sid
|
string
|
Возвращает или задает идентификатор безопасности кластера.
|
|
sslCertificateUri
|
string
|
Возвращает или задает универсальный код ресурса (URI) БОЛЬШОго двоичного объекта в SSL-сертификат для экспортера кластера высокого уровня доступности.
|
|
sslPreference
|
sslPreference
|
Возвращает или задает предпочтения сертификата, если включена безопасная связь.
|
PrometheusOSProviderInstanceProperties
Object
Возвращает или задает свойства поставщика PrometheusOS.
| Имя |
Тип |
Описание |
|
prometheusUrl
|
string
|
URL-адрес конечной точки экспортера узлов
|
|
providerType
|
string:
PrometheusOS
|
Тип поставщика. Например, значение может быть SapHana.
|
|
sapSid
|
string
|
Возвращает или задает идентификатор системы SAP
|
|
sslCertificateUri
|
string
|
Возвращает или задает универсальный код ресурса (URI) большого двоичного объекта для SSL-сертификата для экспортера узлов prometheus.
|
|
sslPreference
|
sslPreference
|
Возвращает или задает предпочтения сертификата, если включена безопасная связь.
|
ProviderInstance
Object
Экземпляр поставщика, связанный с монитором SAP.
| Имя |
Тип |
Описание |
|
id
|
string
|
Полный идентификатор ресурса для ресурса. Пример - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
|
identity
|
UserAssignedServiceIdentity
|
[в настоящее время не используется] Управляемое удостоверение службы (назначенные пользователем удостоверения)
|
|
name
|
string
|
Имя ресурса
|
|
properties.errors
|
Errors
|
Определяет ошибки экземпляра поставщика.
|
|
properties.providerSettings
|
ProviderSpecificProperties:
|
Определяет определенные свойства поставщика.
|
|
properties.provisioningState
|
WorkloadMonitorProvisioningState
|
Состояние подготовки экземпляра поставщика
|
|
systemData
|
systemData
|
Метаданные Azure Resource Manager, содержащие данные createdBy и modifiedBy.
|
|
type
|
string
|
Тип ресурса. Например, "Microsoft.Compute/virtualMachines" или "Microsoft.Storage/storageAccounts"
|
SapNetWeaverProviderInstanceProperties
Object
Возвращает или задает свойства поставщика.
| Имя |
Тип |
Описание |
|
providerType
|
string:
SapNetWeaver
|
Тип поставщика. Например, значение может быть SapHana.
|
|
sapClientId
|
string
|
Возвращает или задает идентификатор клиента SAP.
|
|
sapHostFileEntries
|
string[]
|
Возвращает или задает список записей HostFile
|
|
sapHostname
|
string
|
Возвращает или задает IP-адрес целевой виртуальной машины или полное доменное имя.
|
|
sapInstanceNr
|
string
|
Возвращает или задает номер экземпляра SAP NetWeaver.
|
|
sapPassword
|
string
|
Задает пароль SAP.
|
|
sapPasswordUri
|
string
|
Возвращает или задает универсальный код ресурса (URI) хранилища ключей для секрета с помощью пароля SAP.
|
|
sapPortNumber
|
string
|
Возвращает или задает номер порта SAP HTTP.
|
|
sapSid
|
string
|
Возвращает или задает идентификатор системы SAP
|
|
sapUsername
|
string
|
Возвращает или задает имя пользователя SAP.
|
|
sslCertificateUri
|
string
|
Возвращает или задает универсальный код ресурса (URI) БОЛЬШОго двоичного объекта в SSL-сертификат для системы SAP.
|
|
sslPreference
|
sslPreference
|
Возвращает или задает предпочтения сертификата, если включена безопасная связь.
|
sslPreference
Перечисление
Возвращает или задает предпочтения сертификата, если включена безопасная связь.
| Значение |
Описание |
|
Disabled
|
|
|
RootCertificate
|
|
|
ServerCertificate
|
|
systemData
Object
Метаданные, относящиеся к созданию и последнему изменении ресурса.
| Имя |
Тип |
Описание |
|
createdAt
|
string
(date-time)
|
Метка времени создания ресурса (UTC).
|
|
createdBy
|
string
|
Удостоверение, создающее ресурс.
|
|
createdByType
|
createdByType
|
Тип удостоверения, создавшего ресурс.
|
|
lastModifiedAt
|
string
(date-time)
|
Метка времени последнего изменения ресурса (UTC)
|
|
lastModifiedBy
|
string
|
Идентификатор, который последний раз изменил ресурс.
|
|
lastModifiedByType
|
createdByType
|
Тип удостоверения, который последний раз изменил ресурс.
|
UserAssignedIdentity
Object
Свойства назначаемого пользователем удостоверения
| Имя |
Тип |
Описание |
|
clientId
|
string
(uuid)
|
Идентификатор клиента назначенного удостоверения.
|
|
principalId
|
string
(uuid)
|
Основной идентификатор назначенного удостоверения.
|
UserAssignedServiceIdentity
Object
Предварительно созданное удостоверение, назначаемое пользователем с соответствующими ролями. Чтобы узнать больше о необходимых удостоверениях и ролях, ознакомьтесь с руководством по ACSS.
WorkloadMonitorProvisioningState
Перечисление
Состояние подготовки монитора SAP.
| Значение |
Описание |
|
Accepted
|
|
|
Creating
|
|
|
Updating
|
|
|
Failed
|
|
|
Succeeded
|
|
|
Deleting
|
|
|
Migrating
|
|