|
1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | 2 | <doc> |
3 | 3 | <members> |
4 | | - <member name="UploadAsync(string,string,RequestContent,string,RequestContext)"> |
| 4 | + <member name="UploadAsync(string,string,IEnumerable{IDictionary{string,BinaryData}},string,CancellationToken)"> |
5 | 5 | <example> |
6 | 6 | This sample shows how to call UploadAsync. |
7 | 7 | <code><![CDATA[ |
8 | 8 | Uri endpoint = new Uri("<endpoint>"); |
9 | 9 | TokenCredential credential = new DefaultAzureCredential(); |
10 | 10 | LogsIngestionClient client = new LogsIngestionClient(endpoint, credential); |
11 | 11 |
|
12 | | -using RequestContent content = RequestContent.Create(new object[] |
| 12 | +Response response = await client.UploadAsync("c512b59c-4005-40e2-b13d-ac29cfb46af4", "Custom-TestStream", new IDictionary<string, BinaryData>[] |
13 | 13 | { |
14 | | - new object() |
| 14 | + new Dictionary<string, BinaryData> |
| 15 | + { |
| 16 | + ["Time"] = BinaryData.FromObjectAsJson("2021-12-08T23:51:14.1104269Z"), |
| 17 | + ["Computer"] = BinaryData.FromObjectAsJson("Computer1"), |
| 18 | + ["AdditionalContext"] = BinaryData.FromObjectAsJson(new Dictionary<string, object> |
| 19 | + { |
| 20 | + ["$id"] = "55", |
| 21 | + ["InstanceName"] = "user1", |
| 22 | + ["TimeZone"] = "Pacific Time", |
| 23 | + ["Level"] = 4, |
| 24 | + ["CounterName"] = "AppMetric1", |
| 25 | + ["CounterValue"] = 15.3F |
| 26 | + }) |
| 27 | + }, |
| 28 | + new Dictionary<string, BinaryData> |
| 29 | + { |
| 30 | + ["Time"] = BinaryData.FromObjectAsJson("2021-12-08T23:51:14.1104269Z"), |
| 31 | + ["Computer"] = BinaryData.FromObjectAsJson("Computer2"), |
| 32 | + ["AdditionalContext"] = BinaryData.FromObjectAsJson(new Dictionary<string, object> |
| 33 | + { |
| 34 | + ["$id"] = "61", |
| 35 | + ["InstanceName"] = "user2", |
| 36 | + ["TimeZone"] = "Central Time", |
| 37 | + ["Level"] = 3, |
| 38 | + ["CounterName"] = "AppMetric1", |
| 39 | + ["CounterValue"] = 23.5F |
| 40 | + }) |
| 41 | + } |
15 | 42 | }); |
16 | | -Response response = await client.UploadAsync("<ruleId>", "<streamName>", content); |
17 | | -
|
18 | | -Console.WriteLine(response.Status); |
19 | | -]]></code> |
20 | | -This sample shows how to call UploadAsync with all parameters and request content. |
| 43 | +]]></code></example> |
| 44 | + </member> |
| 45 | + <member name="Upload(string,string,IEnumerable{IDictionary{string,BinaryData}},string,CancellationToken)"> |
| 46 | + <example> |
| 47 | +This sample shows how to call Upload. |
21 | 48 | <code><![CDATA[ |
22 | 49 | Uri endpoint = new Uri("<endpoint>"); |
23 | 50 | TokenCredential credential = new DefaultAzureCredential(); |
24 | 51 | LogsIngestionClient client = new LogsIngestionClient(endpoint, credential); |
25 | 52 |
|
26 | | -using RequestContent content = RequestContent.Create(new object[] |
| 53 | +Response response = client.Upload("c512b59c-4005-40e2-b13d-ac29cfb46af4", "Custom-TestStream", new IDictionary<string, BinaryData>[] |
27 | 54 | { |
28 | | - new object() |
| 55 | + new Dictionary<string, BinaryData> |
| 56 | + { |
| 57 | + ["Time"] = BinaryData.FromObjectAsJson("2021-12-08T23:51:14.1104269Z"), |
| 58 | + ["Computer"] = BinaryData.FromObjectAsJson("Computer1"), |
| 59 | + ["AdditionalContext"] = BinaryData.FromObjectAsJson(new Dictionary<string, object> |
| 60 | + { |
| 61 | + ["$id"] = "55", |
| 62 | + ["InstanceName"] = "user1", |
| 63 | + ["TimeZone"] = "Pacific Time", |
| 64 | + ["Level"] = 4, |
| 65 | + ["CounterName"] = "AppMetric1", |
| 66 | + ["CounterValue"] = 15.3F |
| 67 | + }) |
| 68 | + }, |
| 69 | + new Dictionary<string, BinaryData> |
| 70 | + { |
| 71 | + ["Time"] = BinaryData.FromObjectAsJson("2021-12-08T23:51:14.1104269Z"), |
| 72 | + ["Computer"] = BinaryData.FromObjectAsJson("Computer2"), |
| 73 | + ["AdditionalContext"] = BinaryData.FromObjectAsJson(new Dictionary<string, object> |
| 74 | + { |
| 75 | + ["$id"] = "61", |
| 76 | + ["InstanceName"] = "user2", |
| 77 | + ["TimeZone"] = "Central Time", |
| 78 | + ["Level"] = 3, |
| 79 | + ["CounterName"] = "AppMetric1", |
| 80 | + ["CounterValue"] = 23.5F |
| 81 | + }) |
| 82 | + } |
29 | 83 | }); |
30 | | -Response response = await client.UploadAsync("<ruleId>", "<streamName>", content, contentEncoding: "<contentEncoding>"); |
31 | | -
|
32 | | -Console.WriteLine(response.Status); |
33 | 84 | ]]></code></example> |
34 | 85 | </member> |
35 | | - <member name="Upload(string,string,RequestContent,string,RequestContext)"> |
| 86 | + <member name="UploadAsync(string,string,RequestContent,string,RequestContext)"> |
36 | 87 | <example> |
37 | | -This sample shows how to call Upload. |
| 88 | +This sample shows how to call UploadAsync. |
38 | 89 | <code><![CDATA[ |
39 | 90 | Uri endpoint = new Uri("<endpoint>"); |
40 | 91 | TokenCredential credential = new DefaultAzureCredential(); |
41 | 92 | LogsIngestionClient client = new LogsIngestionClient(endpoint, credential); |
42 | 93 |
|
43 | 94 | using RequestContent content = RequestContent.Create(new object[] |
44 | 95 | { |
45 | | - new object() |
| 96 | + new |
| 97 | + { |
| 98 | + Time = "2021-12-08T23:51:14.1104269Z", |
| 99 | + Computer = "Computer1", |
| 100 | + AdditionalContext = new Dictionary<string, object> |
| 101 | + { |
| 102 | + ["$id"] = "55", |
| 103 | + ["InstanceName"] = "user1", |
| 104 | + ["TimeZone"] = "Pacific Time", |
| 105 | + ["Level"] = 4, |
| 106 | + ["CounterName"] = "AppMetric1", |
| 107 | + ["CounterValue"] = 15.3F |
| 108 | + }, |
| 109 | + }, |
| 110 | + new |
| 111 | + { |
| 112 | + Time = "2021-12-08T23:51:14.1104269Z", |
| 113 | + Computer = "Computer2", |
| 114 | + AdditionalContext = new Dictionary<string, object> |
| 115 | + { |
| 116 | + ["$id"] = "61", |
| 117 | + ["InstanceName"] = "user2", |
| 118 | + ["TimeZone"] = "Central Time", |
| 119 | + ["Level"] = 3, |
| 120 | + ["CounterName"] = "AppMetric1", |
| 121 | + ["CounterValue"] = 23.5F |
| 122 | + }, |
| 123 | + } |
46 | 124 | }); |
47 | | -Response response = client.Upload("<ruleId>", "<streamName>", content); |
| 125 | +Response response = await client.UploadAsync("c512b59c-4005-40e2-b13d-ac29cfb46af4", "Custom-TestStream", content); |
48 | 126 |
|
49 | 127 | Console.WriteLine(response.Status); |
50 | | -]]></code> |
51 | | -This sample shows how to call Upload with all parameters and request content. |
| 128 | +]]></code></example> |
| 129 | + </member> |
| 130 | + <member name="Upload(string,string,RequestContent,string,RequestContext)"> |
| 131 | + <example> |
| 132 | +This sample shows how to call Upload. |
52 | 133 | <code><![CDATA[ |
53 | 134 | Uri endpoint = new Uri("<endpoint>"); |
54 | 135 | TokenCredential credential = new DefaultAzureCredential(); |
55 | 136 | LogsIngestionClient client = new LogsIngestionClient(endpoint, credential); |
56 | 137 |
|
57 | 138 | using RequestContent content = RequestContent.Create(new object[] |
58 | 139 | { |
59 | | - new object() |
| 140 | + new |
| 141 | + { |
| 142 | + Time = "2021-12-08T23:51:14.1104269Z", |
| 143 | + Computer = "Computer1", |
| 144 | + AdditionalContext = new Dictionary<string, object> |
| 145 | + { |
| 146 | + ["$id"] = "55", |
| 147 | + ["InstanceName"] = "user1", |
| 148 | + ["TimeZone"] = "Pacific Time", |
| 149 | + ["Level"] = 4, |
| 150 | + ["CounterName"] = "AppMetric1", |
| 151 | + ["CounterValue"] = 15.3F |
| 152 | + }, |
| 153 | + }, |
| 154 | + new |
| 155 | + { |
| 156 | + Time = "2021-12-08T23:51:14.1104269Z", |
| 157 | + Computer = "Computer2", |
| 158 | + AdditionalContext = new Dictionary<string, object> |
| 159 | + { |
| 160 | + ["$id"] = "61", |
| 161 | + ["InstanceName"] = "user2", |
| 162 | + ["TimeZone"] = "Central Time", |
| 163 | + ["Level"] = 3, |
| 164 | + ["CounterName"] = "AppMetric1", |
| 165 | + ["CounterValue"] = 23.5F |
| 166 | + }, |
| 167 | + } |
60 | 168 | }); |
61 | | -Response response = client.Upload("<ruleId>", "<streamName>", content, contentEncoding: "<contentEncoding>"); |
| 169 | +Response response = client.Upload("c512b59c-4005-40e2-b13d-ac29cfb46af4", "Custom-TestStream", content); |
62 | 170 |
|
63 | 171 | Console.WriteLine(response.Status); |
64 | 172 | ]]></code></example> |
|
0 commit comments