AppMesh / Client / create_virtual_service

create_virtual_service#

AppMesh.Client.create_virtual_service(**kwargs)#

Creates a virtual service within a service mesh.

A virtual service is an abstraction of a real service that is provided by a virtual node directly or indirectly by means of a virtual router. Dependent services call your virtual service by its virtualServiceName, and those requests are routed to the virtual node or virtual router that is specified as the provider for the virtual service.

For more information about virtual services, see Virtual services.

See also: AWS API Documentation

Request Syntax

response = client.create_virtual_service(
    clientToken='string',
    meshName='string',
    meshOwner='string',
    spec={
        'provider': {
            'virtualNode': {
                'virtualNodeName': 'string'
            },
            'virtualRouter': {
                'virtualRouterName': 'string'
            }
        }
    },
    tags=[
        {
            'key': 'string',
            'value': 'string'
        },
    ],
    virtualServiceName='string'
)
Parameters:
  • clientToken (string) –

    Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Up to 36 letters, numbers, hyphens, and underscores are allowed.

    This field is autopopulated if not provided.

  • meshName (string) –

    [REQUIRED]

    The name of the service mesh to create the virtual service in.

  • meshOwner (string) – The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then the account that you specify must share the mesh with your account before you can create the resource in the service mesh. For more information about mesh sharing, see Working with shared meshes.

  • spec (dict) –

    [REQUIRED]

    The virtual service specification to apply.

    • provider (dict) –

      The App Mesh object that is acting as the provider for a virtual service. You can specify a single virtual node or virtual router.

      Note

      This is a Tagged Union structure. Only one of the following top level keys can be set: virtualNode, virtualRouter.

      • virtualNode (dict) –

        The virtual node associated with a virtual service.

        • virtualNodeName (string) – [REQUIRED]

          The name of the virtual node that is acting as a service provider.

      • virtualRouter (dict) –

        The virtual router associated with a virtual service.

        • virtualRouterName (string) – [REQUIRED]

          The name of the virtual router that is acting as a service provider.

  • tags (list) –

    Optional metadata that you can apply to the virtual service to assist with categorization and organization. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.

    • (dict) –

      Optional metadata that you apply to a resource to assist with categorization and organization. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.

      • key (string) – [REQUIRED]

        One part of a key-value pair that make up a tag. A key is a general label that acts like a category for more specific tag values.

      • value (string) – [REQUIRED]

        The optional part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category (key).

  • virtualServiceName (string) –

    [REQUIRED]

    The name to use for the virtual service.

Return type:

dict

Returns:

Response Syntax

{
    'virtualService': {
        'meshName': 'string',
        'metadata': {
            'arn': 'string',
            'createdAt': datetime(2015, 1, 1),
            'lastUpdatedAt': datetime(2015, 1, 1),
            'meshOwner': 'string',
            'resourceOwner': 'string',
            'uid': 'string',
            'version': 123
        },
        'spec': {
            'provider': {
                'virtualNode': {
                    'virtualNodeName': 'string'
                },
                'virtualRouter': {
                    'virtualRouterName': 'string'
                }
            }
        },
        'status': {
            'status': 'ACTIVE'|'INACTIVE'|'DELETED'
        },
        'virtualServiceName': 'string'
    }
}

Response Structure

  • (dict) –

    • virtualService (dict) –

      The full description of your virtual service following the create call.

      • meshName (string) –

        The name of the service mesh that the virtual service resides in.

      • metadata (dict) –

        An object that represents metadata for a resource.

        • arn (string) –

          The full Amazon Resource Name (ARN) for the resource.

        • createdAt (datetime) –

          The Unix epoch timestamp in seconds for when the resource was created.

        • lastUpdatedAt (datetime) –

          The Unix epoch timestamp in seconds for when the resource was last updated.

        • meshOwner (string) –

          The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it’s the ID of the account that shared the mesh with your account. For more information about mesh sharing, see Working with shared meshes.

        • resourceOwner (string) –

          The Amazon Web Services IAM account ID of the resource owner. If the account ID is not your own, then it’s the ID of the mesh owner or of another account that the mesh is shared with. For more information about mesh sharing, see Working with shared meshes.

        • uid (string) –

          The unique identifier for the resource.

        • version (integer) –

          The version of the resource. Resources are created at version 1, and this version is incremented each time that they’re updated.

      • spec (dict) –

        The specifications of the virtual service.

        • provider (dict) –

          The App Mesh object that is acting as the provider for a virtual service. You can specify a single virtual node or virtual router.

          Note

          This is a Tagged Union structure. Only one of the following top level keys will be set: virtualNode, virtualRouter. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

          'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
          
          • virtualNode (dict) –

            The virtual node associated with a virtual service.

            • virtualNodeName (string) –

              The name of the virtual node that is acting as a service provider.

          • virtualRouter (dict) –

            The virtual router associated with a virtual service.

            • virtualRouterName (string) –

              The name of the virtual router that is acting as a service provider.

      • status (dict) –

        The current status of the virtual service.

        • status (string) –

          The current status of the virtual service.

      • virtualServiceName (string) –

        The name of the virtual service.

Exceptions

  • AppMesh.Client.exceptions.NotFoundException

  • AppMesh.Client.exceptions.BadRequestException

  • AppMesh.Client.exceptions.ConflictException

  • AppMesh.Client.exceptions.TooManyRequestsException

  • AppMesh.Client.exceptions.ForbiddenException

  • AppMesh.Client.exceptions.ServiceUnavailableException

  • AppMesh.Client.exceptions.InternalServerErrorException

  • AppMesh.Client.exceptions.LimitExceededException