-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Expand file tree
/
Copy pathJobStep.tsp
More file actions
156 lines (139 loc) · 3.98 KB
/
Copy pathJobStep.tsp
File metadata and controls
156 lines (139 loc) · 3.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "@typespec/rest";
import "./models.tsp";
import "./Job.tsp";
using TypeSpec.Rest;
using Azure.ResourceManager;
using TypeSpec.Http;
using TypeSpec.OpenAPI;
namespace Microsoft.Sql;
/**
* A job step.
*/
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@parentResource(Job)
@Azure.ResourceManager.Legacy.feature(Features.JobSteps)
model JobStep is Azure.ResourceManager.ProxyResource<JobStepProperties> {
...ResourceNameParameter<
Resource = JobStep,
KeyName = "stepName",
SegmentName = "steps",
NamePattern = ""
>;
}
alias JobStepOps = Azure.ResourceManager.Legacy.LegacyOperations<
{
...ApiVersionParameter;
...SubscriptionIdParameter;
...ResourceGroupParameter;
...Azure.ResourceManager.Legacy.Provider;
/** The name of the server. */
@path
@segment("servers")
@key
serverName: string;
/** The name of the job agent. */
@path
@segment("jobAgents")
@key
jobAgentName: string;
/** The name of the job. */
@path
@segment("jobs")
@key
jobName: string;
},
{
/** The name of the job step. */
@path
@segment("steps")
@key
stepName: string;
},
ResourceName = "SqlServerJobStep"
>;
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@armResourceOperations(#{ omitTags: true })
@Azure.ResourceManager.Legacy.feature(Features.JobSteps)
interface JobSteps {
/**
* Gets a job step in a job's current version.
*/
@tag("JobSteps")
get is JobStepOps.Read<JobStep>;
/**
* Creates or updates a job step. This will implicitly create a new job version.
*/
@tag("JobSteps")
createOrUpdate is JobStepOps.CreateOrUpdateSync<JobStep>;
/**
* Deletes a job step. This will implicitly create a new job version.
*/
@tag("JobSteps")
delete is JobStepOps.DeleteSync<JobStep>;
/**
* Gets all job steps for a job's current version.
*/
@tag("JobSteps")
listByJob is JobStepOps.List<JobStep>;
}
alias JobStepOperationGroupOps = Azure.ResourceManager.Legacy.LegacyOperations<
{
...ApiVersionParameter;
...SubscriptionIdParameter;
...ResourceGroupParameter;
...Azure.ResourceManager.Legacy.Provider;
/** The name of the server. */
@path
@segment("servers")
@key
serverName: string;
/** The name of the job agent. */
@path
@segment("jobAgents")
@key
jobAgentName: string;
/** The name of the job. */
@path
@segment("jobs")
@key
jobName: string;
/** The version of the job to get. */
@path
@segment("versions")
@key
@Azure.ClientGenerator.Core.alternateType(string) // The jobVersion is name of the resource JobVersion which must be a string, but the swagger defines it as int32, so we need to use alternateType to make it backwards compatible with the swagger definition.
jobVersion: int32;
},
{
/** The name of the job step. */
@path
@segment("steps")
@key
stepName: string;
},
ResourceName = "SqlServerJobVersionStep"
>;
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@armResourceOperations(#{ omitTags: true })
@Azure.ResourceManager.Legacy.feature(Features.JobSteps)
interface JobStepOperationGroup {
/**
* Gets the specified version of a job step.
*/
@tag("JobSteps")
getByVersion is JobStepOperationGroupOps.Read<JobStep>;
/**
* Gets all job steps in the specified job version.
*/
@tag("JobSteps")
listByVersion is JobStepOperationGroupOps.List<JobStep>;
}
@@doc(JobStep.name, "The name of the job step.");
@@doc(JobStep.properties, "Resource properties.");
@@doc(
JobSteps.createOrUpdate::parameters.resource,
"The requested state of the job step."
);