Skip to content

Commit 717f57e

Browse files
authored
Monitor Ingestion Go Config (Azure#35837)
* go config * format * format * format * fake
1 parent 9b8daba commit 717f57e

File tree

3 files changed

+49
-3
lines changed

3 files changed

+49
-3
lines changed

specification/monitor/Azure.Monitor.Ingestion/client.tsp

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,49 @@ import "./main.tsp";
22
import "@azure-tools/typespec-client-generator-core";
33

44
using Azure.ClientGenerator.Core;
5-
using LogsIngestion;
5+
using TypeSpec.Http;
6+
using TypeSpec.Versioning;
67

8+
@versioned(LogsIngestion.Versions)
79
namespace ClientCustomizations;
810

11+
@@clientName(LogsIngestion, "Client", "go");
12+
13+
using LogsIngestion;
14+
915
@@access(upload, Access.internal, "python");
1016

11-
@@clientName(LogsIngestion, "Client", "go");
17+
// go configuration- using override to remove optional parameter `ClientRequestIdHeader`
18+
19+
/**
20+
* Ingestion API used to directly ingest data using Data Collection Rules.
21+
*/
22+
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Doesn't fit standard ops"
23+
@summary("Ingestion API used to directly ingest data using Data Collection Rules.")
24+
@route("/dataCollectionRules/{ruleId}/streams/{stream}")
25+
@post
26+
op upload2 is Azure.Core.Foundations.Operation<
27+
{
28+
/** The immutable ID of the Data Collection Rule resource. */
29+
@path
30+
ruleId: string;
31+
32+
/** The streamDeclaration name as defined in the Data Collection Rule. */
33+
@path("stream")
34+
streamName: string;
35+
36+
/** The content encoding of the request body which is always 'gzip'. */
37+
@header("Content-Encoding")
38+
contentEncoding?: string;
39+
40+
/** The array of objects matching the schema defined by the provided stream. */
41+
#suppress "@azure-tools/typespec-azure-core/request-body-problem"
42+
@alternateType(unknown, "go")
43+
@clientName("logs", "go")
44+
@body
45+
body: Record<unknown>[];
46+
},
47+
void
48+
>;
49+
50+
@@override(upload, upload2, "go");

specification/monitor/Azure.Monitor.Ingestion/routes.tsp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import "@azure-tools/typespec-azure-core";
2+
import "@azure-tools/typespec-client-generator-core";
23
import "@typespec/rest";
34

45
using TypeSpec.Http;
56
using Azure.Core;
7+
using Azure.ClientGenerator.Core;
68

79
namespace LogsIngestion;
810

@@ -29,6 +31,8 @@ op upload is Azure.Core.Foundations.Operation<
2931

3032
/** The array of objects matching the schema defined by the provided stream. */
3133
#suppress "@azure-tools/typespec-azure-core/request-body-problem"
34+
@alternateType(unknown, "go")
35+
@clientName("logs", "go")
3236
@body
3337
body: Record<unknown>[];
3438

specification/monitor/Azure.Monitor.Ingestion/tspconfig.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ options:
2929
"@azure-tools/typespec-go":
3030
service-dir: "sdk/monitor/ingestion"
3131
package-dir: "azlogs"
32-
emitter-output-dir: "{project-root}"
32+
module: "github.com/Azure/azure-sdk-for-go/sdk/monitor/ingestion/azlogs"
33+
module-version: "0.0.1"
34+
single-client: true
35+
rawjson-as-bytes: true
3336
inject-spans: true
3437
generate-fakes: true
3538
"@azure-tools/typespec-csharp":

0 commit comments

Comments
 (0)