Skip to content

Commit

Permalink
feat(client-drs): New fields were added to reflect availability zone …
Browse files Browse the repository at this point in the history
…data in source server and recovery instance description commands responses, as well as source server launch status.
  • Loading branch information
awstools committed Feb 27, 2023
1 parent 287cd60 commit 3b2a484
Show file tree
Hide file tree
Showing 4 changed files with 478 additions and 1,057 deletions.
35 changes: 18 additions & 17 deletions clients/client-drs/src/endpoint/ruleset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,25 @@ import { RuleSetObject } from "@aws-sdk/util-endpoints";
or see "smithy.rules#endpointRuleSet"
in codegen/sdk-codegen/aws-models/drs.json */

const p="required",
q="fn",
r="argv",
s="ref";
const a="PartitionResult",
const q="required",
r="fn",
s="argv",
t="ref";
const a="isSet",
b="tree",
c="error",
d="endpoint",
e={[p]:false,"type":"String"},
f={[p]:true,"default":false,"type":"Boolean"},
g={[s]:"Endpoint"},
h={[q]:"booleanEquals",[r]:[{[s]:"UseFIPS"},true]},
i={[q]:"booleanEquals",[r]:[{[s]:"UseDualStack"},true]},
j={},
k={[q]:"booleanEquals",[r]:[true,{[q]:"getAttr",[r]:[{[s]:a},"supportsFIPS"]}]},
l={[q]:"booleanEquals",[r]:[true,{[q]:"getAttr",[r]:[{[s]:a},"supportsDualStack"]}]},
m=[g],
n=[h],
o=[i];
const _data={version:"1.0",parameters:{Region:e,UseDualStack:f,UseFIPS:f,Endpoint:e},rules:[{conditions:[{[q]:"aws.partition",[r]:[{[s]:"Region"}],assign:a}],type:b,rules:[{conditions:[{[q]:"isSet",[r]:m},{[q]:"parseURL",[r]:m,assign:"url"}],type:b,rules:[{conditions:n,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:c},{type:b,rules:[{conditions:o,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:c},{endpoint:{url:g,properties:j,headers:j},type:d}]}]},{conditions:[h,i],type:b,rules:[{conditions:[k,l],type:b,rules:[{endpoint:{url:"https://drs-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:j,headers:j},type:d}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:c}]},{conditions:n,type:b,rules:[{conditions:[k],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://drs-fips.{Region}.{PartitionResult#dnsSuffix}",properties:j,headers:j},type:d}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:c}]},{conditions:o,type:b,rules:[{conditions:[l],type:b,rules:[{endpoint:{url:"https://drs.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:j,headers:j},type:d}]},{error:"DualStack is enabled but this partition does not support DualStack",type:c}]},{endpoint:{url:"https://drs.{Region}.{PartitionResult#dnsSuffix}",properties:j,headers:j},type:d}]}]};
e="PartitionResult",
f={[q]:false,"type":"String"},
g={[q]:true,"default":false,"type":"Boolean"},
h={[t]:"Endpoint"},
i={[r]:"booleanEquals",[s]:[{[t]:"UseFIPS"},true]},
j={[r]:"booleanEquals",[s]:[{[t]:"UseDualStack"},true]},
k={},
l={[r]:"booleanEquals",[s]:[true,{[r]:"getAttr",[s]:[{[t]:e},"supportsFIPS"]}]},
m={[r]:"booleanEquals",[s]:[true,{[r]:"getAttr",[s]:[{[t]:e},"supportsDualStack"]}]},
n=[i],
o=[j],
p=[{[t]:"Region"}];
const _data={version:"1.0",parameters:{Region:f,UseDualStack:g,UseFIPS:g,Endpoint:f},rules:[{conditions:[{[r]:a,[s]:[h]}],type:b,rules:[{conditions:n,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:c},{type:b,rules:[{conditions:o,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:c},{endpoint:{url:h,properties:k,headers:k},type:d}]}]},{type:b,rules:[{conditions:[{[r]:a,[s]:p}],type:b,rules:[{conditions:[{[r]:"aws.partition",[s]:p,assign:e}],type:b,rules:[{conditions:[i,j],type:b,rules:[{conditions:[l,m],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://drs-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:k,headers:k},type:d}]}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:c}]},{conditions:n,type:b,rules:[{conditions:[l],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://drs-fips.{Region}.{PartitionResult#dnsSuffix}",properties:k,headers:k},type:d}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:c}]},{conditions:o,type:b,rules:[{conditions:[m],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://drs.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:k,headers:k},type:d}]}]},{error:"DualStack is enabled but this partition does not support DualStack",type:c}]},{type:b,rules:[{endpoint:{url:"https://drs.{Region}.{PartitionResult#dnsSuffix}",properties:k,headers:k},type:d}]}]}]},{error:"Invalid Configuration: Missing Region",type:c}]}]};
export const ruleSet: RuleSetObject = _data;
40 changes: 30 additions & 10 deletions clients/client-drs/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,11 @@ export interface DataReplicationInfo {
* <p>Error in data replication.</p>
*/
dataReplicationError?: DataReplicationError;

/**
* <p>AWS Availability zone into which data is being replicated.</p>
*/
stagingAvailabilityZone?: string;
}

export enum LastLaunchResult {
Expand Down Expand Up @@ -323,6 +328,14 @@ export interface LifeCycleLastLaunchInitiated {
type?: LastLaunchType | string;
}

export enum LaunchStatus {
FAILED = "FAILED",
IN_PROGRESS = "IN_PROGRESS",
LAUNCHED = "LAUNCHED",
PENDING = "PENDING",
TERMINATED = "TERMINATED",
}

/**
* <p>An object containing information regarding the last launch of a Source Server.</p>
*/
Expand All @@ -331,6 +344,11 @@ export interface LifeCycleLastLaunch {
* <p>An object containing information regarding the initiation of the last launch of a Source Server.</p>
*/
initiated?: LifeCycleLastLaunchInitiated;

/**
* <p>Status of Source Server's last launch.</p>
*/
status?: LaunchStatus | string;
}

/**
Expand Down Expand Up @@ -1208,14 +1226,6 @@ export enum InitiatedBy {
TERMINATE_RECOVERY_INSTANCES = "TERMINATE_RECOVERY_INSTANCES",
}

export enum LaunchStatus {
FAILED = "FAILED",
IN_PROGRESS = "IN_PROGRESS",
LAUNCHED = "LAUNCHED",
PENDING = "PENDING",
TERMINATED = "TERMINATED",
}

/**
* <p>Represents a server participating in an asynchronous Job.</p>
*/
Expand Down Expand Up @@ -1518,6 +1528,11 @@ export interface RecoveryInstanceDataReplicationInfo {
* <p>Information about Data Replication</p>
*/
dataReplicationError?: RecoveryInstanceDataReplicationError;

/**
* <p>AWS Availability zone into which data is being replicated.</p>
*/
stagingAvailabilityZone?: string;
}

export enum EC2InstanceState {
Expand Down Expand Up @@ -1730,9 +1745,14 @@ export interface RecoveryInstance {
isDrill?: boolean;

/**
* <p>Environment (On Premises / AWS) of the instance that the recovery instance originated from. </p>
* <p>Environment (On Premises / AWS) of the instance that the recovery instance originated from.</p>
*/
originEnvironment?: OriginEnvironment | string;

/**
* <p>AWS availability zone associated with the recovery instance.</p>
*/
originAvailabilityZone?: string;
}

export interface DescribeRecoveryInstancesResponse {
Expand Down Expand Up @@ -2317,7 +2337,7 @@ export interface ReplicationConfigurationReplicatedDisk {
throughput?: number;

/**
* <p>When <code>stagingDiskType</code> is set to Auto, this field shows the current staging disk EBS volume type as it is constantly updated by the service. This is a read-only field.</p>
* <p>The Staging Disk EBS volume type to be used during replication when <code>stagingDiskType</code> is set to Auto. This is a read-only field.</p>
*/
optimizedStagingDiskType?: ReplicationConfigurationReplicatedDiskStagingDiskType | string;
}
Expand Down
4 changes: 4 additions & 0 deletions clients/client-drs/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3850,6 +3850,7 @@ const deserializeAws_restJson1DataReplicationInfo = (output: any, context: __Ser
output.replicatedDisks != null
? deserializeAws_restJson1DataReplicationInfoReplicatedDisks(output.replicatedDisks, context)
: undefined,
stagingAvailabilityZone: __expectString(output.stagingAvailabilityZone),
} as any;
};

Expand Down Expand Up @@ -4071,6 +4072,7 @@ const deserializeAws_restJson1LifeCycleLastLaunch = (output: any, context: __Ser
output.initiated != null
? deserializeAws_restJson1LifeCycleLastLaunchInitiated(output.initiated, context)
: undefined,
status: __expectString(output.status),
} as any;
};

Expand Down Expand Up @@ -4166,6 +4168,7 @@ const deserializeAws_restJson1RecoveryInstance = (output: any, context: __SerdeC
output.failback != null ? deserializeAws_restJson1RecoveryInstanceFailback(output.failback, context) : undefined,
isDrill: __expectBoolean(output.isDrill),
jobID: __expectString(output.jobID),
originAvailabilityZone: __expectString(output.originAvailabilityZone),
originEnvironment: __expectString(output.originEnvironment),
pointInTimeSnapshotDateTime: __expectString(output.pointInTimeSnapshotDateTime),
recoveryInstanceID: __expectString(output.recoveryInstanceID),
Expand Down Expand Up @@ -4208,6 +4211,7 @@ const deserializeAws_restJson1RecoveryInstanceDataReplicationInfo = (
output.replicatedDisks != null
? deserializeAws_restJson1RecoveryInstanceDataReplicationInfoReplicatedDisks(output.replicatedDisks, context)
: undefined,
stagingAvailabilityZone: __expectString(output.stagingAvailabilityZone),
} as any;
};

Expand Down
Loading

0 comments on commit 3b2a484

Please sign in to comment.