You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For more information, see `Creating services <https://docs.aws.amazon.com/cloud-map/latest/dg/creating-services.html>`__ in the *AWS Cloud Map Developer Guide*.
36
+
For more information, see `Creating an AWS Cloud Map service for an application component <https://docs.aws.amazon.com/cloud-map/latest/dg/creating-services.html>`__ in the *AWS Cloud Map Developer Guide*.
37
+
38
+
**Example 2: To create a service using namespace ARN**
39
+
40
+
The following ``create-service`` example creates a service using a namespace ARN instead of namespace ID. Specifying a namespace ARN is necessary when creating a service in a shared namespace. ::
For more information, see `Shared AWS Cloud Map namespaces <https://docs.aws.amazon.com/cloud-map/latest/dg/sharing-namespaces.html>`__ in the *AWS Cloud Map Developer Guide*.
To confirm that the operation succeeded, you can run ``get-operation``. For more information, see `get-operation <https://docs.aws.amazon.com/cli/latest/reference/servicediscovery/get-operation.html>`__ .
15
15
16
-
For more information, see `Deleting namespaces<https://docs.aws.amazon.com/cloud-map/latest/dg/deleting-namespaces.html>`__ in the *AWS Cloud Map Developer Guide*.
16
+
For more information, see `Deleting an AWS Cloud Map namespace<https://docs.aws.amazon.com/cloud-map/latest/dg/deleting-namespaces.html>`__ in the *AWS Cloud Map Developer Guide*.
17
17
18
+
**Example 2: To delete a namespace using namespace ARN**
19
+
20
+
The following ``delete-namespace`` example deletes a namespace using its ARN. ::
For more information, see `Deleting an AWS Cloud Map namespace <https://docs.aws.amazon.com/cloud-map/latest/dg/deleting-namespaces.html>`__ in the *AWS Cloud Map Developer Guide*.
The following ``delete-service-attributes`` example deletes a service attribute with the key ``Port`` that is associated with the specified service. ::
4
4
5
5
aws servicediscovery delete-service-attributes \
6
-
--service-id srv-e4anhexample0004 \
6
+
--service-id srv-abcd1234xmpl5678 \
7
7
--attributes Port
8
8
9
9
This command produces no output.
10
10
11
-
For more information, see `Deleting namespaces <https://docs.aws.amazon.com/cloud-map/latest/dg/deleting-namespaces.html>`__ in the *AWS Cloud Map Developer Guide*.
11
+
For more information, see `AWS Cloud Map services <https://docs.aws.amazon.com/cloud-map/latest/dg/working-with-services.html>`__ in the *AWS Cloud Map Developer Guide*.
12
+
13
+
**Example 2: To delete a service attribute using ARN**
14
+
15
+
The following ``delete-service-attributes`` example deletes a service attribute using the service ARN. Specifying the ARN is necessary for deleting attributes associated with services created in namespaces shared with your account. ::
For more information, see `AWS Cloud Map services <https://docs.aws.amazon.com/cloud-map/latest/dg/working-with-services.html>`__ and `Shared AWS Cloud Map namespaces <https://docs.aws.amazon.com/cloud-map/latest/dg/sharing-namespaces.html>`__ in the *AWS Cloud Map Developer Guide*.
The following ``delete-service`` example deletes a service. ::
4
4
5
5
aws servicediscovery delete-service \
6
-
--id srv-p5zdwlg5uvvzjita
6
+
--id srv-abcd1234xmpl5678
7
7
8
8
This command produces no output.
9
9
10
-
For more information, see `Deleting services<https://docs.aws.amazon.com/cloud-map/latest/dg/deleting-services.html>`__ in the *AWS Cloud Map Developer Guide*.
10
+
For more information, see `Deleting an AWS Cloud Map service<https://docs.aws.amazon.com/cloud-map/latest/dg/deleting-services.html>`__ in the *AWS Cloud Map Developer Guide*.
11
11
12
+
**Example 2: To delete a service using ARN**
13
+
14
+
The following ``delete-service`` example deletes a service using its ARN. ::
For more information, see `Deleting an AWS Cloud Map service <https://docs.aws.amazon.com/cloud-map/latest/dg/deleting-services.html>`__ in the *AWS Cloud Map Developer Guide*.
To confirm that the operation succeeded, you can run ``get-operation``. For more information, see `get-operation <https://docs.aws.amazon.com/cli/latest/reference/servicediscovery/get-operation.html>`__.
15
+
To confirm that the operation succeeded, you can run ``get-operation``. For more information, see `get-operation <https://docs.aws.amazon.com/cli/latest/reference/servicediscovery/get-operation.html>`__.
16
16
17
17
For more information, see `Deregistering service instances <https://docs.aws.amazon.com/cloud-map/latest/dg/deregistering-instances.html>`__ in the *AWS Cloud Map Developer Guide*.
18
18
19
+
**Example 2: To deregister a service instance using service ARN for shared namespaces**
20
+
21
+
The following ``deregister-instance`` example deregisters a service instance using a service ARN instead of service ID. Specifying an ARN is required when deregistering instances from services created in namespaces that are shared with your account. ::
For more information, see `Shared AWS Cloud Map namespaces <https://docs.aws.amazon.com/cloud-map/latest/dg/sharing-namespaces.html>`__ and `Deregistering an AWS Cloud Map service instance <https://docs.aws.amazon.com/cloud-map/latest/dg/deregistering-instances.html>`__ in the *AWS Cloud Map Developer Guide*.
Copy file name to clipboardExpand all lines: awscli/examples/servicediscovery/discover-instances-revision.rst
+18-1Lines changed: 18 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
**To discover the revision of an instance**
1
+
**Example 1: To discover the revision of an instance**
2
2
3
3
The following ``discover-instances-revision`` example discovers the increasing revision of an instance. ::
4
4
@@ -13,3 +13,20 @@ Output::
13
13
}
14
14
15
15
For more information, see `AWS Cloud Map service instances <https://docs.aws.amazon.com/cloud-map/latest/dg/working-with-instances.html>`__ in the *AWS Cloud Map Developer Guide*.
16
+
17
+
**Example 2: To discover the revision of instances from a specific owner account**
18
+
19
+
The following ``discover-instances-revision`` example discovers the revision of instances from a specific owner account. The owner-account parameter is necessary for instances in namespaces that are shared with your account. ::
For more information, see `Shared AWS Cloud Map namespaces <https://docs.aws.amazon.com/cloud-map/latest/dg/sharing-namespaces.html>`__ and `AWS Cloud Map service instances <https://docs.aws.amazon.com/cloud-map/latest/dg/working-with-instances.html>`__ in the *AWS Cloud Map Developer Guide*.
Copy file name to clipboardExpand all lines: awscli/examples/servicediscovery/discover-instances.rst
+32-2Lines changed: 32 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
**To discover registered instances**
1
+
**Example 1: To discover registered instances**
2
2
3
3
The following ``discover-instances`` example discovers registered instances. ::
4
4
@@ -22,7 +22,37 @@ Output::
22
22
"AWS_INSTANCE_PORT": "808"
23
23
}
24
24
}
25
-
]
25
+
],
26
+
"InstancesRevision": 85648075627387284
26
27
}
27
28
28
29
For more information, see `AWS Cloud Map service instances <https://docs.aws.amazon.com/cloud-map/latest/dg/working-with-instances.html>`__ in the *AWS Cloud Map Developer Guide*.
30
+
31
+
**Example 2: To discover instances from a specific owner account**
32
+
33
+
The following ``discover-instances`` example discovers registered instances from a specific owner account. This parameter is necessary to discover instances in namespaces that are shared with your account. ::
34
+
35
+
aws servicediscovery discover-instances \
36
+
--namespace-name shared-namespace \
37
+
--service-name shared-service \
38
+
--owner-account 123456789111
39
+
40
+
Output::
41
+
42
+
{
43
+
"Instances": [
44
+
{
45
+
"InstanceId": "shared-instance-1234",
46
+
"NamespaceName": "shared-namespace",
47
+
"ServiceName": "shared-service",
48
+
"HealthStatus": "HEALTHY",
49
+
"Attributes": {
50
+
"AWS_INSTANCE_IPV4": "203.0.113.75",
51
+
"AWS_INSTANCE_PORT": "80"
52
+
}
53
+
}
54
+
],
55
+
"InstancesRevision": 1234567890
56
+
}
57
+
58
+
For more information, see `Shared AWS Cloud Map namespaces <https://docs.aws.amazon.com/cloud-map/latest/dg/sharing-namespaces.html>`__ and `AWS Cloud Map service instances <https://docs.aws.amazon.com/cloud-map/latest/dg/working-with-instances.html>`__ in the *AWS Cloud Map Developer Guide*.
For more information, see `AWS Cloud Map service instances <https://docs.aws.amazon.com/cloud-map/latest/dg/working-with-instances.html>`__ in the *AWS Cloud Map Developer Guide*.
27
+
28
+
**Example 2: To get the details of an instance using service ARN for shared namespaces**
29
+
30
+
The following ``get-instance`` example gets the attributes of an instance using a service ARN instead of service ID. Specifying an ARN is required when getting details of instances associated with namespaces that are shared with your account. The instance returned in this example was registered by account ``123456789111`` in a namespace owned by account ``123456789012``. ::
For more information about cross-account namespace sharing, see `Shared AWS Cloud Map namespaces <https://docs.aws.amazon.com/cloud-map/latest/dg/sharing-namespaces.html>`__ in the *AWS Cloud Map Developer Guide*.
Copy file name to clipboardExpand all lines: awscli/examples/servicediscovery/get-instances-health-status.rst
+19-1Lines changed: 19 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
**To get the health status of instances associated with a service**
1
+
**Example 1: To get the health status of instances associated with a service**
2
2
3
3
The following ``get-instances-health-status`` example gets the health status of instances associated with the specified service. ::
4
4
@@ -15,3 +15,21 @@ Output::
15
15
}
16
16
17
17
For more information, see `AWS Cloud Map service instances <https://docs.aws.amazon.com/cloud-map/latest/dg/working-with-instances.html>`__ in the *AWS Cloud Map Developer Guide*.
18
+
19
+
**Example 2: To get the health status of instances using service ARN for shared namespaces**
20
+
21
+
The following ``get-instances-health-status`` example gets the health status of instances using a service ARN instead of service ID. Specifying an ARN is required when getting health status for instances associated with namespaces that are shared with the requester's account. ::
For more information, see `AWS Cloud Map service instances <https://docs.aws.amazon.com/cloud-map/latest/dg/working-with-instances.html>`__ and `Shared AWS Cloud Map namespaces <https://docs.aws.amazon.com/cloud-map/latest/dg/sharing-namespaces.html>`__ in the *AWS Cloud Map Developer Guide*.
0 commit comments