Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mdaneri committed Nov 7, 2023
1 parent 02146a2 commit 0321131
Show file tree
Hide file tree
Showing 18 changed files with 930 additions and 1,154 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
c\#.netcode/VCDRTest/VCDRTest.csproj.user
c\#.netcode/VCDRTest/VCDRTest.csproj.user
.vscode/launch.json
publish/
publish/VMware.VCDRService*
92 changes: 42 additions & 50 deletions NSwag/VcdrBackendPlatform.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
openapi: 3.0.3
info:
description: VCDR Backend Public APIs.
version: '1.1'
version: 1.0.0-oas3
title: VCDR Backend Public APIs
contact:
name: VMware
Expand All @@ -10,25 +10,17 @@ info:
x-vmw-vapi-codegenconfig:
package-name: com.vmware.vcdr
tag-resources-by-url-path: true

security:
- api_key: []

- api_key: []
servers:
- description: VCDR production backend
url: 'https://vcdrsp-prd-vcdr-backend-res01-prd-us-west-2.vdp.vmware.com/api'

schemes:
- https

produces:
- application/json
- text/plain
url: https://vcdrsp-prd-vcdr-backend-res01-prd-us-west-2.vdp.vmware.com/api
tags:
- name: deployment-vcdr
description: VCDR self-service APIs for Deployment (Deploy / Un-Deploy, Link with CSP etc.,)
description: >-
VCDR self-service APIs for Deployment (Deploy / Un-Deploy, Link with CSP
etc.,)
paths:

/vcdr/org/{org-id}/deployments:
get:
tags:
Expand All @@ -37,7 +29,7 @@ paths:
description: Get all VCDR Deployments in given org
operationId: getVcdrDeployments
parameters:
- $ref: '#/parameters/orgIdPathParam'
- $ref : '#/components/parameters/orgIdPathParam'
responses:
'200':
description: OK
Expand All @@ -57,39 +49,38 @@ paths:
description: Not Found
'500':
description: Internal Server Error



components:
securitySchemes:
api_key:
type: apiKey
description: 'In order to make VMware Cloud Disaster Recovery REST API calls, you need to authenticate with the Cloud Services Platform, which will exchange an API token for an access token. This access token must be provided in the header for al VCDR REST API calls.<p>'
description: >-
In order to make VMware Cloud Disaster Recovery REST API calls, you need
to authenticate with the Cloud Services Platform, which will exchange an
API token for an access token. This access token must be provided in the
header for al VCDR REST API calls.<p>
in: header
name: csp-auth-token

parameters:
orgIdPathParam:
name: org-id
in: path
description: organization identifier
required: true
type: string
format: uuid
schema:
type: string
format: uuid
orgIdQueryParam:
name: org-id
in: query
description: ORG identifier
required: true
schema:
type: string
#format: uuid
example: "55f1a417-1c88-4bc0-aa38-5edb7ab6b47a"

