import "@azure-tools/typespec-azure-core"; import "@azure-tools/typespec-azure-resource-manager"; import "@typespec/openapi"; import "@typespec/rest"; import "./models.tsp"; using TypeSpec.Rest; using Azure.ResourceManager; using Azure.ResourceManager.Foundations; using TypeSpec.Http; using TypeSpec.OpenAPI; namespace Microsoft.App; /** * Container App Job */ model Job is Azure.ResourceManager.TrackedResource { ...ResourceNameParameter< Resource = Job, KeyName = "jobName", SegmentName = "jobs", NamePattern = "^[-\\w\\._\\(\\)]+$" >; /** * The complex type of the extended location. */ #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" extendedLocation?: ExtendedLocation; ...Azure.ResourceManager.ManagedServiceIdentityProperty; } alias JobDetectorPropertyOps = Azure.ResourceManager.Legacy.LegacyOperations< { ...ApiVersionParameter; ...SubscriptionIdParameter; ...ResourceGroupParameter; ...Azure.ResourceManager.Legacy.Provider; /** Job Name */ @path @segment("jobs") @key @pattern("^[-\\w\\._\\(\\)]+$") jobName: string; }, { /** Proxy API Name for Container App Job. */ @path @segment("detectorProperties") @key @pattern("^[-\\w\\._]+$") apiName: string; }, ErrorType = DefaultErrorResponse, ResourceName = "ContainerAppJobDetectorProperty" >; @armResourceOperations(#{ omitTags: true }) interface Jobs { /** * Get the properties of a Container Apps Job. */ @tag("Jobs") @summary("Get the properties of a Container Apps Job.") get is ArmResourceRead; /** * Create or Update a Container Apps Job. */ @tag("Jobs") @summary("Create or Update a Container Apps Job.") createOrUpdate is ArmResourceCreateOrReplaceAsync< Job, Error = DefaultErrorResponse >; /** * Patches a Container Apps Job using JSON Merge Patch */ @tag("Jobs") @patch(#{ implicitOptionality: false }) @summary("Update properties of a Container Apps Job") update is ArmCustomPatchAsync< Job, PatchModel = JobPatchProperties, Error = DefaultErrorResponse >; /** * Delete a Container Apps Job. */ #suppress "@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codes" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" @tag("Jobs") @summary("Delete a Container Apps Job.") delete is ArmResourceDeleteWithoutOkAsync< Job, Response = | ArmDeletedResponse | ArmDeleteAcceptedLroResponse | ArmDeletedNoContentResponse, Error = DefaultErrorResponse >; /** * Get the Container Apps Jobs in a given resource group. */ @tag("Jobs") @summary("Get the Container Apps Jobs in a given resource group.") listByResourceGroup is ArmResourceListByParent< Job, Response = ArmResponse, Error = DefaultErrorResponse >; /** * Get the Container Apps Jobs in a given subscription. */ @tag("Jobs") @summary("Get the Container Apps Jobs in a given subscription.") listBySubscription is ArmListBySubscription< Job, Response = ArmResponse, Error = DefaultErrorResponse >; /** * Start a Container Apps Job */ @tag("Jobs") @summary("Start a Container Apps Job") start is ArmResourceActionAsyncBase< Job, JobExecutionTemplate, | ArmResponse | ArmAcceptedLroResponse & Azure.Core.Foundations.RetryAfterHeader>, DefaultBaseParameters, OptionalRequestBody = true, Error = DefaultErrorResponse >; /** * Terminates execution of a running container apps job */ @tag("Jobs") @action("stop") @summary("Terminates execution of a running container apps job") stopMultipleExecutions is ArmResourceActionAsyncBase< Job, void, | ArmResponse | ArmAcceptedLroResponse & Azure.Core.Foundations.RetryAfterHeader>, DefaultBaseParameters, Error = DefaultErrorResponse >; /** * List secrets for a container apps job */ @tag("Jobs") @summary("List secrets for a container apps job") listSecrets is ArmResourceActionSync< Job, void, ArmResponse, Error = DefaultErrorResponse >; /** * Resumes a suspended job */ @tag("Jobs") @summary("Resumes a suspended job") @Azure.Core.useFinalStateVia("azure-async-operation") resume is ArmResourceActionAsyncBase< Job, void, | ArmResponse | ArmAcceptedLroResponse & ArmLroLocationHeader & Azure.Core.Foundations.RetryAfterHeader>, DefaultBaseParameters >; /** * Suspends a job */ @tag("Jobs") @summary("Suspends a job") @Azure.Core.useFinalStateVia("azure-async-operation") suspend is ArmResourceActionAsyncBase< Job, void, | ArmResponse | ArmAcceptedLroResponse & ArmLroLocationHeader & Azure.Core.Foundations.RetryAfterHeader>, DefaultBaseParameters >; /** * Get details of a single job execution */ #suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" @tag("Jobs") @operationId("JobExecution") @summary("Get details of a single job execution") jobExecution is ArmResourceRead; /** * Get a Container Apps Job's executions */ @tag("Jobs") @summary("Get a Container Apps Job's executions") list is ArmResourceListByParent< JobExecution, Parameters = { /** * The filter to apply on the operation. */ @query("$filter") $filter?: string; }, Response = ArmResponse, Error = DefaultErrorResponse >; /** * Terminates execution of a running container apps job */ @tag("Jobs") @action("stop") @summary("Terminates execution of a running container apps job") stopExecution is ArmResourceActionAsyncBase< JobExecution, void, | OkResponse | ArmAcceptedLroResponse, DefaultBaseParameters, Error = DefaultErrorResponse >; /** * Get the properties of a Container App Job. */ @tag("Jobs") @tag("Diagnostics") @summary("Get the properties for a given Container App Job.") proxyGet is JobDetectorPropertyOps.Read>; /** * Get the list of diagnostics for a Container App Job. */ @tag("Jobs") @tag("Diagnostics") @summary("Get the list of diagnostics for a given Container App Job.") listDetectors is JobsDiagnosticsDetectorOps.List< Diagnostics, Response = ArmResponse >; /** * Get the diagnostics data for a Container App Job. */ @tag("Jobs") @tag("Diagnostics") @summary("Get the diagnostics data for a given Container App Job.") getDetector is JobsDiagnosticsDetectorOps.Read< Diagnostics, Response = ArmResponse >; } @@doc(Job.name, "Job Name"); @@doc(Job.properties, "Container Apps Job resource specific properties."); @@doc( Jobs.createOrUpdate::parameters.resource, "Properties used to create a container apps job" ); @@doc( Jobs.update::parameters.properties, "Properties used to create a container apps job" ); @@doc(Jobs.start::parameters.body, "Properties used to start a job execution.");