@@ -34,23 +34,27 @@ public async Task<Workflow> Argo_CreateWorkflowAsync(string argoNamespace, Workf
34
34
var urlBuilder = new StringBuilder ( ) ;
35
35
urlBuilder . Append ( CultureInfo . InvariantCulture , $ "{ FormattedBaseUrl } /api/v1/workflows/{ argoNamespace } ") ;
36
36
37
- var Method = "POST" ;
37
+ var method = "POST" ;
38
38
var content = new StringContent ( Newtonsoft . Json . JsonConvert . SerializeObject ( body ) ) ;
39
- return await SendRequest < Workflow > ( content , urlBuilder , Method , cancellationToken ) . ConfigureAwait ( false ) ;
39
+ return await SendRequest < Workflow > ( content , urlBuilder , method , cancellationToken ) . ConfigureAwait ( false ) ;
40
40
41
41
}
42
42
43
- public async Task < Workflow ? > Argo_GetWorkflowAsync ( string argoNamespace , string name , string ? getOptions_resourceVersion , string ? fields , CancellationToken cancellationToken )
43
+ public async Task < Workflow ? > Argo_GetWorkflowAsync ( string argoNamespace ,
44
+ string name ,
45
+ string ? getOptionsResourceVersion ,
46
+ string ? fields ,
47
+ CancellationToken cancellationToken )
44
48
{
45
49
Guard . Against . NullOrWhiteSpace ( argoNamespace , nameof ( argoNamespace ) ) ;
46
50
Guard . Against . Null ( name , nameof ( name ) ) ;
47
51
48
52
var urlBuilder = new StringBuilder ( ) ;
49
53
urlBuilder . Append ( CultureInfo . InvariantCulture , $ "{ FormattedBaseUrl } /api/v1/workflows/{ argoNamespace } /{ name } ?") ;
50
54
51
- if ( getOptions_resourceVersion != null )
55
+ if ( getOptionsResourceVersion != null )
52
56
{
53
- urlBuilder . Append ( Uri . EscapeDataString ( "getOptions.resourceVersion" ) + "=" ) . Append ( Uri . EscapeDataString ( ConvertToString ( getOptions_resourceVersion , CultureInfo . InvariantCulture ) ) ) . Append ( '&' ) ;
57
+ urlBuilder . Append ( Uri . EscapeDataString ( "getOptions.resourceVersion" ) + "=" ) . Append ( Uri . EscapeDataString ( ConvertToString ( getOptionsResourceVersion , CultureInfo . InvariantCulture ) ) ) . Append ( '&' ) ;
54
58
}
55
59
if ( fields != null )
56
60
{
@@ -71,9 +75,9 @@ public async Task<Workflow> Argo_StopWorkflowAsync(string argoNamespace, string
71
75
var urlBuilder = new StringBuilder ( ) ;
72
76
urlBuilder . Append ( CultureInfo . InvariantCulture , $ "{ FormattedBaseUrl } /api/v1/workflows/{ argoNamespace } /{ name } /stop") ;
73
77
74
- var Method = "PUT" ;
78
+ const string method = "PUT" ;
75
79
var content = new StringContent ( Newtonsoft . Json . JsonConvert . SerializeObject ( body ) ) ;
76
- return await SendRequest < Workflow > ( content , urlBuilder , Method , new CancellationToken ( ) ) . ConfigureAwait ( false ) ;
80
+ return await SendRequest < Workflow > ( content , urlBuilder , method , new CancellationToken ( ) ) . ConfigureAwait ( false ) ;
77
81
78
82
}
79
83
@@ -86,22 +90,22 @@ public async Task<Workflow> Argo_TerminateWorkflowAsync(string argoNamespace, st
86
90
var urlBuilder = new StringBuilder ( ) ;
87
91
urlBuilder . Append ( CultureInfo . InvariantCulture , $ "{ FormattedBaseUrl } /api/v1/workflows/{ argoNamespace } /{ name } /terminate") ;
88
92
89
- var Method = "PUT" ;
93
+ const string method = "PUT" ;
90
94
var content = new StringContent ( Newtonsoft . Json . JsonConvert . SerializeObject ( body ) ) ;
91
- return await SendRequest < Workflow > ( content , urlBuilder , Method , new CancellationToken ( ) ) . ConfigureAwait ( false ) ;
95
+ return await SendRequest < Workflow > ( content , urlBuilder , method , new CancellationToken ( ) ) . ConfigureAwait ( false ) ;
92
96
}
93
97
94
- public async Task < WorkflowTemplate ? > Argo_GetWorkflowTemplateAsync ( string argoNamespace , string name , string ? getOptions_resourceVersion )
98
+ public async Task < WorkflowTemplate ? > Argo_GetWorkflowTemplateAsync ( string argoNamespace , string name , string ? getOptionsResourceVersion )
95
99
{
96
100
Guard . Against . NullOrWhiteSpace ( argoNamespace , nameof ( argoNamespace ) ) ;
97
101
Guard . Against . Null ( name , nameof ( name ) ) ;
98
102
99
103
var urlBuilder = new StringBuilder ( ) ;
100
104
urlBuilder . Append ( CultureInfo . InvariantCulture , $ "{ FormattedBaseUrl } /api/v1/workflow-templates/{ argoNamespace } /{ name } ?") ;
101
105
102
- if ( getOptions_resourceVersion != null )
106
+ if ( getOptionsResourceVersion != null )
103
107
{
104
- urlBuilder . Append ( Uri . EscapeDataString ( "getOptions.resourceVersion" ) + "=" ) . Append ( Uri . EscapeDataString ( ConvertToString ( getOptions_resourceVersion , CultureInfo . InvariantCulture ) ) ) . Append ( '&' ) ;
108
+ urlBuilder . Append ( Uri . EscapeDataString ( "getOptions.resourceVersion" ) + "=" ) . Append ( Uri . EscapeDataString ( ConvertToString ( getOptionsResourceVersion , CultureInfo . InvariantCulture ) ) ) . Append ( '&' ) ;
105
109
}
106
110
urlBuilder . Length -- ;
107
111
@@ -116,7 +120,7 @@ public async Task<Workflow> Argo_TerminateWorkflowAsync(string argoNamespace, st
116
120
return await GetRequest < Version > ( urlBuilder ) . ConfigureAwait ( false ) ;
117
121
}
118
122
119
- public async Task < string ? > Argo_Get_WorkflowLogsAsync ( string argoNamespace , string name , string ? podName , string logOptions_container )
123
+ public async Task < string ? > Argo_Get_WorkflowLogsAsync ( string argoNamespace , string name , string ? podName , string logOptionsContainer )
120
124
{
121
125
Guard . Against . NullOrWhiteSpace ( argoNamespace , nameof ( argoNamespace ) ) ;
122
126
Guard . Against . Null ( name , nameof ( name ) ) ;
@@ -128,9 +132,9 @@ public async Task<Workflow> Argo_TerminateWorkflowAsync(string argoNamespace, st
128
132
{
129
133
urlBuilder . Append ( Uri . EscapeDataString ( "podName" ) + "=" ) . Append ( Uri . EscapeDataString ( ConvertToString ( podName , CultureInfo . InvariantCulture ) ) ) . Append ( '&' ) ;
130
134
}
131
- if ( logOptions_container != null )
135
+ if ( logOptionsContainer != null )
132
136
{
133
- urlBuilder . Append ( Uri . EscapeDataString ( "logOptions.container" ) + "=" ) . Append ( Uri . EscapeDataString ( ConvertToString ( logOptions_container , CultureInfo . InvariantCulture ) ) ) . Append ( '&' ) ;
137
+ urlBuilder . Append ( Uri . EscapeDataString ( "logOptions.container" ) + "=" ) . Append ( Uri . EscapeDataString ( ConvertToString ( logOptionsContainer , CultureInfo . InvariantCulture ) ) ) . Append ( '&' ) ;
134
138
}
135
139
136
140
urlBuilder . Length -- ;
@@ -152,8 +156,8 @@ public virtual async Task<WorkflowTemplate> Argo_CreateWorkflowTemplateAsync(str
152
156
var stringBody = Newtonsoft . Json . JsonConvert . SerializeObject ( body ) ;
153
157
var content = new StringContent ( stringBody ) ;
154
158
155
- var _logger = NLog . LogManager . GetCurrentClassLogger ( ) ;
156
- _logger . Debug ( $ "Sending content to Argo :{ stringBody } ") ;
159
+ var logger = NLog . LogManager . GetCurrentClassLogger ( ) ;
160
+ logger . Debug ( $ "Sending content to Argo :{ stringBody . Replace ( Environment . NewLine , "" ) } ") ;
157
161
return await SendRequest < WorkflowTemplate > ( content , urlBuilder , method , cancellationToken ) . ConfigureAwait ( false ) ;
158
162
}
159
163
@@ -250,22 +254,22 @@ protected async Task<T> SendRequest<T>(StringContent stringContent, StringBuilde
250
254
251
255
try
252
256
{
253
- var headers = Enumerable . ToDictionary ( response . Headers , h_ => h_ . Key , h_ => h_ . Value ) ;
257
+ var headers = Enumerable . ToDictionary ( response . Headers , h => h . Key , h => h . Value ) ;
254
258
if ( response . Content != null && response . Content . Headers != null )
255
259
{
256
- foreach ( var item_ in response . Content . Headers )
257
- headers [ item_ . Key ] = item_ . Value ;
260
+ foreach ( var item in response . Content . Headers )
261
+ headers [ item . Key ] = item . Value ;
258
262
}
259
263
260
264
var status = ( int ) response . StatusCode ;
261
265
if ( status == 200 )
262
266
{
263
- var objectResponse_ = await ReadObjectResponseAsync < T > ( response , headers ) . ConfigureAwait ( false ) ;
264
- if ( objectResponse_ . Object == null )
267
+ var objectResponse = await ReadObjectResponseAsync < T > ( response , headers ) . ConfigureAwait ( false ) ;
268
+ if ( objectResponse . Object == null )
265
269
{
266
- throw new ApiException ( "Response was null which was not expected." , status , objectResponse_ . Text , headers , null ) ;
270
+ throw new ApiException ( "Response was null which was not expected." , status , objectResponse . Text , headers , null ) ;
267
271
}
268
- return objectResponse_ . Object ;
272
+ return objectResponse . Object ;
269
273
}
270
274
else
271
275
{
@@ -296,34 +300,34 @@ protected async Task<T> SendRequest<T>(StringContent stringContent, StringBuilde
296
300
var response = await HttpClient . SendAsync ( request , HttpCompletionOption . ResponseHeadersRead ) . ConfigureAwait ( false ) ;
297
301
try
298
302
{
299
- var headers_ = Enumerable . ToDictionary ( response . Headers , h_ => h_ . Key , h_ => h_ . Value ) ;
303
+ var headers = Enumerable . ToDictionary ( response . Headers , h => h . Key , h => h . Value ) ;
300
304
if ( response . Content != null && response . Content . Headers != null )
301
305
{
302
- foreach ( var item_ in response . Content . Headers )
303
- headers_ [ item_ . Key ] = item_ . Value ;
306
+ foreach ( var item in response . Content . Headers )
307
+ headers [ item . Key ] = item . Value ;
304
308
}
305
309
306
310
var status = ( int ) response . StatusCode ;
307
311
if ( status == 200 )
308
312
{
309
- ObjectResponseResult < T ? > objectResponse_ ;
313
+ ObjectResponseResult < T ? > objectResponse ;
310
314
311
- objectResponse_ = await ReadObjectResponseAsync < T > ( response , headers_ , isLogs ) . ConfigureAwait ( false ) ;
315
+ objectResponse = await ReadObjectResponseAsync < T > ( response , headers , isLogs ) . ConfigureAwait ( false ) ;
312
316
313
- if ( objectResponse_ . Object == null )
317
+ if ( objectResponse . Object == null )
314
318
{
315
- throw new ApiException ( "Response was null which was not expected." , status , objectResponse_ . Text , headers_ , null ) ;
319
+ throw new ApiException ( "Response was null which was not expected." , status , objectResponse . Text , headers , null ) ;
316
320
}
317
- return objectResponse_ . Object ;
321
+ return objectResponse . Object ;
318
322
}
319
323
else
320
324
{
321
- var objectResponse_ = await ReadObjectResponseAsync < Error > ( response , headers_ , false ) . ConfigureAwait ( false ) ;
322
- if ( objectResponse_ . Object == null )
325
+ var objectResponse = await ReadObjectResponseAsync < Error > ( response , headers , false ) . ConfigureAwait ( false ) ;
326
+ if ( objectResponse . Object == null )
323
327
{
324
- throw new ApiException ( "Response was null which was not expected." , status , objectResponse_ . Text , headers_ , null ) ;
328
+ throw new ApiException ( "Response was null which was not expected." , status , objectResponse . Text , headers , null ) ;
325
329
}
326
- throw new ApiException < Error > ( "An unexpected error response." , status , objectResponse_ . Text , headers_ , objectResponse_ . Object , null ) ;
330
+ throw new ApiException < Error > ( "An unexpected error response." , status , objectResponse . Text , headers , objectResponse . Object , null ) ;
327
331
}
328
332
}
329
333
finally
0 commit comments