Skip to content

Commit cee660c

Browse files
author
awstools
committed
feat(client-servicediscovery): Updated the ListNamespaces API to support the NAME and HTTP_NAME filters, and the BEGINS_WITH filter condition.
1 parent 976549d commit cee660c

37 files changed

+2943
-1464
lines changed

clients/client-servicediscovery/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ AWS SDK for JavaScript ServiceDiscovery Client for Node.js, Browser and React Na
1111

1212
<fullname>Cloud Map</fullname>
1313

14-
<p>With Cloud Map, you can configure public DNS, private DNS, or HTTP namespaces that your microservice
15-
applications run in. When an instance becomes available, you can call the Cloud Map API to register the instance
16-
with Cloud Map. For public or private DNS namespaces, Cloud Map automatically creates DNS records and an optional
17-
health check. Clients that submit public or private DNS queries, or HTTP requests, for the service receive an answer
18-
that contains up to eight healthy records. </p>
14+
<p>With Cloud Map, you can configure public DNS, private DNS, or HTTP namespaces that your
15+
microservice applications run in. When an instance becomes available, you can call the Cloud Map
16+
API to register the instance with Cloud Map. For public or private DNS namespaces, Cloud Map
17+
automatically creates DNS records and an optional health check. Clients that submit public or
18+
private DNS queries, or HTTP requests, for the service receive an answer that contains up to
19+
eight healthy records. </p>
1920

2021
## Installing
2122

clients/client-servicediscovery/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"@aws-sdk/hash-node": "*",
2727
"@aws-sdk/invalid-dependency": "*",
2828
"@aws-sdk/middleware-content-length": "*",
29+
"@aws-sdk/middleware-endpoint": "*",
2930
"@aws-sdk/middleware-host-header": "*",
3031
"@aws-sdk/middleware-logger": "*",
3132
"@aws-sdk/middleware-recursion-detection": "*",

clients/client-servicediscovery/src/ServiceDiscovery.ts

Lines changed: 90 additions & 71 deletions
Large diffs are not rendered by default.

