-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Expand file tree
/
Copy pathCostAllocationRuleDefinition.tsp
More file actions
104 lines (93 loc) · 2.83 KB
/
Copy pathCostAllocationRuleDefinition.tsp
File metadata and controls
104 lines (93 loc) · 2.83 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
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 TypeSpec.Http;
using TypeSpec.OpenAPI;
namespace Microsoft.CostManagement;
/**
* The cost allocation rule model definition
*/
@tenantResource
model CostAllocationRuleDefinition
is Azure.ResourceManager.ProxyResource<CostAllocationRuleProperties> {
...ResourceNameParameter<
Resource = CostAllocationRuleDefinition,
KeyName = "ruleName",
SegmentName = "costAllocationRules",
NamePattern = "[A-Za-z0-9\\-_]+"
>;
}
alias CostAllocationRuleDefinitionsOps = Azure.ResourceManager.Legacy.ExtensionOperations<
{
...ApiVersionParameter;
/** the provider namespace */
@path
@segment("providers")
@key
providerNamespace: "microsoft.Billing";
/**
* BillingAccount ID
*/
@path
@segment("billingAccounts")
billingAccountId: string;
},
{
...Azure.ResourceManager.Legacy.Provider;
},
{
...Azure.ResourceManager.Legacy.Provider;
/**
* Cost allocation rule name. The name cannot include spaces or any non alphanumeric characters other than '_' and '-'. The max length is 260 characters.
*/
@path
@segment("costAllocationRules")
@pattern("[A-Za-z0-9\\-_]+")
ruleName: string;
}
>;
@armResourceOperations
interface CostAllocationRuleDefinitions {
/**
* Get a cost allocation rule by rule name and billing account or enterprise enrollment.
*/
get is CostAllocationRuleDefinitionsOps.Read<
CostAllocationRuleDefinition,
ErrorType = ErrorResponse
>;
/**
* Create/Update a rule to allocate cost between different resources within a billing account or enterprise enrollment.
*/
createOrUpdate is CostAllocationRuleDefinitionsOps.CreateOrUpdateSync<
CostAllocationRuleDefinition,
ErrorType = ErrorResponse
>;
/**
* Delete cost allocation rule for billing account or enterprise enrollment.
*/
delete is CostAllocationRuleDefinitionsOps.DeleteSync<
CostAllocationRuleDefinition,
ErrorType = ErrorResponse
>;
/**
* Get the list of all cost allocation rules for a billing account or enterprise enrollment.
*/
list is CostAllocationRuleDefinitionsOps.List<
CostAllocationRuleDefinition,
Response = ArmResponse<CostAllocationRuleList>,
ErrorType = ErrorResponse
>;
}
@@doc(CostAllocationRuleDefinition.name,
"Cost allocation rule name. The name cannot include spaces or any non alphanumeric characters other than '_' and '-'. The max length is 260 characters."
);
@@doc(CostAllocationRuleDefinition.properties,
"Cost allocation rule properties"
);
@@doc(CostAllocationRuleDefinitions.createOrUpdate::parameters.resource,
"Cost allocation rule to be created or updated"
);