Skip to content

Commit 3429eaa

Browse files
publish first version of aco stable api and set tag name with beta postfix as this is initial SDK before GA (#33803)
* publish first version of aco stable api and set tag name with beta for initialization * Add sdk language config in tspconfig file * add missing properties * add missing properties * follow contoso tspconfig example to address tspconfig issue * add client name mapping * format client tsp file * test remove sample for js * set generate sample to true for js * Update specification/carbon/Carbon.Management/tspconfig.yaml * Update specification/carbon/Carbon.Management/tspconfig.yaml * remove readme.xxx.md file since we used typespec --------- Co-authored-by: Mary Gao <yanmeigao1210@gmail.com>
1 parent 31b8400 commit 3429eaa

File tree

49 files changed

+6774
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+6774
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import "./main.tsp";
2+
import "@azure-tools/typespec-client-generator-core";
3+
4+
using Azure.ClientGenerator.Core;
5+
using Azure.ResourceManager.CommonTypes;
6+
using Microsoft.Carbon;
7+
8+
@@clientName(CarbonEmissionTopItemMonthlySummaryData,
9+
"CarbonEmissionTopItemMonthlySummary",
10+
"csharp"
11+
);
12+
@@clientName(CarbonEmissionTopItemsSummaryData,
13+
"CarbonEmissionTopItemsSummary",
14+
"csharp"
15+
);
16+
@@clientName(CarbonEmissionData, "CarbonEmission", "csharp");
17+
@@clientName(CarbonEmissionItemDetailData,
18+
"CarbonEmissionItemDetail",
19+
"csharp"
20+
);
21+
@@clientName(CarbonEmissionMonthlySummaryData,
22+
"CarbonEmissionMonthlySummary",
23+
"csharp"
24+
);
25+
@@clientName(CarbonEmissionOverallSummaryData,
26+
"CarbonEmissionOverallSummary",
27+
"csharp"
28+
);
29+
@@clientName(ResourceGroupCarbonEmissionTopItemsSummaryData,
30+
"ResourceGroupCarbonEmissionTopItemsSummary",
31+
"csharp"
32+
);
33+
@@clientName(ResourceCarbonEmissionItemDetailData,
34+
"ResourceCarbonEmissionItemDetail",
35+
"csharp"
36+
);
37+
@@clientName(ResourceCarbonEmissionTopItemMonthlySummaryData,
38+
"ResourceCarbonEmissionTopItemMonthlySummary",
39+
"csharp"
40+
);
41+
@@clientName(ResourceCarbonEmissionTopItemsSummaryData,
42+
"ResourceCarbonEmissionTopItemsSummary",
43+
"csharp"
44+
);
45+
@@clientName(ResourceGroupCarbonEmissionItemDetailData,
46+
"ResourceGroupCarbonEmissionItemDetail",
47+
"csharp"
48+
);
49+
@@clientName(ResourceGroupCarbonEmissionTopItemMonthlySummaryData,
50+
"ResourceGroupCarbonEmissionTopItemMonthlySummary",
51+
"csharp"
52+
);
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"operationId": "CarbonService_QueryCarbonEmissionDataAvailableDateRange",
3+
"title": "CarbonService_QueryCarbonEmissionDataAvailableDateRange",
4+
"parameters": {
5+
"api-version": "2025-04-01",
6+
"queryParameters": {}
7+
},
8+
"responses": {
9+
"200": {
10+
"description": "Returns date range for available carbon emission data",
11+
"body": {
12+
"startDate": "2023-01-01",
13+
"endDate": "2023-05-01"
14+
}
15+
}
16+
}
17+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"title": "Operations_List",
3+
"operationId": "Operations_List",
4+
"parameters": {
5+
"api-version": "2025-04-01"
6+
},
7+
"responses": {
8+
"200": {
9+
"body": {
10+
"value": [
11+
{
12+
"name": "Microsoft.Carbon/action",
13+
"isDataAction": false,
14+
"display": {
15+
"provider": "Microsoft.Carbon",
16+
"resource": "queryCarbonEmissionReport",
17+
"operation": "CarbonService_ListCarbonEmissionReports",
18+
"description": "Returns carbon emission reports."
19+
}
20+
},
21+
{
22+
"name": "Microsoft.Carbon/action",
23+
"isDataAction": false,
24+
"display": {
25+
"provider": "Microsoft.Carbon",
26+
"resource": "QueryCarbonEmissionDataAvailableDateRange",
27+
"operation": "CarbonService_QueryCarbonEmissionDataAvailableDateRange",
28+
"description": "Returns carbon emission data available date range."
29+
}
30+
}
31+
]
32+
}
33+
}
34+
}
35+
}
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
{
2+
"operationId": "CarbonService_QueryCarbonEmissionReports",
3+
"title": "QueryCarbonEmission Location item details Report",
4+
"parameters": {
5+
"api-version": "2025-04-01",
6+
"queryParameters": {
7+
"reportType": "ItemDetailsReport",
8+
"subscriptionList": [
9+
"00000000-0000-0000-0000-000000000000",
10+
"00000000-0000-0000-0000-000000000001,",
11+
"00000000-0000-0000-0000-000000000002",
12+
"00000000-0000-0000-0000-000000000003",
13+
"00000000-0000-0000-0000-000000000004",
14+
"00000000-0000-0000-0000-000000000005",
15+
"00000000-0000-0000-0000-000000000006",
16+
"00000000-0000-0000-0000-000000000007",
17+
"00000000-0000-0000-0000-000000000008"
18+
],
19+
"carbonScopeList": [
20+
"Scope1",
21+
"Scope3"
22+
],
23+
"dateRange": {
24+
"start": "2024-05-01",
25+
"end": "2024-05-01"
26+
},
27+
"categoryType": "Location",
28+
"orderBy": "LatestMonthEmissions",
29+
"sortDirection": "Desc",
30+
"pageSize": 100
31+
}
32+
},
33+
"responses": {
34+
"200": {
35+
"description": "Returns data for location item details report.",
36+
"body": {
37+
"subscriptionAccessDecisionList": [
38+
{
39+
"subscriptionId": "00000000-0000-0000-0000-000000000000",
40+
"decision": "Allowed"
41+
},
42+
{
43+
"subscriptionId": "00000000-0000-0000-0000-000000000001",
44+
"decision": "Allowed"
45+
},
46+
{
47+
"subscriptionId": "00000000-0000-0000-0000-000000000002",
48+
"decision": "Allowed"
49+
},
50+
{
51+
"subscriptionId": "00000000-0000-0000-0000-000000000003",
52+
"decision": "Allowed"
53+
},
54+
{
55+
"subscriptionId": "00000000-0000-0000-0000-000000000004",
56+
"decision": "Allowed"
57+
},
58+
{
59+
"subscriptionId": "00000000-0000-0000-0000-000000000005",
60+
"decision": "Allowed"
61+
},
62+
{
63+
"subscriptionId": "00000000-0000-0000-0000-000000000006",
64+
"decision": "Denied"
65+
},
66+
{
67+
"subscriptionId": "00000000-0000-0000-0000-000000000007",
68+
"decision": "Denied"
69+
},
70+
{
71+
"subscriptionId": "00000000-0000-0000-0000-000000000008",
72+
"decision": "Denied",
73+
"denialReason": "Carbon Optimization Reader permisison required"
74+
}
75+
],
76+
"value": [
77+
{
78+
"dataType": "ItemDetailsData",
79+
"latestMonthEmissions": 0.1,
80+
"previousMonthEmissions": 0.05,
81+
"monthOverMonthEmissionsChangeRatio": 1.0,
82+
"monthlyEmissionsChangeValue": 0.05,
83+
"itemName": "east us",
84+
"categoryType": "Location"
85+
},
86+
{
87+
"dataType": "ItemDetailsData",
88+
"latestMonthEmissions": 0.1,
89+
"previousMonthEmissions": 0.05,
90+
"monthOverMonthEmissionsChangeRatio": 1.0,
91+
"monthlyEmissionsChangeValue": 0.05,
92+
"itemName": "west us",
93+
"categoryType": "Location"
94+
},
95+
{
96+
"dataType": "ItemDetailsData",
97+
"latestMonthEmissions": 0.1,
98+
"previousMonthEmissions": 0.05,
99+
"monthOverMonthEmissionsChangeRatio": 1.0,
100+
"monthlyEmissionsChangeValue": 0.05,
101+
"itemName": "west us 2",
102+
"categoryType": "Location"
103+
},
104+
{
105+
"dataType": "ItemDetailsData",
106+
"latestMonthEmissions": 0.1,
107+
"previousMonthEmissions": 0.05,
108+
"monthOverMonthEmissionsChangeRatio": 1.0,
109+
"monthlyEmissionsChangeValue": 0.05,
110+
"itemName": "west us 3",
111+
"categoryType": "Location"
112+
},
113+
{
114+
"dataType": "ItemDetailsData",
115+
"latestMonthEmissions": 0.1,
116+
"previousMonthEmissions": 0.05,
117+
"monthOverMonthEmissionsChangeRatio": 1.0,
118+
"monthlyEmissionsChangeValue": 0.05,
119+
"itemName": "east us 2",
120+
"categoryType": "Location"
121+
}
122+
]
123+
}
124+
}
125+
}
126+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"operationId": "CarbonService_QueryCarbonEmissionReports",
3+
"title": "QueryCarbonEmission Overall Monthly Summary Report",
4+
"parameters": {
5+
"api-version": "2025-04-01",
6+
"queryParameters": {
7+
"reportType": "MonthlySummaryReport",
8+
"subscriptionList": [
9+
"00000000-0000-0000-0000-000000000000"
10+
],
11+
"carbonScopeList": [
12+
"Scope1",
13+
"Scope3"
14+
],
15+
"dateRange": {
16+
"start": "2024-03-01",
17+
"end": "2024-05-01"
18+
}
19+
}
20+
},
21+
"responses": {
22+
"200": {
23+
"description": "Returns data for overall monthly summary report.",
24+
"body": {
25+
"subscriptionAccessDecisionList": [
26+
{
27+
"subscriptionId": "00000000-0000-0000-0000-000000000000",
28+
"decision": "Allowed"
29+
}
30+
],
31+
"value": [
32+
{
33+
"dataType": "MonthlySummaryData",
34+
"latestMonthEmissions": 0.1,
35+
"previousMonthEmissions": 0.05,
36+
"monthOverMonthEmissionsChangeRatio": 1.0,
37+
"monthlyEmissionsChangeValue": 0.05,
38+
"date": "2024-05-01",
39+
"carbonIntensity": 22
40+
},
41+
{
42+
"dataType": "MonthlySummaryData",
43+
"latestMonthEmissions": 0.1,
44+
"previousMonthEmissions": 0.05,
45+
"monthOverMonthEmissionsChangeRatio": 1.0,
46+
"monthlyEmissionsChangeValue": 0.05,
47+
"date": "2024-04-01",
48+
"carbonIntensity": 22
49+
},
50+
{
51+
"dataType": "MonthlySummaryData",
52+
"latestMonthEmissions": 0.1,
53+
"previousMonthEmissions": 0.05,
54+
"monthOverMonthEmissionsChangeRatio": 1.0,
55+
"monthlyEmissionsChangeValue": 0.05,
56+
"date": "2024-03-01",
57+
"carbonIntensity": 22
58+
}
59+
]
60+
}
61+
}
62+
}
63+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
{
2+
"operationId": "CarbonService_QueryCarbonEmissionReports",
3+
"title": "QueryCarbonEmission Monthly Summary Report with optional filter - locationList, resourceTypeList, resourceGroupUrlList",
4+
"parameters": {
5+
"api-version": "2025-04-01",
6+
"queryParameters": {
7+
"reportType": "MonthlySummaryReport",
8+
"subscriptionList": [
9+
"00000000-0000-0000-0000-000000000000"
10+
],
11+
"carbonScopeList": [
12+
"Scope1",
13+
"Scope3"
14+
],
15+
"dateRange": {
16+
"start": "2024-03-01",
17+
"end": "2024-05-01"
18+
},
19+
"locationList": [
20+
"east us",
21+
"west us"
22+
],
23+
"resourceTypeList": [
24+
"microsoft.storage/storageaccounts",
25+
"microsoft.databricks/workspaces"
26+
],
27+
"resourceGroupUrlList": [
28+
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg-name"
29+
]
30+
}
31+
},
32+
"responses": {
33+
"200": {
34+
"description": "Returns data for overall monthly summary report.",
35+
"body": {
36+
"subscriptionAccessDecisionList": [
37+
{
38+
"subscriptionId": "00000000-0000-0000-0000-000000000000",
39+
"decision": "Allowed"
40+
}
41+
],
42+
"value": [
43+
{
44+
"dataType": "MonthlySummaryData",
45+
"latestMonthEmissions": 0.1,
46+
"previousMonthEmissions": 0.05,
47+
"monthOverMonthEmissionsChangeRatio": 1.0,
48+
"monthlyEmissionsChangeValue": 0.05,
49+
"date": "2024-05-01",
50+
"carbonIntensity": 22
51+
},
52+
{
53+
"dataType": "MonthlySummaryData",
54+
"latestMonthEmissions": 0.1,
55+
"previousMonthEmissions": 0.05,
56+
"monthOverMonthEmissionsChangeRatio": 1.0,
57+
"monthlyEmissionsChangeValue": 0.05,
58+
"date": "2024-04-01",
59+
"carbonIntensity": 22
60+
},
61+
{
62+
"dataType": "MonthlySummaryData",
63+
"latestMonthEmissions": 0.1,
64+
"previousMonthEmissions": 0.05,
65+
"monthOverMonthEmissionsChangeRatio": 1.0,
66+
"monthlyEmissionsChangeValue": 0.05,
67+
"date": "2024-03-01",
68+
"carbonIntensity": 22
69+
}
70+
]
71+
}
72+
}
73+
}
74+
}

0 commit comments

Comments
 (0)