AWS.ServiceDiscovery — AWS SDK for JavaScript (original) (raw)

Property Details

endpointAWS.Endpoint

Returns an Endpoint object representing the endpoint URL for service requests.

Method Details

createHttpNamespace(params = {}, callback) ⇒ AWS.Request

Creates an HTTP namespace. Service instances registered using an HTTP namespace can be discovered using a DiscoverInstances request but can't be discovered using DNS.

For the current quota on the number of namespaces that you can create using the same Amazon Web Services account, see Cloud Map quotas in the Cloud Map Developer Guide.

createPrivateDnsNamespace(params = {}, callback) ⇒ AWS.Request

Creates a private namespace based on DNS, which is visible only inside a specified Amazon VPC. The namespace defines your service naming scheme. For example, if you name your namespace example.com and name your service backend, the resulting DNS name for the service is backend.example.com. Service instances that are registered using a private DNS namespace can be discovered using either a DiscoverInstances request or using DNS. For the current quota on the number of namespaces that you can create using the same Amazon Web Services account, see Cloud Map quotas in the Cloud Map Developer Guide.

createPublicDnsNamespace(params = {}, callback) ⇒ AWS.Request

Creates a public namespace based on DNS, which is visible on the internet. The namespace defines your service naming scheme. For example, if you name your namespace example.com and name your service backend, the resulting DNS name for the service is backend.example.com. You can discover instances that were registered with a public DNS namespace by using either a DiscoverInstances request or using DNS. For the current quota on the number of namespaces that you can create using the same Amazon Web Services account, see Cloud Map quotas in the Cloud Map Developer Guide.

The CreatePublicDnsNamespace API operation is not supported in the Amazon Web Services GovCloud (US) Regions.

createService(params = {}, callback) ⇒ AWS.Request

Creates a service. This action defines the configuration for the following entities:

After you create the service, you can submit a RegisterInstance request, and Cloud Map uses the values in the configuration to create the specified entities.

For the current quota on the number of instances that you can register using the same namespace and using the same service, see Cloud Map quotas in the Cloud Map Developer Guide.

deleteNamespace(params = {}, callback) ⇒ AWS.Request

Deletes a namespace from the current account. If the namespace still contains one or more services, the request fails.

deleteService(params = {}, callback) ⇒ AWS.Request

Deletes a specified service. If the service still contains one or more registered instances, the request fails.

deregisterInstance(params = {}, callback) ⇒ AWS.Request

Deletes the Amazon Route 53 DNS records and health check, if any, that Cloud Map created for the specified instance.

discoverInstances(params = {}, callback) ⇒ AWS.Request

Discovers registered instances for a specified namespace and service. You can use DiscoverInstances to discover instances for any type of namespace. DiscoverInstances returns a randomized list of instances allowing customers to distribute traffic evenly across instances. For public and private DNS namespaces, you can also use DNS queries to discover instances.