clients/client-servicediscovery/src/ServiceDiscoveryClient.ts

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
// smithy-typescript generated code
2-
import {
3-
EndpointsInputConfig,
4-
EndpointsResolvedConfig,
5-
RegionInputConfig,
6-
RegionResolvedConfig,
7-
resolveEndpointsConfig,
8-
resolveRegionConfig,
9-
} from "@aws-sdk/config-resolver";
2+
import { RegionInputConfig, RegionResolvedConfig, resolveRegionConfig } from "@aws-sdk/config-resolver";
103
import { getContentLengthPlugin } from "@aws-sdk/middleware-content-length";
4+
import { EndpointInputConfig, EndpointResolvedConfig, resolveEndpointConfig } from "@aws-sdk/middleware-endpoint";
115
import {
126
getHostHeaderPlugin,
137
HostHeaderInputConfig,
@@ -41,13 +35,13 @@ import {
4135
Credentials as __Credentials,
4236
Decoder as __Decoder,
4337
Encoder as __Encoder,
38+
EndpointV2 as __EndpointV2,
4439
Hash as __Hash,
4540
HashConstructor as __HashConstructor,
4641
HttpHandlerOptions as __HttpHandlerOptions,
4742
Logger as __Logger,
4843
Provider as __Provider,
4944
Provider,
50-
RegionInfoProvider,
5145
StreamCollector as __StreamCollector,
5246
UrlParser as __UrlParser,
5347
UserAgent as __UserAgent,
@@ -106,6 +100,12 @@ import {
106100
UpdatePublicDnsNamespaceCommandOutput,
107101
} from "./commands/UpdatePublicDnsNamespaceCommand";
108102
import { UpdateServiceCommandInput, UpdateServiceCommandOutput } from "./commands/UpdateServiceCommand";
103+
import {
104+
ClientInputEndpointParameters,
105+
ClientResolvedEndpointParameters,
106+
EndpointParameters,
107+
resolveClientEndpointParameters,
108+
} from "./endpoint/EndpointParameters";
109109
import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
110110

111111
export type ServiceInputTypes =
@@ -273,12 +273,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__
273273
*/
274274
credentialDefaultProvider?: (input: any) => __Provider<__Credentials>;
275275

276-
/**
277-
* Fetch related hostname, signing name or signing region with given region.
278-
* @internal
279-
*/
280-
regionInfoProvider?: RegionInfoProvider;
281-
282276
/**
283277
* The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header
284278
* @internal
@@ -294,11 +288,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__
294288
type ServiceDiscoveryClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> &
295289
ClientDefaults &
296290
RegionInputConfig &
297-
EndpointsInputConfig &
291+
EndpointInputConfig<EndpointParameters> &
298292
RetryInputConfig &
299293
HostHeaderInputConfig &
300294
AwsAuthInputConfig &
301-
UserAgentInputConfig;
295+
UserAgentInputConfig &
296+
ClientInputEndpointParameters;
302297
/**
303298
* The configuration interface of ServiceDiscoveryClient class constructor that set the region, credentials and other options.
304299
*/
@@ -307,23 +302,25 @@ export interface ServiceDiscoveryClientConfig extends ServiceDiscoveryClientConf
307302
type ServiceDiscoveryClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> &
308303
Required<ClientDefaults> &
309304
RegionResolvedConfig &
310-
EndpointsResolvedConfig &
305+
EndpointResolvedConfig<EndpointParameters> &
311306
RetryResolvedConfig &
312307
HostHeaderResolvedConfig &
313308
AwsAuthResolvedConfig &
314-
UserAgentResolvedConfig;
309+
UserAgentResolvedConfig &
310+
ClientResolvedEndpointParameters;
315311
/**
316312
* The resolved configuration interface of ServiceDiscoveryClient class. This is resolved and normalized from the {@link ServiceDiscoveryClientConfig | constructor configuration interface}.
317313
*/
318314
export interface ServiceDiscoveryClientResolvedConfig extends ServiceDiscoveryClientResolvedConfigType {}
319315

320316
/**
321317
* <fullname>Cloud Map</fullname>
322-
* <p>With Cloud Map, you can configure public DNS, private DNS, or HTTP namespaces that your microservice
323-
* applications run in. When an instance becomes available, you can call the Cloud Map API to register the instance
324-
* with Cloud Map. For public or private DNS namespaces, Cloud Map automatically creates DNS records and an optional
325-
* health check. Clients that submit public or private DNS queries, or HTTP requests, for the service receive an answer
326-
* that contains up to eight healthy records. </p>
318+
* <p>With Cloud Map, you can configure public DNS, private DNS, or HTTP namespaces that your
319+
* microservice applications run in. When an instance becomes available, you can call the Cloud Map
320+
* API to register the instance with Cloud Map. For public or private DNS namespaces, Cloud Map
321+
* automatically creates DNS records and an optional health check. Clients that submit public or
322+
* private DNS queries, or HTTP requests, for the service receive an answer that contains up to
323+
* eight healthy records. </p>
327324
*/
328325
export class ServiceDiscoveryClient extends __Client<
329326
__HttpHandlerOptions,
@@ -338,14 +335,15 @@ export class ServiceDiscoveryClient extends __Client<
338335

339336
constructor(configuration: ServiceDiscoveryClientConfig) {
340337
const _config_0 = __getRuntimeConfig(configuration);
341-
const _config_1 = resolveRegionConfig(_config_0);
342-
const _config_2 = resolveEndpointsConfig(_config_1);
343-
const _config_3 = resolveRetryConfig(_config_2);
344-
const _config_4 = resolveHostHeaderConfig(_config_3);
345-
const _config_5 = resolveAwsAuthConfig(_config_4);
346-
const _config_6 = resolveUserAgentConfig(_config_5);
347-
super(_config_6);
348-
this.config = _config_6;
338+
const _config_1 = resolveClientEndpointParameters(_config_0);
339+
const _config_2 = resolveRegionConfig(_config_1);
340+
const _config_3 = resolveEndpointConfig(_config_2);
341+
const _config_4 = resolveRetryConfig(_config_3);
342+
const _config_5 = resolveHostHeaderConfig(_config_4);
343+
const _config_6 = resolveAwsAuthConfig(_config_5);
344+
const _config_7 = resolveUserAgentConfig(_config_6);
345+
super(_config_7);
346+
this.config = _config_7;
349347
this.middlewareStack.use(getRetryPlugin(this.config));
350348
this.middlewareStack.use(getContentLengthPlugin(this.config));
351349
this.middlewareStack.use(getHostHeaderPlugin(this.config));

clients/client-servicediscovery/src/commands/CreateHttpNamespaceCommand.ts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// smithy-typescript generated code
2+
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
23
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
34
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
45
import { Command as $Command } from "@aws-sdk/smithy-client";
@@ -28,10 +29,10 @@ export interface CreateHttpNamespaceCommandInput extends CreateHttpNamespaceRequ
2829
export interface CreateHttpNamespaceCommandOutput extends CreateHttpNamespaceResponse, __MetadataBearer {}
2930

3031
/**
31-
* <p>Creates an HTTP namespace. Service instances registered using an HTTP namespace can be discovered using a
32-
* <code>DiscoverInstances</code> request but can't be discovered using DNS.</p>
33-
* <p>For the current quota on the number of namespaces that you can create using the same account,
34-
* see <a href="https://docs.aws.amazon.com/cloud-map/latest/dg/cloud-map-limits.html">Cloud Map quotas</a> in the
32+
* <p>Creates an HTTP namespace. Service instances registered using an HTTP namespace can be
33+
* discovered using a <code>DiscoverInstances</code> request but can't be discovered using
34+
* DNS.</p>
35+
* <p>For the current quota on the number of namespaces that you can create using the same Amazon Web Services account, see <a href="https://docs.aws.amazon.com/cloud-map/latest/dg/cloud-map-limits.html">Cloud Map quotas</a> in the
3536
* <i>Cloud Map Developer Guide</i>.</p>
3637
* @example
3738
* Use a bare-bones client and the command you need to make an API call.
@@ -56,6 +57,15 @@ export class CreateHttpNamespaceCommand extends $Command<
5657
// Start section: command_properties
5758
// End section: command_properties
5859

60+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
61+
return {
62+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
63+
Endpoint: { type: "builtInParams", name: "Endpoint" },
64+
Region: { type: "builtInParams", name: "region" },
65+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
66+
};
67+
}
68+
5969
constructor(readonly input: CreateHttpNamespaceCommandInput) {
6070
// Start section: command_constructor
6171
super();
@@ -71,6 +81,9 @@ export class CreateHttpNamespaceCommand extends $Command<
7181
options?: __HttpHandlerOptions
7282
): Handler<CreateHttpNamespaceCommandInput, CreateHttpNamespaceCommandOutput> {
7383
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
84+
this.middlewareStack.use(
85+
getEndpointPlugin(configuration, CreateHttpNamespaceCommand.getEndpointParameterInstructions())
86+
);
7487

7588
const stack = clientStack.concat(this.middlewareStack);
7689

clients/client-servicediscovery/src/commands/CreatePrivateDnsNamespaceCommand.ts

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// smithy-typescript generated code
2+
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
23
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
34
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
45
import { Command as $Command } from "@aws-sdk/smithy-client";
@@ -28,12 +29,13 @@ export interface CreatePrivateDnsNamespaceCommandInput extends CreatePrivateDnsN
2829
export interface CreatePrivateDnsNamespaceCommandOutput extends CreatePrivateDnsNamespaceResponse, __MetadataBearer {}
2930

3031
/**
31-
* <p>Creates a private namespace based on DNS, which is visible only inside a specified Amazon VPC. The namespace
32-
* defines your service naming scheme. For example, if you name your namespace <code>example.com</code> and name your
33-
* service <code>backend</code>, the resulting DNS name for the service is <code>backend.example.com</code>. Service
34-
* instances that are registered using a private DNS namespace can be discovered using either a
35-
* <code>DiscoverInstances</code> request or using DNS. For the current quota on the number of namespaces that you can
36-
* create using the same account, see <a href="https://docs.aws.amazon.com/cloud-map/latest/dg/cloud-map-limits.html">Cloud Map quotas</a> in the
32+
* <p>Creates a private namespace based on DNS, which is visible only inside a specified Amazon
33+
* VPC. The namespace defines your service naming scheme. For example, if you name your namespace
34+
* <code>example.com</code> and name your service <code>backend</code>, the resulting DNS name for
35+
* the service is <code>backend.example.com</code>. Service instances that are registered using a
36+
* private DNS namespace can be discovered using either a <code>DiscoverInstances</code> request or
37+
* using DNS. For the current quota on the number of namespaces that you can create using the same
38+
* Amazon Web Services account, see <a href="https://docs.aws.amazon.com/cloud-map/latest/dg/cloud-map-limits.html">Cloud Map quotas</a> in the
3739
* <i>Cloud Map Developer Guide</i>.</p>
3840
* @example
3941
* Use a bare-bones client and the command you need to make an API call.
@@ -58,6 +60,15 @@ export class CreatePrivateDnsNamespaceCommand extends $Command<
5860
// Start section: command_properties
5961
// End section: command_properties
6062

63+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
64+
return {
65+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
66+
Endpoint: { type: "builtInParams", name: "Endpoint" },
67+
Region: { type: "builtInParams", name: "region" },
68+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
69+
};
70+
}
71+
6172
constructor(readonly input: CreatePrivateDnsNamespaceCommandInput) {
6273
// Start section: command_constructor
6374
super();
@@ -73,6 +84,9 @@ export class CreatePrivateDnsNamespaceCommand extends $Command<
7384
options?: __HttpHandlerOptions
7485
): Handler<CreatePrivateDnsNamespaceCommandInput, CreatePrivateDnsNamespaceCommandOutput> {
7586
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
87+
this.middlewareStack.use(
88+
getEndpointPlugin(configuration, CreatePrivateDnsNamespaceCommand.getEndpointParameterInstructions())
89+
);
7690

7791
const stack = clientStack.concat(this.middlewareStack);
7892

clients/client-servicediscovery/src/commands/CreatePublicDnsNamespaceCommand.ts

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// smithy-typescript generated code
2+
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
23
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
34
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
45
import { Command as $Command } from "@aws-sdk/smithy-client";
@@ -28,12 +29,17 @@ export interface CreatePublicDnsNamespaceCommandInput extends CreatePublicDnsNam
2829
export interface CreatePublicDnsNamespaceCommandOutput extends CreatePublicDnsNamespaceResponse, __MetadataBearer {}
2930

3031
/**
31-
* <p>Creates a public namespace based on DNS, which is visible on the internet. The namespace defines your service
32-
* naming scheme. For example, if you name your namespace <code>example.com</code> and name your service
33-
* <code>backend</code>, the resulting DNS name for the service is <code>backend.example.com</code>. You can discover
34-
* instances that were registered with a public DNS namespace by using either a <code>DiscoverInstances</code> request
35-
* or using DNS. For the current quota on the number of namespaces that you can create using the same account, see <a href="https://docs.aws.amazon.com/cloud-map/latest/dg/cloud-map-limits.html">Cloud Map
36-
* quotas</a> in the <i>Cloud Map Developer Guide</i>.</p>
32+
* <p>Creates a public namespace based on DNS, which is visible on the internet. The namespace
33+
* defines your service naming scheme. For example, if you name your namespace
34+
* <code>example.com</code> and name your service <code>backend</code>, the resulting DNS name for
35+
* the service is <code>backend.example.com</code>. You can discover instances that were registered
36+
* with a public DNS namespace by using either a <code>DiscoverInstances</code> request or using
37+
* DNS. For the current quota on the number of namespaces that you can create using the same Amazon Web Services account, see <a href="https://docs.aws.amazon.com/cloud-map/latest/dg/cloud-map-limits.html">Cloud Map quotas</a> in the
38+
* <i>Cloud Map Developer Guide</i>.</p>
39+
*
40+
* <important>
41+
* <p>The <code>CreatePublicDnsNamespace</code> API operation is not supported in the Amazon Web Services GovCloud (US) Regions.</p>
42+
* </important>
3743
* @example
3844
* Use a bare-bones client and the command you need to make an API call.
3945
* ```javascript
@@ -57,6 +63,15 @@ export class CreatePublicDnsNamespaceCommand extends $Command<
5763
// Start section: command_properties
5864
// End section: command_properties
5965

66+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
67+
return {
68+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
69+
Endpoint: { type: "builtInParams", name: "Endpoint" },
70+
Region: { type: "builtInParams", name: "region" },
71+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
72+
};
73+
}
74+
6075
constructor(readonly input: CreatePublicDnsNamespaceCommandInput) {
6176
// Start section: command_constructor
6277
super();
@@ -72,6 +87,9 @@ export class CreatePublicDnsNamespaceCommand extends $Command<
7287
options?: __HttpHandlerOptions
7388
): Handler<CreatePublicDnsNamespaceCommandInput, CreatePublicDnsNamespaceCommandOutput> {
7489
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
90+
this.middlewareStack.use(
91+
getEndpointPlugin(configuration, CreatePublicDnsNamespaceCommand.getEndpointParameterInstructions())
92+
);
7593

7694
const stack = clientStack.concat(this.middlewareStack);
7795

0 commit comments

Comments
 (0)