Hämtar egenskaper för en providerinstans för den angivna prenumerationen, resursgruppen, SAP-övervakningsnamnet och resursnamnet.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/providerInstances/{providerInstanceName}?api-version=2023-04-01
URI-parametrar
| Name |
I |
Obligatorisk |
Typ |
Description |
|
monitorName
|
path |
True
|
string
|
Namnet på SAP-övervakningsresursen.
|
|
providerInstanceName
|
path |
True
|
string
|
Namnet på providerinstansen.
|
|
resourceGroupName
|
path |
True
|
string
minLength: 1 maxLength: 90
|
Namnet på resursgruppen. Namnet är skiftlägesokänsligt.
|
|
subscriptionId
|
path |
True
|
string
minLength: 1
|
ID för målprenumerationen.
|
|
api-version
|
query |
True
|
string
minLength: 1
|
DEN API-version som ska användas för den här åtgärden.
|
Svar
Exempel
Get properties of a Db2 provider
Exempelbegäran
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
Exempelsvar
{
"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
Exempelbegäran
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
Exempelsvar
{
"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
Exempelbegäran
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
Exempelsvar
{
"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
Exempelbegäran
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
Exempelsvar
{
"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
Exempelbegäran
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
Exempelsvar
{
"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
Exempelbegäran
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
Exempelsvar
{
"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"
}
}
}
Definitioner
createdByType
Uppräkning
Den typ av identitet som skapade resursen.
| Värde |
Description |
|
User
|
|
|
Application
|
|
|
ManagedIdentity
|
|
|
Key
|
|
DB2ProviderInstanceProperties
Objekt
Hämtar eller anger egenskaperna för DB2-providern.
| Name |
Typ |
Description |
|
dbName
|
string
|
Hämtar eller anger databasnamnet db2.
|
|
dbPassword
|
string
|
Hämtar eller anger databaslösenordet db2.
|
|
dbPasswordUri
|
string
|
Hämtar eller anger nyckelvalvs-URI:n till hemlighet med databaslösenordet.
|
|
dbPort
|
string
|
Hämtar eller anger sql-porten för db2-databasen.
|
|
dbUsername
|
string
|
Hämtar eller anger databasanvändarnamnet för db2.
|
|
hostname
|
string
|
Hämtar eller anger målnamnet för den virtuella datorn.
|
|
providerType
|
string:
Db2
|
Providertypen. Värdet kan till exempel vara SapHana.
|
|
sapSid
|
string
|
Hämtar eller anger SAP-systemidentifieraren
|
|
sslCertificateUri
|
string
|
Hämtar eller anger blob-URI:n till SSL-certifikat för DB2-databasen.
|
|
sslPreference
|
sslPreference
|
Hämtar eller anger certifikatinställningar om säker kommunikation är aktiverad.
|
Error
Objekt
Standardfelobjekt.
| Name |
Typ |
Description |
|
code
|
string
|
Serverdefinierad uppsättning felkoder.
|
|
details
|
Error[]
|
Matris med information om specifika fel som ledde till det rapporterade felet.
|
|
innerError
|
InnerError
|
Objekt som innehåller mer specifik information än det aktuella objektet om felet.
|
|
message
|
string
|
Mänsklig läsbar representation av felet.
|
|
target
|
string
|
Målet för felet.
|
ErrorAdditionalInfo
Objekt
Ytterligare information om resurshanteringsfelet.
| Name |
Typ |
Description |
|
info
|
object
|
Ytterligare information.
|
|
type
|
string
|
Ytterligare informationstyp.
|
ErrorDetail
Objekt
Felinformationen.
| Name |
Typ |
Description |
|
additionalInfo
|
ErrorAdditionalInfo[]
|
Ytterligare information om felet.
|
|
code
|
string
|
Felkoden.
|
|
details
|
ErrorDetail[]
|
Felinformationen.
|
|
message
|
string
|
Felmeddelandet.
|
|
target
|
string
|
Felmålet.
|
ErrorResponse
Objekt
Felsvar
Errors
Objekt
Definierar providerinstansfelen.
| Name |
Typ |
Description |
|
code
|
string
|
Serverdefinierad uppsättning felkoder.
|
|
details
|
Error[]
|
Matris med information om specifika fel som ledde till det rapporterade felet.
|
|
innerError
|
InnerError
|
Objekt som innehåller mer specifik information än det aktuella objektet om felet.
|
|
message
|
string
|
Mänsklig läsbar representation av felet.
|
|
target
|
string
|
Målet för felet.
|
HanaDbProviderInstanceProperties
Objekt
Hämtar eller anger provideregenskaperna.
| Name |
Typ |
Description |
|
dbName
|
string
|
Hämtar eller anger hana-databasnamnet.
|
|
dbPassword
|
string
|
Hämtar eller anger databaslösenordet.
|
|
dbPasswordUri
|
string
|
Hämtar eller anger nyckelvalvs-URI:n till hemlighet med databaslösenordet.
|
|
dbUsername
|
string
|
Hämtar eller anger databasanvändarnamnet.
|
|
hostname
|
string
|
Hämtar eller anger målstorleken för den virtuella datorn.
|
|
instanceNumber
|
string
|
Hämtar eller anger databasinstansnumret.
|
|
providerType
|
string:
SapHana
|
Providertypen. Värdet kan till exempel vara SapHana.
|
|
sapSid
|
string
|
Hämtar eller anger SAP-systemidentifieraren.
|
|
sqlPort
|
string
|
Hämtar eller anger databasens SQL-port.
|
|
sslCertificateUri
|
string
|
Hämtar eller anger blob-URI:n till SSL-certifikat för databasen.
|
|
sslHostNameInCertificate
|
string
|
Hämtar eller anger värdnamnen i SSL-certifikatet.
|
|
sslPreference
|
sslPreference
|
Hämtar eller anger certifikatinställningar om säker kommunikation är aktiverad.
|
InnerError
Objekt
Objekt som innehåller mer specifik information än det aktuella objektet om felet.
| Name |
Typ |
Description |
|
innerError
|
Error
|
Standardfelobjekt.
|
ManagedServiceIdentityType
Uppräkning
Typ av hanterad tjänstidentitet (endast Ingen, Användartilldelade typer tillåts).
| Värde |
Description |
|
None
|
|
|
UserAssigned
|
|
MsSqlServerProviderInstanceProperties
Objekt
Hämtar eller anger egenskaperna för SQL-serverprovidern.
| Name |
Typ |
Description |
|
dbPassword
|
string
|
Hämtar eller anger databaslösenordet.
|
|
dbPasswordUri
|
string
|
Hämtar eller anger nyckelvalvs-URI:n till hemlighet med databaslösenordet.
|
|
dbPort
|
string
|
Hämtar eller anger databasens SQL-port.
|
|
dbUsername
|
string
|
Hämtar eller anger databasanvändarnamnet.
|
|
hostname
|
string
|
Hämtar eller anger SQL Server-värdnamnet.
|
|
providerType
|
string:
MsSqlServer
|
Providertypen. Värdet kan till exempel vara SapHana.
|
|
sapSid
|
string
|
Hämtar eller anger SAP-systemidentifieraren
|
|
sslCertificateUri
|
string
|
Hämtar eller anger blob-URI:n till SSL-certifikat för SQL Database.
|
|
sslPreference
|
sslPreference
|
Hämtar eller anger certifikatinställningar om säker kommunikation är aktiverad.
|
PrometheusHaClusterProviderInstanceProperties
Objekt
Hämtar eller anger egenskaperna för PrometheusHaCluster-providern.
| Name |
Typ |
Description |
|
clusterName
|
string
|
Hämtar eller anger clusterName.
|
|
hostname
|
string
|
Hämtar eller anger måldatorns namn.
|
|
prometheusUrl
|
string
|
URL för nodexporterarens slutpunkt.
|
|
providerType
|
string:
PrometheusHaCluster
|
Providertypen. Värdet kan till exempel vara SapHana.
|
|
sid
|
string
|
Hämtar eller anger kluster-sid.
|
|
sslCertificateUri
|
string
|
Hämtar eller anger blob-URI:n till SSL-certifikat för HA-klusterexportören.
|
|
sslPreference
|
sslPreference
|
Hämtar eller anger certifikatinställningar om säker kommunikation är aktiverad.
|
PrometheusOSProviderInstanceProperties
Objekt
Hämtar eller anger egenskaperna för PrometheusOS-providern.
| Name |
Typ |
Description |
|
prometheusUrl
|
string
|
URL för nodexporterarens slutpunkt
|
|
providerType
|
string:
PrometheusOS
|
Providertypen. Värdet kan till exempel vara SapHana.
|
|
sapSid
|
string
|
Hämtar eller anger SAP-systemidentifieraren
|
|
sslCertificateUri
|
string
|
Hämtar eller anger blob-URI:n till SSL-certifikat för prometheus-nodexportören.
|
|
sslPreference
|
sslPreference
|
Hämtar eller anger certifikatinställningar om säker kommunikation är aktiverad.
|
ProviderInstance
Objekt
En providerinstans som är associerad med SAP Monitor.
| Name |
Typ |
Description |
|
id
|
string
|
Fullständigt kvalificerat resurs-ID för resursen. Ex – /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
|
identity
|
UserAssignedServiceIdentity
|
[används för närvarande inte] Hanterad tjänstidentitet (användartilldelade identiteter)
|
|
name
|
string
|
Namnet på resursen
|
|
properties.errors
|
Errors
|
Definierar providerinstansfelen.
|
|
properties.providerSettings
|
ProviderSpecificProperties:
|
Definierar providerspecifika egenskaper.
|
|
properties.provisioningState
|
WorkloadMonitorProvisioningState
|
Etableringstillstånd för providerinstansen
|
|
systemData
|
systemData
|
Azure Resource Manager-metadata som innehåller createdBy och modifiedBy information.
|
|
type
|
string
|
Resurstypen. Till exempel "Microsoft.Compute/virtualMachines" eller "Microsoft.Storage/storageAccounts"
|
SapNetWeaverProviderInstanceProperties
Objekt
Hämtar eller anger provideregenskaperna.
| Name |
Typ |
Description |
|
providerType
|
string:
SapNetWeaver
|
Providertypen. Värdet kan till exempel vara SapHana.
|
|
sapClientId
|
string
|
Hämtar eller anger SAP-klient-ID.
|
|
sapHostFileEntries
|
string[]
|
Hämtar eller anger listan över HostFile-poster
|
|
sapHostname
|
string
|
Hämtar eller anger den virtuella måldatorns IP-adress/FQDN.
|
|
sapInstanceNr
|
string
|
Hämtar eller anger instansnumret för SAP NetWeaver.
|
|
sapPassword
|
string
|
Anger SAP-lösenordet.
|
|
sapPasswordUri
|
string
|
Hämtar eller anger nyckelvalvs-URI:n till hemlighet med SAP-lösenordet.
|
|
sapPortNumber
|
string
|
Hämtar eller anger SAP HTTP-portnumret.
|
|
sapSid
|
string
|
Hämtar eller anger SAP-systemidentifieraren
|
|
sapUsername
|
string
|
Hämtar eller anger SAP-användarnamnet.
|
|
sslCertificateUri
|
string
|
Hämtar eller anger blob-URI:n till SSL-certifikat för SAP-systemet.
|
|
sslPreference
|
sslPreference
|
Hämtar eller anger certifikatinställningar om säker kommunikation är aktiverad.
|
sslPreference
Uppräkning
Hämtar eller anger certifikatinställningar om säker kommunikation är aktiverad.
| Värde |
Description |
|
Disabled
|
|
|
RootCertificate
|
|
|
ServerCertificate
|
|
systemData
Objekt
Metadata som rör skapande och senaste ändring av resursen.
| Name |
Typ |
Description |
|
createdAt
|
string
(date-time)
|
Tidsstämpeln för resursskapande (UTC).
|
|
createdBy
|
string
|
Identiteten som skapade resursen.
|
|
createdByType
|
createdByType
|
Den typ av identitet som skapade resursen.
|
|
lastModifiedAt
|
string
(date-time)
|
Tidsstämpeln för resursens senaste ändring (UTC)
|
|
lastModifiedBy
|
string
|
Identiteten som senast ändrade resursen.
|
|
lastModifiedByType
|
createdByType
|
Den typ av identitet som senast ändrade resursen.
|
UserAssignedIdentity
Objekt
Användartilldelade identitetsegenskaper
| Name |
Typ |
Description |
|
clientId
|
string
(uuid)
|
Klient-ID för den tilldelade identiteten.
|
|
principalId
|
string
(uuid)
|
Huvud-ID för den tilldelade identiteten.
|
UserAssignedServiceIdentity
Objekt
En i förväg skapad användartilldelad identitet med lämpliga roller tilldelade. Mer information om vilka identiteter och roller som krävs finns i GUIDEN ACSS.
WorkloadMonitorProvisioningState
Uppräkning
Etableringstillstånd för SAP-övervakaren.
| Värde |
Description |
|
Accepted
|
|
|
Creating
|
|
|
Updating
|
|
|
Failed
|
|
|
Succeeded
|
|
|
Deleting
|
|
|
Migrating
|
|