:doc:`ServiceCatalog <../../servicecatalog>` / Client / create_service_action

*********************
create_service_action
*********************



.. py:method:: ServiceCatalog.Client.create_service_action(**kwargs)

  

  Creates a self-service action.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/CreateServiceAction>`_  


  **Request Syntax**
  ::

    response = client.create_service_action(
        Name='string',
        DefinitionType='SSM_AUTOMATION',
        Definition={
            'string': 'string'
        },
        Description='string',
        AcceptLanguage='string',
        IdempotencyToken='string'
    )
    
  :type Name: string
  :param Name: **[REQUIRED]** 

    The self-service action name.

    

  
  :type DefinitionType: string
  :param DefinitionType: **[REQUIRED]** 

    The service action definition type. For example, ``SSM_AUTOMATION``.

    

  
  :type Definition: dict
  :param Definition: **[REQUIRED]** 

    The self-service action definition. Can be one of the following:

      Name  

    The name of the Amazon Web Services Systems Manager document (SSM document). For example, ``AWS-RestartEC2Instance``.

     

    If you are using a shared SSM document, you must provide the ARN instead of the name.

      Version  

    The Amazon Web Services Systems Manager automation document version. For example, ``"Version": "1"``

      AssumeRole  

    The Amazon Resource Name (ARN) of the role that performs the self-service actions on your behalf. For example, ``"AssumeRole": "arn:aws:iam::12345678910:role/ActionRole"``.

     

    To reuse the provisioned product launch role, set to ``"AssumeRole": "LAUNCH_ROLE"``.

      Parameters  

    The list of parameters in JSON format.

     

    For example: ``[{\"Name\":\"InstanceId\",\"Type\":\"TARGET\"}]`` or ``[{\"Name\":\"InstanceId\",\"Type\":\"TEXT_VALUE\"}]``.

    

  
    - *(string) --* 

    
      - *(string) --* 

      


  :type Description: string
  :param Description: 

    The self-service action description.

    

  
  :type AcceptLanguage: string
  :param AcceptLanguage: 

    The language code.

     

    
    * ``jp`` - Japanese
     
    * ``zh`` - Chinese
    

    

  
  :type IdempotencyToken: string
  :param IdempotencyToken: **[REQUIRED]** 

    A unique identifier that you provide to ensure idempotency. If multiple requests differ only by the idempotency token, the same response is returned for each repeated request.

    This field is autopopulated if not provided.

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'ServiceActionDetail': {
              'ServiceActionSummary': {
                  'Id': 'string',
                  'Name': 'string',
                  'Description': 'string',
                  'DefinitionType': 'SSM_AUTOMATION'
              },
              'Definition': {
                  'string': 'string'
              }
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **ServiceActionDetail** *(dict) --* 

        An object containing information about the self-service action.

        
        

        - **ServiceActionSummary** *(dict) --* 

          Summary information about the self-service action.

          
          

          - **Id** *(string) --* 

            The self-service action identifier.

            
          

          - **Name** *(string) --* 

            The self-service action name.

            
          

          - **Description** *(string) --* 

            The self-service action description.

            
          

          - **DefinitionType** *(string) --* 

            The self-service action definition type. For example, ``SSM_AUTOMATION``.

            
      
        

        - **Definition** *(dict) --* 

          A map that defines the self-service action.

          
          

          - *(string) --* 
            

            - *(string) --* 
      
    
    
  
  **Exceptions**
  
  *   :py:class:`ServiceCatalog.Client.exceptions.InvalidParametersException`

  
  *   :py:class:`ServiceCatalog.Client.exceptions.LimitExceededException`

  