````` ```` ### discoverInstancesRevision(params = {}, callback) ⇒ AWS.Request

Discovers the increasing revision associated with an instance.

Service Reference:

Examples:

To discover the revision for a registered instance


/* The following example discovers the revision ID for a registered instance. */

 var params = {
  NamespaceName: "example-namespace", 
  ServiceName: "example-service"
 };
 servicediscovery.discoverInstancesRevision(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    InstancesRevision: 123456
   }
   */
 });

Calling the discoverInstancesRevision operation

var params = {
  NamespaceName: 'STRING_VALUE', /* required */
  ServiceName: 'STRING_VALUE' /* required */
};
servicediscovery.discoverInstancesRevision(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

getInstance(params = {}, callback) ⇒ AWS.Request

Gets information about a specified instance.

Service Reference:

Examples:

GetInstance example


/* This example gets information about a specified instance. */

 var params = {
  InstanceId: "i-abcd1234", 
  ServiceId: "srv-e4anhexample0004"
 };
 servicediscovery.getInstance(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    Instance: {
     Attributes: {
      "AWS_INSTANCE_IPV4": "192.0.2.44", 
      "AWS_INSTANCE_PORT": "80", 
      "color": "green", 
      "region": "us-west-2", 
      "stage": "beta"
     }, 
     Id: "i-abcd1234"
    }
   }
   */
 });

Calling the getInstance operation

var params = {
  InstanceId: 'STRING_VALUE', /* required */
  ServiceId: 'STRING_VALUE' /* required */
};
servicediscovery.getInstance(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

getInstancesHealthStatus(params = {}, callback) ⇒ AWS.Request

Gets the current health status (Healthy, Unhealthy, or Unknown) of one or more instances that are associated with a specified service.

Note: There's a brief delay between when you register an instance and when the health status for the instance is available.

Service Reference:

Examples:

GetInstancesHealthStatus example


/* This example gets the current health status of one or more instances that are associate with a specified service. */

 var params = {
  ServiceId: "srv-e4anhexample0004"
 };
 servicediscovery.getInstancesHealthStatus(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    Status: {
     "i-abcd1234": "HEALTHY", 
     "i-abcd1235": "UNHEALTHY"
    }
   }
   */
 });

Calling the getInstancesHealthStatus operation

var params = {
  ServiceId: 'STRING_VALUE', /* required */
  Instances: [
    'STRING_VALUE',
    /* more items */
  ],
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE'
};
servicediscovery.getInstancesHealthStatus(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

getNamespace(params = {}, callback) ⇒ AWS.Request

Gets information about a namespace.

Service Reference:

Examples:

GetNamespace example


/* This example gets information about a specified namespace. */

 var params = {
  Id: "ns-e4anhexample0004"
 };
 servicediscovery.getNamespace(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    Namespace: {
     Arn: "arn:aws:servicediscovery:us-west-2:123456789012:namespace/ns-e1tpmexample0001", 
     CreateDate: <Date Representation>, 
     CreatorRequestId: "example-creator-request-id-0001", 
     Description: "Example.com AWS Cloud Map HTTP Namespace", 
     Id: "ns-e1tpmexample0001", 
     Name: "example-http.com", 
     Properties: {
      DnsProperties: {
      }, 
      HttpProperties: {
       HttpName: "example-http.com"
      }
     }, 
     Type: "HTTP"
    }
   }
   */
 });

Calling the getNamespace operation

var params = {
  Id: 'STRING_VALUE' /* required */
};
servicediscovery.getNamespace(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

getOperation(params = {}, callback) ⇒ AWS.Request

Gets information about any operation that returns an operation ID in the response, such as a CreateHttpNamespace request.

Note: To get a list of operations that match specified criteria, see ListOperations.

Service Reference:

Examples:

Example: Get operation result


/* Example: Get operation result */

 var params = {
  OperationId: "gv4g5meo7ndmeh4fqskygvk23d2fijwa-k9302yzd"
 };
 servicediscovery.getOperation(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    Operation: {
     CreateDate: <Date Representation>, 
     Id: "gv4g5meo7ndmeh4fqskygvk23d2fijwa-k9302yzd", 
     Status: "SUCCESS", 
     Targets: {
      "NAMESPACE": "ns-ylexjili4cdxy3xm"
     }, 
     Type: "CREATE_NAMESPACE", 
     UpdateDate: <Date Representation>
    }
   }
   */
 });

Calling the getOperation operation

var params = {
  OperationId: 'STRING_VALUE' /* required */
};
servicediscovery.getOperation(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

getService(params = {}, callback) ⇒ AWS.Request

Gets the settings for a specified service.

Service Reference:

Examples:

GetService Example


/* This example gets the settings for a specified service. */

 var params = {
  Id: "srv-e4anhexample0004"
 };
 servicediscovery.getService(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    Service: {
     Arn: "arn:aws:servicediscovery:us-west-2:123456789012:service/srv-e4anhexample0004", 
     CreateDate: <Date Representation>, 
     CreatorRequestId: "example-creator-request-id-0004", 
     Description: "Example.com AWS Cloud Map HTTP Service", 
     HealthCheckConfig: {
      FailureThreshold: 3, 
      ResourcePath: "/", 
      Type: "HTTPS"
     }, 
     Id: "srv-e4anhexample0004", 
     Name: "example-http-service", 
     NamespaceId: "ns-e4anhexample0004"
    }
   }
   */
 });

Calling the getService operation

var params = {
  Id: 'STRING_VALUE' /* required */
};
servicediscovery.getService(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

listInstances(params = {}, callback) ⇒ AWS.Request

Lists summary information about the instances that you registered by using a specified service.

Service Reference:

Examples:

Example: List service instances


/* Example: List service instances */

 var params = {
  ServiceId: "srv-qzpwvt2tfqcegapy"
 };
 servicediscovery.listInstances(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    Instances: [
       {
      Attributes: {
       "AWS_INSTANCE_IPV4": "172.2.1.3", 
       "AWS_INSTANCE_PORT": "808"
      }, 
      Id: "i-06bdabbae60f65a4e"
     }
    ]
   }
   */
 });

Calling the listInstances operation

var params = {
  ServiceId: 'STRING_VALUE', /* required */
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE'
};
servicediscovery.listInstances(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

listNamespaces(params = {}, callback) ⇒ AWS.Request

Lists summary information about the namespaces that were created by the current Amazon Web Services account.

Service Reference:

Examples:

Example: List namespaces


/* Example: List namespaces */

 var params = {
 };
 servicediscovery.listNamespaces(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    Namespaces: [
       {
      Arn: "arn:aws:servicediscovery:us-west-2:123456789012:namespace/ns-a3ccy2e7e3a7rile", 
      CreateDate: <Date Representation>, 
      Id: "ns-a3ccy2e7e3a7rile", 
      Name: "local", 
      Properties: {
       DnsProperties: {
        HostedZoneId: "Z06752353VBUDTC32S84S"
       }, 
       HttpProperties: {
        HttpName: "local"
       }
      }, 
      Type: "DNS_PRIVATE"
     }, 
       {
      Arn: "arn:aws:servicediscovery:us-west-2:123456789012:namespace/ns-pocfyjtrsmwtvcxx", 
      CreateDate: <Date Representation>, 
      Description: "My second namespace", 
      Id: "ns-pocfyjtrsmwtvcxx", 
      Name: "My-second-namespace", 
      Properties: {
       DnsProperties: {
       }, 
       HttpProperties: {
        HttpName: "My-second-namespace"
       }
      }, 
      Type: "HTTP"
     }, 
       {
      Arn: "arn:aws:servicediscovery:us-west-2:123456789012:namespace/ns-ylexjili4cdxy3xm", 
      CreateDate: <Date Representation>, 
      Id: "ns-ylexjili4cdxy3xm", 
      Name: "example.com", 
      Properties: {
       DnsProperties: {
        HostedZoneId: "Z09983722P0QME1B3KC8I"
       }, 
       HttpProperties: {
        HttpName: "example.com"
       }
      }, 
      Type: "DNS_PRIVATE"
     }
    ]
   }
   */
 });

Calling the listNamespaces operation

var params = {
  Filters: [
    {
      Name: TYPE | NAME | HTTP_NAME, /* required */
      Values: [ /* required */
        'STRING_VALUE',
        /* more items */
      ],
      Condition: EQ | IN | BETWEEN | BEGINS_WITH
    },
    /* more items */
  ],
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE'
};
servicediscovery.listNamespaces(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

listOperations(params = {}, callback) ⇒ AWS.Request

Lists operations that match the criteria that you specify.

Service Reference:

Examples:

ListOperations Example


/* This example gets the operations that have a STATUS of either PENDING or SUCCESS. */

 var params = {
  Filters: [
     {
    Condition: "IN", 
    Name: "STATUS", 
    Values: [
       "PENDING", 
       "SUCCESS"
    ]
   }
  ]
 };
 servicediscovery.listOperations(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    Operations: [
       {
      Id: "76yy8ovhpdz0plmjzbsnqgnrqvpv2qdt-kexample", 
      Status: "SUCCESS"
     }, 
       {
      Id: "prysnyzpji3u2ciy45nke83x2zanl7yk-dexample", 
      Status: "SUCCESS"
     }, 
       {
      Id: "ko4ekftir7kzlbechsh7xvcdgcpk66gh-7example", 
      Status: "PENDING"
     }
    ]
   }
   */
 });

Calling the listOperations operation

var params = {
  Filters: [
    {
      Name: NAMESPACE_ID | SERVICE_ID | STATUS | TYPE | UPDATE_DATE, /* required */
      Values: [ /* required */
        'STRING_VALUE',
        /* more items */
      ],
      Condition: EQ | IN | BETWEEN | BEGINS_WITH
    },
    /* more items */
  ],
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE'
};
servicediscovery.listOperations(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

listServices(params = {}, callback) ⇒ AWS.Request

Lists summary information for all the services that are associated with one or more namespaces.

Service Reference:

Examples:

Example: List services


/* Example: List services */

 var params = {
 };
 servicediscovery.listServices(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    Services: [
       {
      Arn: "arn:aws:servicediscovery:us-west-2:123456789012:service/srv-p5zdwlg5uvvzjita", 
      CreateDate: <Date Representation>, 
      DnsConfig: {
       DnsRecords: [
          {
         TTL: 60, 
         Type: "A"
        }
       ], 
       RoutingPolicy: "MULTIVALUE"
      }, 
      Id: "srv-p5zdwlg5uvvzjita", 
      Name: "myservice"
     }
    ]
   }
   */
 });

Calling the listServices operation

var params = {
  Filters: [
    {
      Name: NAMESPACE_ID, /* required */
      Values: [ /* required */
        'STRING_VALUE',
        /* more items */
      ],
      Condition: EQ | IN | BETWEEN | BEGINS_WITH
    },
    /* more items */
  ],
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE'
};
servicediscovery.listServices(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

listTagsForResource(params = {}, callback) ⇒ AWS.Request

Lists tags for the specified resource.

Service Reference:

Examples:

ListTagsForResource example


/* This example lists the tags of a resource. */

 var params = {
  ResourceARN: "arn:aws:servicediscovery:us-east-1:123456789012:namespace/ns-ylexjili4cdxy3xm"
 };
 servicediscovery.listTagsForResource(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    Tags: [
       {
      Key: "Project", 
      Value: "Zeta"
     }, 
       {
      Key: "Department", 
      Value: "Engineering"
     }
    ]
   }
   */
 });

Calling the listTagsForResource operation

var params = {
  ResourceARN: 'STRING_VALUE' /* required */
};
servicediscovery.listTagsForResource(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

registerInstance(params = {}, callback) ⇒ AWS.Request

Creates or updates one or more records and, optionally, creates a health check based on the settings in a specified service. When you submit a RegisterInstance request, the following occurs:

One RegisterInstance request must complete before you can submit another request and specify the same service ID and instance ID.

For more information, see CreateService.

When Cloud Map receives a DNS query for the specified DNS name, it returns the applicable value:

For the current quota on the number of instances that you can register using the same namespace and using the same service, see Cloud Map quotas in the Cloud Map Developer Guide.

Service Reference:

Examples:

Example: Register Instance


/* Example: Register Instance */

 var params = {
  Attributes: {
   "AWS_INSTANCE_IPV4": "172.2.1.3", 
   "AWS_INSTANCE_PORT": "808"
  }, 
  CreatorRequestId: "7a48a98a-72e6-4849-bfa7-1a458e030d7b", 
  InstanceId: "myservice-53", 
  ServiceId: "srv-p5zdwlg5uvvzjita"
 };
 servicediscovery.registerInstance(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    OperationId: "4yejorelbukcjzpnr6tlmrghsjwpngf4-k95yg2u7"
   }
   */
 });

Calling the registerInstance operation

var params = {
  Attributes: { /* required */
    '<AttrKey>': 'STRING_VALUE',
    /* '<AttrKey>': ... */
  },
  InstanceId: 'STRING_VALUE', /* required */
  ServiceId: 'STRING_VALUE', /* required */
  CreatorRequestId: 'STRING_VALUE'
};
servicediscovery.registerInstance(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

tagResource(params = {}, callback) ⇒ AWS.Request

Adds one or more tags to the specified resource.

Service Reference:

Examples:

TagResource example


/* This example adds "Department" and "Project" tags to a resource. */

 var params = {
  ResourceARN: "arn:aws:servicediscovery:us-east-1:123456789012:namespace/ns-ylexjili4cdxy3xm", 
  Tags: [
     {
    Key: "Department", 
    Value: "Engineering"
   }, 
     {
    Key: "Project", 
    Value: "Zeta"
   }
  ]
 };
 servicediscovery.tagResource(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
   }
   */
 });

Calling the tagResource operation

var params = {
  ResourceARN: 'STRING_VALUE', /* required */
  Tags: [ /* required */
    {
      Key: 'STRING_VALUE', /* required */
      Value: 'STRING_VALUE' /* required */
    },
    /* more items */
  ]
};
servicediscovery.tagResource(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

untagResource(params = {}, callback) ⇒ AWS.Request

Removes one or more tags from the specified resource.

Service Reference:

Examples:

UntagResource example


/* This example removes the "Department" and "Project" tags from a resource. */

 var params = {
  ResourceARN: "arn:aws:servicediscovery:us-east-1:123456789012:namespace/ns-ylexjili4cdxy3xm", 
  TagKeys: [
     "Project", 
     "Department"
  ]
 };
 servicediscovery.untagResource(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
   }
   */
 });

Calling the untagResource operation

var params = {
  ResourceARN: 'STRING_VALUE', /* required */
  TagKeys: [ /* required */
    'STRING_VALUE',
    /* more items */
  ]
};
servicediscovery.untagResource(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

updateHttpNamespace(params = {}, callback) ⇒ AWS.Request

Updates an HTTP namespace.

Service Reference:

Examples:

To update a HTTP namespace


/* The following example updates the description of a HTTP namespace. */

 var params = {
  Id: "ns-vh4nbmEXAMPLE", 
  Namespace: {
   Description: "The updated namespace description."
  }
 };
 servicediscovery.updateHttpNamespace(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    OperationId: "ft52xe2koxhoeormaceymagglsdjyvEXAMPLE"
   }
   */
 });

Calling the updateHttpNamespace operation

var params = {
  Id: 'STRING_VALUE', /* required */
  Namespace: { /* required */
    Description: 'STRING_VALUE' /* required */
  },
  UpdaterRequestId: 'STRING_VALUE'
};
servicediscovery.updateHttpNamespace(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

updateInstanceCustomHealthStatus(params = {}, callback) ⇒ AWS.Request

Submits a request to change the health status of a custom health check to healthy or unhealthy.

You can use UpdateInstanceCustomHealthStatus to change the status only for custom health checks, which you define using HealthCheckCustomConfig when you create a service. You can't use it to change the status for Route 53 health checks, which you define using HealthCheckConfig.

For more information, see HealthCheckCustomConfig.

Service Reference:

Examples:

UpdateInstanceCustomHealthStatus Example


/* This example submits a request to change the health status of an instance associated with a service with a custom health check to HEALTHY. */

 var params = {
  InstanceId: "i-abcd1234", 
  ServiceId: "srv-e4anhexample0004", 
  Status: "HEALTHY"
 };
 servicediscovery.updateInstanceCustomHealthStatus(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Calling the updateInstanceCustomHealthStatus operation

var params = {
  InstanceId: 'STRING_VALUE', /* required */
  ServiceId: 'STRING_VALUE', /* required */
  Status: HEALTHY | UNHEALTHY /* required */
};
servicediscovery.updateInstanceCustomHealthStatus(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

updatePrivateDnsNamespace(params = {}, callback) ⇒ AWS.Request

Updates a private DNS namespace.

Service Reference:

Examples:

To update a private DNS namespace


/* The following example updates the description of a private DNS namespace. */

 var params = {
  Id: "ns-bk3aEXAMPLE", 
  Namespace: {
   Description: "The updated namespace description."
  }, 
  UpdaterRequestId: ""
 };
 servicediscovery.updatePrivateDnsNamespace(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    OperationId: "ft52xe2koxhoeormaceymagglsdjyvEXAMPLE"
   }
   */
 });

To update a public DNS namespace


/* The following example updates the description of a public DNS namespace. */

 var params = {
  Id: "ns-bk3aEXAMPLE", 
  Namespace: {
   Description: "The updated namespace description."
  }, 
  UpdaterRequestId: ""
 };
 servicediscovery.updatePrivateDnsNamespace(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    OperationId: "ft52xe2koxhoeormaceymagglsdjEXAMPLE"
   }
   */
 });

Calling the updatePrivateDnsNamespace operation

var params = {
  Id: 'STRING_VALUE', /* required */
  Namespace: { /* required */
    Description: 'STRING_VALUE',
    Properties: {
      DnsProperties: { /* required */
        SOA: { /* required */
          TTL: 'NUMBER_VALUE' /* required */
        }
      }
    }
  },
  UpdaterRequestId: 'STRING_VALUE'
};
servicediscovery.updatePrivateDnsNamespace(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

updatePublicDnsNamespace(params = {}, callback) ⇒ AWS.Request

Updates a public DNS namespace.

Service Reference:

Examples:

Calling the updatePublicDnsNamespace operation

var params = {
  Id: 'STRING_VALUE', /* required */
  Namespace: { /* required */
    Description: 'STRING_VALUE',
    Properties: {
      DnsProperties: { /* required */
        SOA: { /* required */
          TTL: 'NUMBER_VALUE' /* required */
        }
      }
    }
  },
  UpdaterRequestId: 'STRING_VALUE'
};
servicediscovery.updatePublicDnsNamespace(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

updateService(params = {}, callback) ⇒ AWS.Request

Submits a request to perform the following operations:

For public and private DNS namespaces, note the following:

When you update settings for a service, Cloud Map also updates the corresponding settings in all the records and health checks that were created by using the specified service.

Service Reference:

Examples:

UpdateService Example


/* This example submits a request to replace the DnsConfig and HealthCheckConfig settings of a specified service. */

 var params = {
  Id: "srv-e4anhexample0004", 
  Service: {
   DnsConfig: {
    DnsRecords: [
       {
      TTL: 60, 
      Type: "A"
     }
    ]
   }, 
   HealthCheckConfig: {
    FailureThreshold: 2, 
    ResourcePath: "/", 
    Type: "HTTP"
   }
  }
 };
 servicediscovery.updateService(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    OperationId: "m35hsdrkxwjffm3xef4bxyy6vc3ewakx-jdn3y5g5"
   }
   */
 });

Calling the updateService operation

var params = {
  Id: 'STRING_VALUE', /* required */
  Service: { /* required */
    Description: 'STRING_VALUE',
    DnsConfig: {
      DnsRecords: [ /* required */
        {
          TTL: 'NUMBER_VALUE', /* required */
          Type: SRV | A | AAAA | CNAME /* required */
        },
        /* more items */
      ]
    },
    HealthCheckConfig: {
      Type: HTTP | HTTPS | TCP, /* required */
      FailureThreshold: 'NUMBER_VALUE',
      ResourcePath: 'STRING_VALUE'
    }
  }
};
servicediscovery.updateService(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

```` `````