Seznamy všech příslušných plánů
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/schedules/{name}/listApplicable?api-version=2018-09-15
Parametry identifikátoru URI
Name |
V |
Vyžadováno |
Typ |
Description |
labName
|
path |
True
|
string
|
Název testovacího prostředí.
|
name
|
path |
True
|
string
|
Název plánu.
|
resourceGroupName
|
path |
True
|
string
|
Název skupiny prostředků.
|
subscriptionId
|
path |
True
|
string
|
ID předplatného.
|
api-version
|
query |
True
|
string
|
Verze klientského rozhraní API
|
Odpovědi
Zabezpečení
azure_auth
Implicitní udělení OAuth2
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name |
Description |
user_impersonation
|
Přístup k Microsoft Azure
|
Příklady
Schedules_ListApplicable
Sample Request
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/schedules/{scheduleName}/listApplicable?api-version=2018-09-15
/** Samples for Schedules ListApplicable. */
public final class Main {
/*
* x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_ListApplicable.json
*/
/**
* Sample code: Schedules_ListApplicable.
*
* @param manager Entry point to DevTestLabsManager.
*/
public static void schedulesListApplicable(com.azure.resourcemanager.devtestlabs.DevTestLabsManager manager) {
manager
.schedules()
.listApplicable("resourceGroupName", "{labName}", "{scheduleName}", 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.devtestlabs import DevTestLabsClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-devtestlabs
# USAGE
python schedules_list_applicable.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 = DevTestLabsClient(
credential=DefaultAzureCredential(),
subscription_id="{subscriptionId}",
)
response = client.schedules.list_applicable(
resource_group_name="resourceGroupName",
lab_name="{labName}",
name="{scheduleName}",
)
for item in response:
print(item)
# x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_ListApplicable.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 armdevtestlabs_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_ListApplicable.json
func ExampleSchedulesClient_NewListApplicablePager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewSchedulesClient().NewListApplicablePager("resourceGroupName", "{labName}", "{scheduleName}", nil)
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page.ScheduleList = armdevtestlabs.ScheduleList{
// Value: []*armdevtestlabs.Schedule{
// {
// Name: to.Ptr("{scheduleName}"),
// Type: to.Ptr("Microsoft.DevTestLab/labs/schedules"),
// ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/schedules/{scheduleName}"),
// Location: to.Ptr("{location}"),
// Tags: map[string]*string{
// "tagName1": to.Ptr("tagValue1"),
// },
// Properties: &armdevtestlabs.ScheduleProperties{
// CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-02T01:40:48.173Z"); return t}()),
// DailyRecurrence: &armdevtestlabs.DayDetails{
// Time: to.Ptr("{timeOfTheDayTheScheduleWillOccurEveryDay}"),
// },
// HourlyRecurrence: &armdevtestlabs.HourDetails{
// Minute: to.Ptr[int32](30),
// },
// NotificationSettings: &armdevtestlabs.NotificationSettings{
// EmailRecipient: to.Ptr("{email}"),
// NotificationLocale: to.Ptr("EN"),
// Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
// TimeInMinutes: to.Ptr[int32](15),
// WebhookURL: to.Ptr("{webhookUrl}"),
// },
// ProvisioningState: to.Ptr("Succeeded"),
// Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
// TargetResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}"),
// TaskType: to.Ptr("{myLabVmTaskType}"),
// TimeZoneID: to.Ptr("Pacific Standard Time"),
// UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
// WeeklyRecurrence: &armdevtestlabs.WeekDetails{
// Time: to.Ptr("{timeOfTheDayTheScheduleWillOccurOnThoseDays}"),
// Weekdays: []*string{
// to.Ptr("Monday"),
// to.Ptr("Wednesday"),
// to.Ptr("Friday")},
// },
// },
// }},
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { DevTestLabsClient } = require("@azure/arm-devtestlabs");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Lists all applicable schedules
*
* @summary Lists all applicable schedules
* x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_ListApplicable.json
*/
async function schedulesListApplicable() {
const subscriptionId = "{subscriptionId}";
const resourceGroupName = "resourceGroupName";
const labName = "{labName}";
const name = "{scheduleName}";
const credential = new DefaultAzureCredential();
const client = new DevTestLabsClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.schedules.listApplicable(resourceGroupName, labName, name)) {
resArray.push(item);
}
console.log(resArray);
}
schedulesListApplicable().catch(console.error);
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.DevTestLabs;
using Azure.ResourceManager.DevTestLabs.Models;
// Generated from example definition: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_ListApplicable.json
// this example is just showing the usage of "Schedules_ListApplicable" 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 DevTestLabResource created on azure
// for more information of creating DevTestLabResource, please refer to the document of DevTestLabResource
string subscriptionId = "{subscriptionId}";
string resourceGroupName = "resourceGroupName";
string labName = "{labName}";
ResourceIdentifier devTestLabResourceId = DevTestLabResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, labName);
DevTestLabResource devTestLab = client.GetDevTestLabResource(devTestLabResourceId);
// get the collection of this DevTestLabScheduleResource
DevTestLabScheduleCollection collection = devTestLab.GetDevTestLabSchedules();
// invoke the operation and iterate over the result
string name = "{scheduleName}";
await foreach (DevTestLabScheduleResource item in collection.GetApplicableAsync(name))
{
// the variable item 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
DevTestLabScheduleData resourceData = item.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
Console.WriteLine($"Succeeded");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"value": [
{
"properties": {
"status": "{Enabled|Disabled}",
"taskType": "{myLabVmTaskType}",
"weeklyRecurrence": {
"weekdays": [
"Monday",
"Wednesday",
"Friday"
],
"time": "{timeOfTheDayTheScheduleWillOccurOnThoseDays}"
},
"dailyRecurrence": {
"time": "{timeOfTheDayTheScheduleWillOccurEveryDay}"
},
"hourlyRecurrence": {
"minute": 30
},
"timeZoneId": "Pacific Standard Time",
"notificationSettings": {
"status": "{Enabled|Disabled}",
"timeInMinutes": 15,
"webhookUrl": "{webhookUrl}",
"emailRecipient": "{email}",
"notificationLocale": "EN"
},
"createdDate": "2018-10-01T18:40:48.1739018-07:00",
"targetResourceId": "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}",
"provisioningState": "Creating",
"uniqueIdentifier": "{uniqueIdentifier}"
},
"id": "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/schedules/{scheduleName}",
"name": "{scheduleName}",
"type": "Microsoft.DevTestLab/labs/schedules",
"location": "{location}",
"tags": {
"tagName1": "tagValue1"
}
}
]
}
Definice
CloudError
Chyba z požadavku REST.
Name |
Typ |
Description |
error
|
CloudErrorBody
|
Chyba cloudu, ke které došlo
|
CloudErrorBody
Text chyby z požadavku REST.
Name |
Typ |
Description |
code
|
string
|
Kód chyby
|
details
|
CloudErrorBody[]
|
Vnitřní chyby.
|
message
|
string
|
Chybová zpráva
|
target
|
string
|
Cíl chyby.
|
DayDetails
Vlastnosti denního plánu.
Name |
Typ |
Description |
time
|
string
|
Čas, kdy bude plán probíhat.
|
EnableStatus
Stav plánu (tj. Povoleno, Zakázáno)
Name |
Typ |
Description |
Disabled
|
string
|
|
Enabled
|
string
|
|
HourDetails
Vlastnosti hodinového plánu.
Name |
Typ |
Description |
minute
|
integer
|
Počet minut v hodině, ve které bude plán běžet.
|
NotificationSettings
Nastavení oznámení pro plán.
Name |
Typ |
Výchozí hodnota |
Description |
emailRecipient
|
string
|
|
Příjemce e-mailu, na který se mají odesílat oznámení (může to být seznam e-mailových adres oddělených středníkem).
|
notificationLocale
|
string
|
|
Národní prostředí, které se má použít při odesílání oznámení (náhradní pro nepodporované jazyky je EN).
|
status
|
EnableStatus
|
Disabled
|
Pokud jsou pro tento plán povolená oznámení (tj. Povoleno, Zakázáno).
|
timeInMinutes
|
integer
|
|
Čas v minutách před událostí, při které se odešle oznámení.
|
webhookUrl
|
string
|
|
Adresa URL webhooku, na kterou se oznámení odešle.
|
Schedule
Plán.
Name |
Typ |
Výchozí hodnota |
Description |
id
|
string
|
|
Identifikátor prostředku.
|
location
|
string
|
|
Umístění prostředku.
|
name
|
string
|
|
Název prostředku.
|
properties.createdDate
|
string
|
|
Datum vytvoření plánu.
|
properties.dailyRecurrence
|
DayDetails
|
|
Pokud bude plán probíhat každý den v týdnu, zadejte denní opakování.
|
properties.hourlyRecurrence
|
HourDetails
|
|
Pokud bude plán probíhat několikrát denně, zadejte hodinové opakování.
|
properties.notificationSettings
|
NotificationSettings
|
|
Nastavení oznámení.
|
properties.provisioningState
|
string
|
|
Stav zřizování prostředku.
|
properties.status
|
EnableStatus
|
Disabled
|
Stav plánu (tj. Povoleno, Zakázáno)
|
properties.targetResourceId
|
string
|
|
ID prostředku, ke kterému patří plán
|
properties.taskType
|
string
|
|
Typ úkolu plánu (např. LabVmsShutdownTask, LabVmAutoStart).
|
properties.timeZoneId
|
string
|
|
ID časového pásma (např. Čína (běžný čas), Grónsko (běžný čas), Tichomoří (běžný čas) atd.). Možné hodnoty pro tuto vlastnost najdete v IReadOnlyCollection<string> TimeZoneConverter.TZConvert.KnownWindowsTimeZoneIds https://github.com/mattjohnsonpint/TimeZoneConverter/blob/main/README.md()
|
properties.uniqueIdentifier
|
string
|
|
Jedinečný neměnný identifikátor prostředku (GUID).
|
properties.weeklyRecurrence
|
WeekDetails
|
|
Pokud plán nastane pouze v některých dnech v týdnu, zadejte týdenní opakování.
|
tags
|
object
|
|
Značky prostředku.
|
type
|
string
|
|
Typ prostředku.
|
ScheduleList
Odpověď operace seznamu.
Name |
Typ |
Description |
nextLink
|
string
|
Odkaz na další sadu výsledků
|
value
|
Schedule[]
|
Výsledky operace seznamu
|
WeekDetails
Vlastnosti týdenního plánu.
Name |
Typ |
Description |
time
|
string
|
Čas dne, kdy bude plán probíhat.
|
weekdays
|
string[]
|
Dny v týdnu, pro které je plán nastavený (např. neděle, pondělí, úterý atd.).
|