schemas:
example: 55f1a417-1c88-4bc0-aa38-5edb7ab6b47a
schemas:
TenantDeployment:
title: Deployment info exposed to Tenant orgs
type: object
type: object
required:
- id
- type
Expand Down Expand Up @@ -130,30 +121,30 @@ components:
start_time:
description: Time at which Deployment started
type: string
format: 'date-time'
example: "2021-11-02T23:20:15Z"
format: date-time
example: '2021-11-02T23:20:15Z'
end_time:
description: Time at which Deployment completed
type: string
format: 'date-time'
example: "2021-11-02T23:23:12Z"
format: date-time
example: '2021-11-02T23:23:12Z'
deletion_requested_time:
nullable: true
description: Time at which deployment deletion is requested.
type: string
format: 'date-time'
example: "2021-11-03T23:23:12Z"
format: date-time
example: '2021-11-03T23:23:12Z'
config:
$ref: '#/components/schemas/TenantDeploymentConfig'
created_by:
type: string
description: User who created the deployment.
example: "[email protected]"
example: [email protected]
deletion_requested_by:
type: string
nullable: true
description: User who requested to delete deployment.
example: "[email protected]"
example: [email protected]
org_id:
type: string
description: Org id
Expand All @@ -168,7 +159,7 @@ components:
ReleaseTypeEnum:
title: Release Types
type: string
default: 'GA'
default: GA
enum:
- GA
- EA
Expand All @@ -179,7 +170,7 @@ components:
enum:
- COMMON
- INDIVIDUAL
example: COMMON
example: COMMON
LambdaMigrationStateEnum:
title: Lambda migration state enum
type: string
Expand Down Expand Up @@ -211,9 +202,7 @@ components:
minLength: 1
seller_id:
nullable: true
type: string
minLimit: 1
maxLimit: 256
type: string
seller:
$ref: '#/components/schemas/SellerOfRecordEnum'
TenantDeploymentConfig:
Expand All @@ -222,22 +211,21 @@ components:
properties:
subscription_info:
$ref: '#/components/schemas/SubscriptionConfig'
cloud_provider:
nullable: true
cloud_provider:
$ref: '#/components/schemas/TenantCloudProviderConfig'
orchestrator:
nullable: true
orchestrator:
$ref: '#/components/schemas/TenantOrchestratorConfig'
CloudProvidersEnum:
title: Cloud Provider Types
type: string
enum:
- AWS
- MOCK # Mock Cloud Provider to potentially fake deployment
- MOCK
example: AWS
SellerOfRecordEnum:
title: Seller Of Records
type: string
nullable: true
enum:
- VMWARE
- AWS
Expand All @@ -246,11 +234,11 @@ components:
SubscriptionConfig:
title: Subscription config in Deployment
type: object
nullable: true
properties:
seller:
type: string
minLimit: 1
maxLimit: 256
nullable: true
type: string
paid_pilot:
type: boolean
description: Whether Paid pilot was activated during deployment
Expand All @@ -265,6 +253,7 @@ components:
required:
- provider
- region
nullable: true
properties:
provider:
$ref: '#/components/schemas/CloudProvidersEnum'
Expand All @@ -273,8 +262,11 @@ components:
description: Cloud Provider Region ID in which deployment was requested
example: us-west-2
TenantOrchestratorConfig:
title: Deployment configuration for VCDR orchestrator (Control Shift / IRR) exposed to Tenants.
title: >-
Deployment configuration for VCDR orchestrator (Control Shift / IRR)
exposed to Tenants.
type: object
nullable: true
properties:
ip:
type: string
Expand All @@ -287,7 +279,7 @@ components:
DeploymentStatesEnum:
title: Deployment States
type: string
enum: # TODO add more states as needed
enum:
- IN_PROGRESS
- READY
- FAILED
Expand Down
29 changes: 17 additions & 12 deletions c#.netcode/VMware.VCDRService/CloudServicePlatform.cs
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
//----------------------
// <auto-generated>
// Generated using the NSwag toolchain v13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v12.0.0.0)) (http://NSwag.org)
// Generated using the NSwag toolchain v13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v12.0.0.0)) (http://NSwag.org)
// </auto-generated>
//----------------------

#pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended."
#pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword."
#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?'
#pragma warning disable 612 // Disable "CS0612 '...' is obsolete"
#pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ...
#pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..."
#pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'"
#pragma warning disable 3016 // Disable "CS3016 Arrays as attribute arguments is not CLS-compliant"
#pragma warning disable 8603 // Disable "CS8603 Possible null reference return"
#pragma warning disable 8604 // Disable "CS8604 Possible null reference argument for parameter"

namespace VMware.VCDRService
{
using System = global::System;

[System.CodeDom.Compiler.GeneratedCode("NSwag", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v12.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v12.0.0.0))")]
public partial class CloudServicePlatform
{
private string _baseUrl = "https://console.cloud.vmware.com/csp/gateway/am/api";
Expand All @@ -27,7 +29,7 @@ public partial class CloudServicePlatform
public CloudServicePlatform(System.Net.Http.HttpClient httpClient)
{
_httpClient = httpClient;
_settings = new System.Lazy<Newtonsoft.Json.JsonSerializerSettings>(CreateSerializerSettings);
_settings = new System.Lazy<Newtonsoft.Json.JsonSerializerSettings>(CreateSerializerSettings, true);
}

private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings()
Expand Down Expand Up @@ -424,7 +426,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu
}
}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v12.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v12.0.0.0))")]
public partial class ApiTokenDetailsDto
{
/// <summary>
Expand Down Expand Up @@ -510,7 +512,7 @@ public System.Collections.Generic.IDictionary<string, object> AdditionalProperti

}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v12.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v12.0.0.0))")]
public partial class AccessTokenDto
{
/// <summary>
Expand Down Expand Up @@ -561,7 +563,7 @@ public System.Collections.Generic.IDictionary<string, object> AdditionalProperti

}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v12.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v12.0.0.0))")]
public partial class GetApiTokenDetailsRequest
{
/// <summary>
Expand All @@ -581,7 +583,7 @@ public System.Collections.Generic.IDictionary<string, object> AdditionalProperti

}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v12.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v12.0.0.0))")]
public partial class GetAccessTokenByApiRefreshTokenRequest
{
/// <summary>
Expand Down Expand Up @@ -616,10 +618,13 @@ public System.Collections.Generic.IDictionary<string, object> AdditionalProperti

}

#pragma warning restore 1591
#pragma warning restore 1573
#pragma warning restore 472
#pragma warning restore 114
#pragma warning restore 108
#pragma warning restore 114
#pragma warning restore 472
#pragma warning restore 612
#pragma warning restore 1573
#pragma warning restore 1591
#pragma warning restore 8073
#pragma warning restore 3016
#pragma warning restore 8603
#pragma warning restore 8603
#pragma warning restore 8604
Loading

0 comments on commit 0321131

Please sign in to comment.