def capture_role(self, service_name, deployment_name, role_name,<EOL>post_capture_action, target_image_name,<EOL>target_image_label, provisioning_configuration=None):
_validate_not_none('<STR_LIT>', service_name)<EOL>_validate_not_none('<STR_LIT>', deployment_name)<EOL>_validate_not_none('<STR_LIT>', role_name)<EOL>_validate_not_none('<STR_LIT>', post_capture_action)<EOL>_validate_not_none('<STR_LIT>', target_image_name)<EOL>_validate_not_none('<STR_LIT>', target_image_label)<EOL>return self._perform_post(<EOL>self._get_role_instance_operations_path(<EOL>service_name, deployment_name, role_name),<EOL>_XmlSerializer.capture_role_to_xml(<EOL>post_capture_action,<EOL>target_image_name,<EOL>target_image_label,<EOL>provisioning_configuration),<EOL>as_async=True)<EOL>
The Capture Role operation captures a virtual machine image to your
image gallery. From the captured image, you can create additional
customized virtual machines.

service_name:
    The name of the service.
deployment_name:
    The name of the deployment.
role_name:
    The name of the role.
post_capture_action:
    Specifies the action after capture operation completes. Possible
    values are: Delete, Reprovision.
target_image_name:
    Specifies the image name of the captured virtual machine.
target_image_label:
    Specifies the friendly name of the captured virtual machine.
provisioning_configuration:
    Use an instance of WindowsConfigurationSet or LinuxConfigurationSet.