获取指定订阅、资源组、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 Monitor 资源的名称。
|
|
providerInstanceName
|
path |
True
|
string
|
提供程序实例的名称。
|
|
resourceGroupName
|
path |
True
|
string
minLength: 1 maxLength: 90
|
资源组的名称。 名称不区分大小写。
|
|
subscriptionId
|
path |
True
|
string
minLength: 1
|
目标订阅的 ID。
|
|
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
|
获取或设置 db2 数据库 sql 端口。
|
|
dbUsername
|
string
|
获取或设置 db2 数据库用户名。
|
|
hostname
|
string
|
获取或设置目标虚拟机名称。
|
|
providerType
|
string:
Db2
|
提供程序类型。 例如,该值可以是 SapHana。
|
|
sapSid
|
string
|
获取或设置 SAP 系统标识符
|
|
sslCertificateUri
|
string
|
获取或设置 DB2 数据库的 SSL 证书的 Blob URI。
|
|
sslPreference
|
sslPreference
|
获取或设置启用安全通信时证书首选项。
|
Error
Object
标准错误对象。
| 名称 |
类型 |
说明 |
|
code
|
string
|
服务器定义的错误代码集。
|
|
details
|
Error[]
|
导致此报告错误的特定错误的详细信息数组。
|
|
innerError
|
InnerError
|
包含比当前对象有关错误的更具体信息的对象。
|
|
message
|
string
|
错误的人工可读表示形式。
|
|
target
|
string
|
错误的目标。
|
ErrorAdditionalInfo
Object
资源管理错误附加信息。
| 名称 |
类型 |
说明 |
|
info
|
object
|
其他信息。
|
|
type
|
string
|
其他信息类型。
|
ErrorDetail
Object
错误详细信息。
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
|
获取或设置 DB 的 SSL 证书的 Blob URI。
|
|
sslHostNameInCertificate
|
string
|
获取或设置 SSL 证书中的主机名。
|
|
sslPreference
|
sslPreference
|
获取或设置启用安全通信时证书首选项。
|
InnerError
Object
包含比当前对象有关错误的更具体信息的对象。
| 名称 |
类型 |
说明 |
|
innerError
|
Error
|
标准错误对象。
|
ManagedServiceIdentityType
枚举
托管服务标识的类型(仅允许 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
|
获取或设置 SQL 数据库的 SSL 证书的 Blob URI。
|
|
sslPreference
|
sslPreference
|
获取或设置启用安全通信时证书首选项。
|
PrometheusHaClusterProviderInstanceProperties
Object
获取或设置 PrometheusHaCluster 提供程序属性。
| 名称 |
类型 |
说明 |
|
clusterName
|
string
|
获取或设置 clusterName。
|
|
hostname
|
string
|
获取或设置目标计算机名称。
|
|
prometheusUrl
|
string
|
节点导出终结点的 URL。
|
|
providerType
|
string:
PrometheusHaCluster
|
提供程序类型。 例如,该值可以是 SapHana。
|
|
sid
|
string
|
获取或设置群集 sid。
|
|
sslCertificateUri
|
string
|
获取或设置 HA 群集导出程序的 SSL 证书的 Blob URI。
|
|
sslPreference
|
sslPreference
|
获取或设置启用安全通信时证书首选项。
|
PrometheusOSProviderInstanceProperties
Object
获取或设置 PrometheusOS 提供程序属性。
| 名称 |
类型 |
说明 |
|
prometheusUrl
|
string
|
节点导出终结点的 URL
|
|
providerType
|
string:
PrometheusOS
|
提供程序类型。 例如,该值可以是 SapHana。
|
|
sapSid
|
string
|
获取或设置 SAP 系统标识符
|
|
sslCertificateUri
|
string
|
获取或设置 prometheus 节点导出程序的 BLOB URI 到 SSL 证书。
|
|
sslPreference
|
sslPreference
|
获取或设置启用安全通信时证书首选项。
|
ProviderInstance
Object
与 SAP 监视器关联的提供程序实例。
| 名称 |
类型 |
说明 |
|
id
|
string
|
资源的完全限定资源 ID。 示例 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
|
identity
|
UserAssignedServiceIdentity
|
[当前未使用]托管服务标识(用户分配的标识)
|
|
name
|
string
|
资源的名称
|
|
properties.errors
|
Errors
|
定义提供程序实例错误。
|
|
properties.providerSettings
|
ProviderSpecificProperties:
|
定义提供程序特定的属性。
|
|
properties.provisioningState
|
WorkloadMonitorProvisioningState
|
提供程序实例预配的状态
|
|
systemData
|
systemData
|
包含 createdBy 和 modifiedBy 信息的 Azure 资源管理器元数据。
|
|
type
|
string
|
资源的类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts”
|
SapNetWeaverProviderInstanceProperties
Object
获取或设置提供程序属性。
| 名称 |
类型 |
说明 |
|
providerType
|
string:
SapNetWeaver
|
提供程序类型。 例如,该值可以是 SapHana。
|
|
sapClientId
|
string
|
获取或设置 SAP 客户端 ID。
|
|
sapHostFileEntries
|
string[]
|
获取或设置 HostFile 条目的列表
|
|
sapHostname
|
string
|
获取或设置目标虚拟机 IP 地址/FQDN。
|
|
sapInstanceNr
|
string
|
获取或设置 SAP NetWeaver 的实例编号。
|
|
sapPassword
|
string
|
设置 SAP 密码。
|
|
sapPasswordUri
|
string
|
获取或设置使用 SAP 密码进行机密的密钥保管库 URI。
|
|
sapPortNumber
|
string
|
获取或设置 SAP HTTP 端口号。
|
|
sapSid
|
string
|
获取或设置 SAP 系统标识符
|
|
sapUsername
|
string
|
获取或设置 SAP 用户名。
|
|
sslCertificateUri
|
string
|
获取或设置 SAP 系统的 SSL 证书的 Blob URI。
|
|
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)
|
分配的标识的客户端 ID。
|
|
principalId
|
string
(uuid)
|
已分配标识的主体 ID。
|
UserAssignedServiceIdentity
Object
分配了适当角色的预先创建的用户分配标识。 若要详细了解所需的标识和角色,请访问 ACSS 操作指南。
WorkloadMonitorProvisioningState
枚举
预配 SAP 监视器的状态。
| 值 |
说明 |
|
Accepted
|
|
|
Creating
|
|
|
Updating
|
|
|
Failed
|
|
|
Succeeded
|
|
|
Deleting
|
|
|
Migrating
|
|