Пример #1
0
    def __init__(self, config):
        # properties for create operation
        create_input_type = type.StructType(
            'operation-input', {
                'service_id': type.StringType(),
                'service_instance_id': type.StringType(),
                'instance_runtime_id': type.StringType(),
                'action': type.OptionalType(type.StringType()),
                'unhealthy_reason': type.OptionalType(type.StringType()),
            })
        create_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        create_input_value_validator_list = []
        create_output_validator_list = []
        create_rest_metadata = OperationRestMetadata(
            http_method='POST',
            url_template=
            '/api/v1/serviceinsertion/services/{service-id}/service-instances/{service-instance-id}/instance-runtimes/{instance-runtime-id}',
            path_variables={
                'service_id': 'service-id',
                'service_instance_id': 'service-instance-id',
                'instance_runtime_id': 'instance-runtime-id',
            },
            query_parameters={
                'action': 'action',
                'unhealthy_reason': 'unhealthy_reason',
            },
            content_type='application/json')

        # properties for delete operation
        delete_input_type = type.StructType(
            'operation-input', {
                'service_id': type.StringType(),
                'service_instance_id': type.StringType(),
            })
        delete_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        delete_input_value_validator_list = []
        delete_output_validator_list = []
        delete_rest_metadata = OperationRestMetadata(
            http_method='POST',
            url_template=
            '/api/v1/serviceinsertion/services/{service-id}/service-instances/{service-instance-id}/instance-runtimes?action=delete',
            path_variables={
                'service_id': 'service-id',
                'service_instance_id': 'service-instance-id',
            },
            query_parameters={},
            content_type='application/json')

        # properties for deploy operation
        deploy_input_type = type.StructType(
            'operation-input', {
                'service_id': type.StringType(),
                'service_instance_id': type.StringType(),
            })
        deploy_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        deploy_input_value_validator_list = []
        deploy_output_validator_list = []
        deploy_rest_metadata = OperationRestMetadata(
            http_method='POST',
            url_template=
            '/api/v1/serviceinsertion/services/{service-id}/service-instances/{service-instance-id}/instance-runtimes?action=deploy',
            path_variables={
                'service_id': 'service-id',
                'service_instance_id': 'service-instance-id',
            },
            query_parameters={},
            content_type='application/json')

        # properties for list operation
        list_input_type = type.StructType(
            'operation-input', {
                'service_id': type.StringType(),
                'service_instance_id': type.StringType(),
            })
        list_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        list_input_value_validator_list = []
        list_output_validator_list = []
        list_rest_metadata = OperationRestMetadata(
            http_method='GET',
            url_template=
            '/api/v1/serviceinsertion/services/{service-id}/service-instances/{service-instance-id}/instance-runtimes',
            path_variables={
                'service_id': 'service-id',
                'service_instance_id': 'service-instance-id',
            },
            query_parameters={},
            content_type='application/json')

        # properties for upgrade operation
        upgrade_input_type = type.StructType(
            'operation-input', {
                'service_id': type.StringType(),
                'service_instance_id': type.StringType(),
            })
        upgrade_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        upgrade_input_value_validator_list = []
        upgrade_output_validator_list = []
        upgrade_rest_metadata = OperationRestMetadata(
            http_method='POST',
            url_template=
            '/api/v1/serviceinsertion/services/{service-id}/service-instances/{service-instance-id}/instance-runtimes?action=upgrade',
            path_variables={
                'service_id': 'service-id',
                'service_instance_id': 'service-instance-id',
            },
            query_parameters={},
            content_type='application/json')

        operations = {
            'create': {
                'input_type': create_input_type,
                'output_type': type.VoidType(),
                'errors': create_error_dict,
                'input_value_validator_list':
                create_input_value_validator_list,
                'output_validator_list': create_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'delete': {
                'input_type': delete_input_type,
                'output_type': type.VoidType(),
                'errors': delete_error_dict,
                'input_value_validator_list':
                delete_input_value_validator_list,
                'output_validator_list': delete_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'deploy': {
                'input_type': deploy_input_type,
                'output_type': type.VoidType(),
                'errors': deploy_error_dict,
                'input_value_validator_list':
                deploy_input_value_validator_list,
                'output_validator_list': deploy_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'list': {
                'input_type':
                list_input_type,
                'output_type':
                type.ReferenceType('com.vmware.nsx.model_client',
                                   'InstanceRuntimeListResult'),
                'errors':
                list_error_dict,
                'input_value_validator_list':
                list_input_value_validator_list,
                'output_validator_list':
                list_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
            'upgrade': {
                'input_type': upgrade_input_type,
                'output_type': type.VoidType(),
                'errors': upgrade_error_dict,
                'input_value_validator_list':
                upgrade_input_value_validator_list,
                'output_validator_list': upgrade_output_validator_list,
                'task_type': TaskType.NONE,
            },
        }
        rest_metadata = {
            'create': create_rest_metadata,
            'delete': delete_rest_metadata,
            'deploy': deploy_rest_metadata,
            'list': list_rest_metadata,
            'upgrade': upgrade_rest_metadata,
        }
        ApiInterfaceStub.__init__(
            self,
            iface_name=
            'com.vmware.nsx.serviceinsertion.services.service_instances.instance_runtimes',
            config=config,
            operations=operations,
            rest_metadata=rest_metadata,
            is_vapi_rest=False)
Пример #2
0
    def __init__(self, config):
        # properties for upgrade operation
        upgrade_input_type = type.StructType(
            'operation-input', {
                'cluster':
                type.IdType(resource_types='ClusterComputeResource'),
                'spec': type.ReferenceType(__name__, 'Clusters.UpgradeSpec'),
            })
        upgrade_error_dict = {
            'com.vmware.vapi.std.errors.error':
            type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
            'com.vmware.vapi.std.errors.unsupported':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unsupported'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
            'com.vmware.vapi.std.errors.unauthenticated':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthenticated'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
        }
        upgrade_input_value_validator_list = []
        upgrade_output_validator_list = []
        upgrade_rest_metadata = OperationRestMetadata(
            http_method='POST',
            url_template=
            '/vcenter/namespace-management/software/clusters/{cluster}',
            request_body_parameter='spec',
            path_variables={
                'cluster': 'cluster',
            },
            query_parameters={},
            dispatch_parameters={
                'action': 'upgrade',
            },
            header_parameters={},
            dispatch_header_parameters={})

        # properties for upgrade_multiple operation
        upgrade_multiple_input_type = type.StructType(
            'operation-input', {
                'specs':
                type.MapType(
                    type.IdType(),
                    type.ReferenceType(__name__, 'Clusters.UpgradeSpec')),
            })
        upgrade_multiple_error_dict = {
            'com.vmware.vapi.std.errors.error':
            type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
            'com.vmware.vapi.std.errors.unauthenticated':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthenticated'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
        }
        upgrade_multiple_input_value_validator_list = []
        upgrade_multiple_output_validator_list = []
        upgrade_multiple_rest_metadata = OperationRestMetadata(
            http_method='POST',
            url_template='/vcenter/namespace-management/software/clusters',
            request_body_parameter='specs',
            path_variables={},
            query_parameters={},
            dispatch_parameters={
                'action': 'upgradeMultiple',
            },
            header_parameters={},
            dispatch_header_parameters={})

        # properties for get operation
        get_input_type = type.StructType('operation-input', {
            'cluster':
            type.IdType(resource_types='ClusterComputeResource'),
        })
        get_error_dict = {
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
            'com.vmware.vapi.std.errors.error':
            type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
            'com.vmware.vapi.std.errors.unauthenticated':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthenticated'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
        }
        get_input_value_validator_list = []
        get_output_validator_list = []
        get_rest_metadata = OperationRestMetadata(
            http_method='GET',
            url_template=
            '/vcenter/namespace-management/software/clusters/{cluster}',
            path_variables={
                'cluster': 'cluster',
            },
            query_parameters={},
            dispatch_parameters={},
            header_parameters={},
            dispatch_header_parameters={})

        # properties for list operation
        list_input_type = type.StructType('operation-input', {})
        list_error_dict = {
            'com.vmware.vapi.std.errors.error':
            type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
            'com.vmware.vapi.std.errors.unauthenticated':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthenticated'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
        }
        list_input_value_validator_list = []
        list_output_validator_list = []
        list_rest_metadata = OperationRestMetadata(
            http_method='GET',
            url_template='/vcenter/namespace-management/software/clusters',
            path_variables={},
            query_parameters={},
            dispatch_parameters={},
            header_parameters={},
            dispatch_header_parameters={})

        operations = {
            'upgrade': {
                'input_type': upgrade_input_type,
                'output_type': type.VoidType(),
                'errors': upgrade_error_dict,
                'input_value_validator_list':
                upgrade_input_value_validator_list,
                'output_validator_list': upgrade_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'upgrade_multiple': {
                'input_type':
                upgrade_multiple_input_type,
                'output_type':
                type.MapType(type.IdType(),
                             type.ReferenceType(__name__, 'Clusters.Result')),
                'errors':
                upgrade_multiple_error_dict,
                'input_value_validator_list':
                upgrade_multiple_input_value_validator_list,
                'output_validator_list':
                upgrade_multiple_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
            'get': {
                'input_type': get_input_type,
                'output_type': type.ReferenceType(__name__, 'Clusters.Info'),
                'errors': get_error_dict,
                'input_value_validator_list': get_input_value_validator_list,
                'output_validator_list': get_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'list': {
                'input_type':
                list_input_type,
                'output_type':
                type.ListType(type.ReferenceType(__name__,
                                                 'Clusters.Summary')),
                'errors':
                list_error_dict,
                'input_value_validator_list':
                list_input_value_validator_list,
                'output_validator_list':
                list_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
        }
        rest_metadata = {
            'upgrade': upgrade_rest_metadata,
            'upgrade_multiple': upgrade_multiple_rest_metadata,
            'get': get_rest_metadata,
            'list': list_rest_metadata,
        }
        ApiInterfaceStub.__init__(
            self,
            iface_name=
            'com.vmware.vcenter.namespace_management.software.clusters',
            config=config,
            operations=operations,
            rest_metadata=rest_metadata,
            is_vapi_rest=True)
Пример #3
0
    def __init__(self, config):
        # properties for mount operation
        mount_input_type = type.StructType(
            'operation-input', {
                'library_item':
                type.IdType(resource_types='com.vmware.content.library.Item'),
                'vm':
                type.IdType(resource_types='VirtualMachine'),
            })
        mount_error_dict = {
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
            'com.vmware.vapi.std.errors.invalid_argument':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidArgument'),
            'com.vmware.vapi.std.errors.not_allowed_in_current_state':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotAllowedInCurrentState'),
            'com.vmware.vapi.std.errors.resource_inaccessible':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ResourceInaccessible'),
        }
        mount_input_value_validator_list = []
        mount_output_validator_list = []
        mount_rest_metadata = None

        # properties for unmount operation
        unmount_input_type = type.StructType(
            'operation-input', {
                'vm':
                type.IdType(resource_types='VirtualMachine'),
                'cdrom':
                type.IdType(
                    resource_types='com.vmware.vcenter.vm.hardware.Cdrom'),
            })
        unmount_error_dict = {
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
            'com.vmware.vapi.std.errors.not_allowed_in_current_state':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotAllowedInCurrentState'),
        }
        unmount_input_value_validator_list = []
        unmount_output_validator_list = []
        unmount_rest_metadata = None

        operations = {
            'mount': {
                'input_type':
                mount_input_type,
                'output_type':
                type.IdType(
                    resource_types='com.vmware.vcenter.vm.hardware.Cdrom'),
                'errors':
                mount_error_dict,
                'input_value_validator_list':
                mount_input_value_validator_list,
                'output_validator_list':
                mount_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
            'unmount': {
                'input_type': unmount_input_type,
                'output_type': type.VoidType(),
                'errors': unmount_error_dict,
                'input_value_validator_list':
                unmount_input_value_validator_list,
                'output_validator_list': unmount_output_validator_list,
                'task_type': TaskType.NONE,
            },
        }
        rest_metadata = {
            'mount': mount_rest_metadata,
            'unmount': unmount_rest_metadata,
        }
        ApiInterfaceStub.__init__(self,
                                  iface_name='com.vmware.vcenter.iso.image',
                                  config=config,
                                  operations=operations,
                                  rest_metadata=rest_metadata,
                                  is_vapi_rest=True)
Пример #4
0
    def __init__(self, config):
        # properties for start operation
        start_input_type = type.StructType(
            'operation-input', {
                'service':
                type.IdType(
                    resource_types='com.vmware.vcenter.services.Service'),
            })
        start_error_dict = {
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
            'com.vmware.vapi.std.errors.not_allowed_in_current_state':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotAllowedInCurrentState'),
            'com.vmware.vapi.std.errors.timed_out':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'TimedOut'),
            'com.vmware.vapi.std.errors.error':
            type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
        }
        start_input_value_validator_list = []
        start_output_validator_list = []
        start_rest_metadata = OperationRestMetadata(
            http_method='POST',
            url_template='/vcenter/services/{id}/start',
            path_variables={
                'service': 'id',
            },
            query_parameters={})

        # properties for stop operation
        stop_input_type = type.StructType(
            'operation-input', {
                'service':
                type.IdType(
                    resource_types='com.vmware.vcenter.services.Service'),
            })
        stop_error_dict = {
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
            'com.vmware.vapi.std.errors.error':
            type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
            'com.vmware.vapi.std.errors.not_allowed_in_current_state':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotAllowedInCurrentState'),
        }
        stop_input_value_validator_list = []
        stop_output_validator_list = []
        stop_rest_metadata = OperationRestMetadata(
            http_method='POST',
            url_template='/vcenter/services/{id}/stop',
            path_variables={
                'service': 'id',
            },
            query_parameters={})

        # properties for restart operation
        restart_input_type = type.StructType(
            'operation-input', {
                'service':
                type.IdType(
                    resource_types='com.vmware.vcenter.services.Service'),
            })
        restart_error_dict = {
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
            'com.vmware.vapi.std.errors.timed_out':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'TimedOut'),
            'com.vmware.vapi.std.errors.not_allowed_in_current_state':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotAllowedInCurrentState'),
            'com.vmware.vapi.std.errors.error':
            type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
        }
        restart_input_value_validator_list = []
        restart_output_validator_list = []
        restart_rest_metadata = OperationRestMetadata(
            http_method='POST',
            url_template='/vcenter/services/{id}/restart',
            path_variables={
                'service': 'id',
            },
            query_parameters={})

        # properties for get operation
        get_input_type = type.StructType(
            'operation-input', {
                'service':
                type.IdType(
                    resource_types='com.vmware.vcenter.services.Service'),
            })
        get_error_dict = {
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
            'com.vmware.vapi.std.errors.error':
            type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
        }
        get_input_value_validator_list = []
        get_output_validator_list = []
        get_rest_metadata = OperationRestMetadata(
            http_method='GET',
            url_template='/vcenter/services/{id}',
            path_variables={
                'service': 'id',
            },
            query_parameters={})

        # properties for update operation
        update_input_type = type.StructType(
            'operation-input', {
                'service':
                type.IdType(
                    resource_types='com.vmware.vcenter.services.Service'),
                'spec':
                type.ReferenceType(__name__, 'Service.UpdateSpec'),
            })
        update_error_dict = {
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
            'com.vmware.vapi.std.errors.error':
            type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
            'com.vmware.vapi.std.errors.not_allowed_in_current_state':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotAllowedInCurrentState'),
        }
        update_input_value_validator_list = []
        update_output_validator_list = []
        update_rest_metadata = OperationRestMetadata(
            http_method='PATCH',
            url_template='/vcenter/services/{id}',
            path_variables={
                'service': 'id',
            },
            query_parameters={})

        # properties for list_details operation
        list_details_input_type = type.StructType('operation-input', {})
        list_details_error_dict = {
            'com.vmware.vapi.std.errors.error':
            type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
        }
        list_details_input_value_validator_list = []
        list_details_output_validator_list = []
        list_details_rest_metadata = OperationRestMetadata(
            http_method='GET',
            url_template='/vcenter/services',
            path_variables={},
            query_parameters={})

        operations = {
            'start': {
                'input_type': start_input_type,
                'output_type': type.VoidType(),
                'errors': start_error_dict,
                'input_value_validator_list': start_input_value_validator_list,
                'output_validator_list': start_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'stop': {
                'input_type': stop_input_type,
                'output_type': type.VoidType(),
                'errors': stop_error_dict,
                'input_value_validator_list': stop_input_value_validator_list,
                'output_validator_list': stop_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'restart': {
                'input_type': restart_input_type,
                'output_type': type.VoidType(),
                'errors': restart_error_dict,
                'input_value_validator_list':
                restart_input_value_validator_list,
                'output_validator_list': restart_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'get': {
                'input_type': get_input_type,
                'output_type': type.ReferenceType(__name__, 'Service.Info'),
                'errors': get_error_dict,
                'input_value_validator_list': get_input_value_validator_list,
                'output_validator_list': get_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'update': {
                'input_type': update_input_type,
                'output_type': type.VoidType(),
                'errors': update_error_dict,
                'input_value_validator_list':
                update_input_value_validator_list,
                'output_validator_list': update_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'list_details': {
                'input_type':
                list_details_input_type,
                'output_type':
                type.MapType(type.IdType(),
                             type.ReferenceType(__name__, 'Service.Info')),
                'errors':
                list_details_error_dict,
                'input_value_validator_list':
                list_details_input_value_validator_list,
                'output_validator_list':
                list_details_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
        }
        rest_metadata = {
            'start': start_rest_metadata,
            'stop': stop_rest_metadata,
            'restart': restart_rest_metadata,
            'get': get_rest_metadata,
            'update': update_rest_metadata,
            'list_details': list_details_rest_metadata,
        }
        ApiInterfaceStub.__init__(
            self,
            iface_name='com.vmware.vcenter.services.service',
            config=config,
            operations=operations,
            rest_metadata=rest_metadata,
            is_vapi_rest=True)
Пример #5
0
    def __init__(self, config):
        # properties for delete operation
        delete_input_type = type.StructType(
            'operation-input', {
                'domain_id': type.StringType(),
                'policy_id': type.StringType(),
                'rule_id': type.StringType(),
            })
        delete_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        delete_input_value_validator_list = []
        delete_output_validator_list = []
        delete_rest_metadata = OperationRestMetadata(
            http_method='DELETE',
            url_template=
            '/policy/api/v1/infra/domains/{domain-id}/intrusion-service-policies/{policy-id}/rules/{rule-id}',
            path_variables={
                'domain_id': 'domain-id',
                'policy_id': 'policy-id',
                'rule_id': 'rule-id',
            },
            query_parameters={},
            content_type='application/json')

        # properties for get operation
        get_input_type = type.StructType(
            'operation-input', {
                'domain_id': type.StringType(),
                'policy_id': type.StringType(),
                'rule_id': type.StringType(),
            })
        get_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        get_input_value_validator_list = []
        get_output_validator_list = [HasFieldsOfValidator()]
        get_rest_metadata = OperationRestMetadata(
            http_method='GET',
            url_template=
            '/policy/api/v1/infra/domains/{domain-id}/intrusion-service-policies/{policy-id}/rules/{rule-id}',
            path_variables={
                'domain_id': 'domain-id',
                'policy_id': 'policy-id',
                'rule_id': 'rule-id',
            },
            query_parameters={},
            content_type='application/json')

        # properties for list operation
        list_input_type = type.StructType(
            'operation-input', {
                'domain_id':
                type.StringType(),
                'policy_id':
                type.StringType(),
                'cursor':
                type.OptionalType(type.StringType()),
                'include_mark_for_delete_objects':
                type.OptionalType(type.BooleanType()),
                'included_fields':
                type.OptionalType(type.StringType()),
                'page_size':
                type.OptionalType(type.IntegerType()),
                'sort_ascending':
                type.OptionalType(type.BooleanType()),
                'sort_by':
                type.OptionalType(type.StringType()),
            })
        list_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        list_input_value_validator_list = []
        list_output_validator_list = [HasFieldsOfValidator()]
        list_rest_metadata = OperationRestMetadata(
            http_method='GET',
            url_template=
            '/policy/api/v1/infra/domains/{domain-id}/intrusion-service-policies/{policy-id}/rules',
            path_variables={
                'domain_id': 'domain-id',
                'policy_id': 'policy-id',
            },
            query_parameters={
                'cursor': 'cursor',
                'include_mark_for_delete_objects':
                'include_mark_for_delete_objects',
                'included_fields': 'included_fields',
                'page_size': 'page_size',
                'sort_ascending': 'sort_ascending',
                'sort_by': 'sort_by',
            },
            content_type='application/json')

        # properties for patch operation
        patch_input_type = type.StructType(
            'operation-input', {
                'domain_id':
                type.StringType(),
                'policy_id':
                type.StringType(),
                'rule_id':
                type.StringType(),
                'ids_rule':
                type.ReferenceType('com.vmware.nsx_policy.model_client',
                                   'IdsRule'),
            })
        patch_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        patch_input_value_validator_list = [HasFieldsOfValidator()]
        patch_output_validator_list = []
        patch_rest_metadata = OperationRestMetadata(
            http_method='PATCH',
            url_template=
            '/policy/api/v1/infra/domains/{domain-id}/intrusion-service-policies/{policy-id}/rules/{rule-id}',
            request_body_parameter='ids_rule',
            path_variables={
                'domain_id': 'domain-id',
                'policy_id': 'policy-id',
                'rule_id': 'rule-id',
            },
            query_parameters={},
            content_type='application/json')

        # properties for revise operation
        revise_input_type = type.StructType(
            'operation-input', {
                'domain_id':
                type.StringType(),
                'policy_id':
                type.StringType(),
                'rule_id':
                type.StringType(),
                'ids_rule':
                type.ReferenceType('com.vmware.nsx_policy.model_client',
                                   'IdsRule'),
                'anchor_path':
                type.OptionalType(type.StringType()),
                'operation':
                type.OptionalType(type.StringType()),
            })
        revise_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        revise_input_value_validator_list = [HasFieldsOfValidator()]
        revise_output_validator_list = [HasFieldsOfValidator()]
        revise_rest_metadata = OperationRestMetadata(
            http_method='POST',
            url_template=
            '/policy/api/v1/infra/domains/{domain-id}/intrusion-service-policies/{policy-id}/rules/{rule-id}?action=revise',
            request_body_parameter='ids_rule',
            path_variables={
                'domain_id': 'domain-id',
                'policy_id': 'policy-id',
                'rule_id': 'rule-id',
            },
            query_parameters={
                'anchor_path': 'anchor_path',
                'operation': 'operation',
            },
            content_type='application/json')

        # properties for update operation
        update_input_type = type.StructType(
            'operation-input', {
                'domain_id':
                type.StringType(),
                'policy_id':
                type.StringType(),
                'rule_id':
                type.StringType(),
                'ids_rule':
                type.ReferenceType('com.vmware.nsx_policy.model_client',
                                   'IdsRule'),
            })
        update_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        update_input_value_validator_list = [HasFieldsOfValidator()]
        update_output_validator_list = [HasFieldsOfValidator()]
        update_rest_metadata = OperationRestMetadata(
            http_method='PUT',
            url_template=
            '/policy/api/v1/infra/domains/{domain-id}/intrusion-service-policies/{policy-id}/rules/{rule-id}',
            request_body_parameter='ids_rule',
            path_variables={
                'domain_id': 'domain-id',
                'policy_id': 'policy-id',
                'rule_id': 'rule-id',
            },
            query_parameters={},
            content_type='application/json')

        operations = {
            'delete': {
                'input_type': delete_input_type,
                'output_type': type.VoidType(),
                'errors': delete_error_dict,
                'input_value_validator_list':
                delete_input_value_validator_list,
                'output_validator_list': delete_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'get': {
                'input_type':
                get_input_type,
                'output_type':
                type.ReferenceType('com.vmware.nsx_policy.model_client',
                                   'IdsRule'),
                'errors':
                get_error_dict,
                'input_value_validator_list':
                get_input_value_validator_list,
                'output_validator_list':
                get_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
            'list': {
                'input_type':
                list_input_type,
                'output_type':
                type.ReferenceType('com.vmware.nsx_policy.model_client',
                                   'IdsRuleListResult'),
                'errors':
                list_error_dict,
                'input_value_validator_list':
                list_input_value_validator_list,
                'output_validator_list':
                list_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
            'patch': {
                'input_type': patch_input_type,
                'output_type': type.VoidType(),
                'errors': patch_error_dict,
                'input_value_validator_list': patch_input_value_validator_list,
                'output_validator_list': patch_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'revise': {
                'input_type':
                revise_input_type,
                'output_type':
                type.ReferenceType('com.vmware.nsx_policy.model_client',
                                   'IdsRule'),
                'errors':
                revise_error_dict,
                'input_value_validator_list':
                revise_input_value_validator_list,
                'output_validator_list':
                revise_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
            'update': {
                'input_type':
                update_input_type,
                'output_type':
                type.ReferenceType('com.vmware.nsx_policy.model_client',
                                   'IdsRule'),
                'errors':
                update_error_dict,
                'input_value_validator_list':
                update_input_value_validator_list,
                'output_validator_list':
                update_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
        }
        rest_metadata = {
            'delete': delete_rest_metadata,
            'get': get_rest_metadata,
            'list': list_rest_metadata,
            'patch': patch_rest_metadata,
            'revise': revise_rest_metadata,
            'update': update_rest_metadata,
        }
        ApiInterfaceStub.__init__(
            self,
            iface_name=
            'com.vmware.nsx_policy.infra.domains.intrusion_service_policies.rules',
            config=config,
            operations=operations,
            rest_metadata=rest_metadata,
            is_vapi_rest=False)
Пример #6
0
    def __init__(self, config):
        # properties for create operation
        create_input_type = type.StructType('operation-input', {
            'source_id': type.IdType(resource_types='com.vmware.vapi.metadata.privilege.source'),
            'spec': type.ReferenceType(__name__, 'Source.CreateSpec'),
        })
        create_error_dict = {
            'com.vmware.vapi.std.errors.already_exists':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'AlreadyExists'),
            'com.vmware.vapi.std.errors.invalid_argument':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidArgument'),
            'com.vmware.vapi.std.errors.not_found':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),

        }
        create_input_value_validator_list = [
        ]
        create_output_validator_list = [
        ]
        create_rest_metadata = None

        # properties for delete operation
        delete_input_type = type.StructType('operation-input', {
            'source_id': type.IdType(resource_types='com.vmware.vapi.metadata.privilege.source'),
        })
        delete_error_dict = {
            'com.vmware.vapi.std.errors.not_found':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),

        }
        delete_input_value_validator_list = [
        ]
        delete_output_validator_list = [
        ]
        delete_rest_metadata = None

        # properties for get operation
        get_input_type = type.StructType('operation-input', {
            'source_id': type.IdType(resource_types='com.vmware.vapi.metadata.privilege.source'),
        })
        get_error_dict = {
            'com.vmware.vapi.std.errors.not_found':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),

        }
        get_input_value_validator_list = [
        ]
        get_output_validator_list = [
        ]
        get_rest_metadata = None

        # properties for list operation
        list_input_type = type.StructType('operation-input', {})
        list_error_dict = {}
        list_input_value_validator_list = [
        ]
        list_output_validator_list = [
        ]
        list_rest_metadata = None

        # properties for reload operation
        reload_input_type = type.StructType('operation-input', {
            'source_id': type.OptionalType(type.IdType()),
        })
        reload_error_dict = {
            'com.vmware.vapi.std.errors.not_found':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),

        }
        reload_input_value_validator_list = [
        ]
        reload_output_validator_list = [
        ]
        reload_rest_metadata = None

        # properties for fingerprint operation
        fingerprint_input_type = type.StructType('operation-input', {
            'source_id': type.OptionalType(type.IdType()),
        })
        fingerprint_error_dict = {
            'com.vmware.vapi.std.errors.not_found':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),

        }
        fingerprint_input_value_validator_list = [
        ]
        fingerprint_output_validator_list = [
        ]
        fingerprint_rest_metadata = None

        operations = {
            'create': {
                'input_type': create_input_type,
                'output_type': type.VoidType(),
                'errors': create_error_dict,
                'input_value_validator_list': create_input_value_validator_list,
                'output_validator_list': create_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'delete': {
                'input_type': delete_input_type,
                'output_type': type.VoidType(),
                'errors': delete_error_dict,
                'input_value_validator_list': delete_input_value_validator_list,
                'output_validator_list': delete_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'get': {
                'input_type': get_input_type,
                'output_type': type.ReferenceType(__name__, 'Source.Info'),
                'errors': get_error_dict,
                'input_value_validator_list': get_input_value_validator_list,
                'output_validator_list': get_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'list': {
                'input_type': list_input_type,
                'output_type': type.ListType(type.IdType()),
                'errors': list_error_dict,
                'input_value_validator_list': list_input_value_validator_list,
                'output_validator_list': list_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'reload': {
                'input_type': reload_input_type,
                'output_type': type.VoidType(),
                'errors': reload_error_dict,
                'input_value_validator_list': reload_input_value_validator_list,
                'output_validator_list': reload_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'fingerprint': {
                'input_type': fingerprint_input_type,
                'output_type': type.StringType(),
                'errors': fingerprint_error_dict,
                'input_value_validator_list': fingerprint_input_value_validator_list,
                'output_validator_list': fingerprint_output_validator_list,
                'task_type': TaskType.NONE,
            },
        }
        rest_metadata = {
            'create': create_rest_metadata,
            'delete': delete_rest_metadata,
            'get': get_rest_metadata,
            'list': list_rest_metadata,
            'reload': reload_rest_metadata,
            'fingerprint': fingerprint_rest_metadata,
        }
        ApiInterfaceStub.__init__(
            self, iface_name='com.vmware.vapi.metadata.privilege.source',
            config=config, operations=operations, rest_metadata=rest_metadata,
            is_vapi_rest=True)
    def __init__(self, config):
        # properties for get operation
        get_input_type = type.StructType(
            'operation-input', {
                'vm': type.IdType(resource_types='VirtualMachine'),
            })
        get_error_dict = {
            'com.vmware.vapi.std.errors.error':
            type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        get_input_value_validator_list = []
        get_output_validator_list = []
        get_rest_metadata = OperationRestMetadata(
            http_method='GET',
            url_template='/vcenter/vm/{vm}/tools/installer',
            path_variables={
                'vm': 'vm',
            },
            query_parameters={})

        # properties for connect operation
        connect_input_type = type.StructType(
            'operation-input', {
                'vm': type.IdType(resource_types='VirtualMachine'),
            })
        connect_error_dict = {
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
            'com.vmware.vapi.std.errors.not_allowed_in_current_state':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotAllowedInCurrentState'),
            'com.vmware.vapi.std.errors.already_in_desired_state':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'AlreadyInDesiredState'),
            'com.vmware.vapi.std.errors.error':
            type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
        }
        connect_input_value_validator_list = []
        connect_output_validator_list = []
        connect_rest_metadata = OperationRestMetadata(
            http_method='POST',
            url_template='/vcenter/vm/{vm}/tools/installer',
            path_variables={
                'vm': 'vm',
            },
            query_parameters={})

        # properties for disconnect operation
        disconnect_input_type = type.StructType(
            'operation-input', {
                'vm': type.IdType(resource_types='VirtualMachine'),
            })
        disconnect_error_dict = {
            'com.vmware.vapi.std.errors.error':
            type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
            'com.vmware.vapi.std.errors.not_allowed_in_current_state':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotAllowedInCurrentState'),
        }
        disconnect_input_value_validator_list = []
        disconnect_output_validator_list = []
        disconnect_rest_metadata = OperationRestMetadata(
            http_method='POST',
            url_template='/vcenter/vm/{vm}/tools/installer',
            path_variables={
                'vm': 'vm',
            },
            query_parameters={})

        operations = {
            'get': {
                'input_type': get_input_type,
                'output_type': type.ReferenceType(__name__, 'Installer.Info'),
                'errors': get_error_dict,
                'input_value_validator_list': get_input_value_validator_list,
                'output_validator_list': get_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'connect': {
                'input_type': connect_input_type,
                'output_type': type.VoidType(),
                'errors': connect_error_dict,
                'input_value_validator_list':
                connect_input_value_validator_list,
                'output_validator_list': connect_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'disconnect': {
                'input_type': disconnect_input_type,
                'output_type': type.VoidType(),
                'errors': disconnect_error_dict,
                'input_value_validator_list':
                disconnect_input_value_validator_list,
                'output_validator_list': disconnect_output_validator_list,
                'task_type': TaskType.NONE,
            },
        }
        rest_metadata = {
            'get': get_rest_metadata,
            'connect': connect_rest_metadata,
            'disconnect': disconnect_rest_metadata,
        }
        ApiInterfaceStub.__init__(
            self,
            iface_name='com.vmware.vcenter.vm.tools.installer',
            config=config,
            operations=operations,
            rest_metadata=rest_metadata,
            is_vapi_rest=True)
Пример #8
0
    def __init__(self, config):
        # properties for reorder operation
        reorder_input_type = type.StructType(
            'operation-input', {
                'group_id':
                type.StringType(),
                'migration_unit_id':
                type.StringType(),
                'reorder_migration_request':
                type.ReferenceType('com.vmware.nsx.model_client',
                                   'ReorderMigrationRequest'),
            })
        reorder_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        reorder_input_value_validator_list = []
        reorder_output_validator_list = []
        reorder_rest_metadata = OperationRestMetadata(
            http_method='POST',
            url_template=
            '/api/v1/migration/migration-unit-groups/{group-id}/migration-unit/{migration-unit-id}?action=reorder',
            request_body_parameter='reorder_migration_request',
            path_variables={
                'group_id': 'group-id',
                'migration_unit_id': 'migration-unit-id',
            },
            query_parameters={},
            content_type='application/json')

        operations = {
            'reorder': {
                'input_type': reorder_input_type,
                'output_type': type.VoidType(),
                'errors': reorder_error_dict,
                'input_value_validator_list':
                reorder_input_value_validator_list,
                'output_validator_list': reorder_output_validator_list,
                'task_type': TaskType.NONE,
            },
        }
        rest_metadata = {
            'reorder': reorder_rest_metadata,
        }
        ApiInterfaceStub.__init__(
            self,
            iface_name=
            'com.vmware.nsx.migration.migration_unit_groups.migration_unit',
            config=config,
            operations=operations,
            rest_metadata=rest_metadata,
            is_vapi_rest=False)
    def __init__(self, config):
        # properties for delete operation
        delete_input_type = type.StructType(
            'operation-input', {
                'deployment_zone_id': type.StringType(),
                'enforcementpoint_id': type.StringType(),
            })
        delete_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        delete_input_value_validator_list = []
        delete_output_validator_list = []
        delete_rest_metadata = OperationRestMetadata(
            http_method='DELETE',
            url_template=
            '/policy/api/v1/infra/deployment-zones/{deployment-zone-id}/enforcement-points/{enforcementpoint-id}',
            path_variables={
                'deployment_zone_id': 'deployment-zone-id',
                'enforcementpoint_id': 'enforcementpoint-id',
            },
            query_parameters={})

        # properties for get operation
        get_input_type = type.StructType(
            'operation-input', {
                'deployment_zone_id': type.StringType(),
                'enforcementpoint_id': type.StringType(),
            })
        get_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        get_input_value_validator_list = []
        get_output_validator_list = [HasFieldsOfValidator()]
        get_rest_metadata = OperationRestMetadata(
            http_method='GET',
            url_template=
            '/policy/api/v1/infra/deployment-zones/{deployment-zone-id}/enforcement-points/{enforcementpoint-id}',
            path_variables={
                'deployment_zone_id': 'deployment-zone-id',
                'enforcementpoint_id': 'enforcementpoint-id',
            },
            query_parameters={})

        # properties for list operation
        list_input_type = type.StructType(
            'operation-input', {
                'deployment_zone_id': type.StringType(),
                'cursor': type.OptionalType(type.StringType()),
                'included_fields': type.OptionalType(type.StringType()),
                'page_size': type.OptionalType(type.IntegerType()),
                'sort_ascending': type.OptionalType(type.BooleanType()),
                'sort_by': type.OptionalType(type.StringType()),
            })
        list_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        list_input_value_validator_list = []
        list_output_validator_list = [HasFieldsOfValidator()]
        list_rest_metadata = OperationRestMetadata(
            http_method='GET',
            url_template=
            '/policy/api/v1/infra/deployment-zones/{deployment-zone-id}/enforcement-points',
            path_variables={
                'deployment_zone_id': 'deployment-zone-id',
            },
            query_parameters={
                'cursor': 'cursor',
                'included_fields': 'included_fields',
                'page_size': 'page_size',
                'sort_ascending': 'sort_ascending',
                'sort_by': 'sort_by',
            })

        # properties for patch operation
        patch_input_type = type.StructType(
            'operation-input', {
                'deployment_zone_id':
                type.StringType(),
                'enforcementpoint_id':
                type.StringType(),
                'enforcement_point':
                type.ReferenceType('com.vmware.nsx_policy.model_client',
                                   'EnforcementPoint'),
            })
        patch_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        patch_input_value_validator_list = [HasFieldsOfValidator()]
        patch_output_validator_list = []
        patch_rest_metadata = OperationRestMetadata(
            http_method='PATCH',
            url_template=
            '/policy/api/v1/infra/deployment-zones/{deployment-zone-id}/enforcement-points/{enforcementpoint-id}',
            request_body_parameter='enforcement_point',
            path_variables={
                'deployment_zone_id': 'deployment-zone-id',
                'enforcementpoint_id': 'enforcementpoint-id',
            },
            query_parameters={})

        # properties for update operation
        update_input_type = type.StructType(
            'operation-input', {
                'deployment_zone_id':
                type.StringType(),
                'enforcementpoint_id':
                type.StringType(),
                'enforcement_point':
                type.ReferenceType('com.vmware.nsx_policy.model_client',
                                   'EnforcementPoint'),
            })
        update_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        update_input_value_validator_list = [HasFieldsOfValidator()]
        update_output_validator_list = [HasFieldsOfValidator()]
        update_rest_metadata = OperationRestMetadata(
            http_method='PUT',
            url_template=
            '/policy/api/v1/infra/deployment-zones/{deployment-zone-id}/enforcement-points/{enforcementpoint-id}',
            request_body_parameter='enforcement_point',
            path_variables={
                'deployment_zone_id': 'deployment-zone-id',
                'enforcementpoint_id': 'enforcementpoint-id',
            },
            query_parameters={})

        operations = {
            'delete': {
                'input_type': delete_input_type,
                'output_type': type.VoidType(),
                'errors': delete_error_dict,
                'input_value_validator_list':
                delete_input_value_validator_list,
                'output_validator_list': delete_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'get': {
                'input_type':
                get_input_type,
                'output_type':
                type.ReferenceType('com.vmware.nsx_policy.model_client',
                                   'EnforcementPoint'),
                'errors':
                get_error_dict,
                'input_value_validator_list':
                get_input_value_validator_list,
                'output_validator_list':
                get_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
            'list': {
                'input_type':
                list_input_type,
                'output_type':
                type.ReferenceType('com.vmware.nsx_policy.model_client',
                                   'EnforcementPointListResult'),
                'errors':
                list_error_dict,
                'input_value_validator_list':
                list_input_value_validator_list,
                'output_validator_list':
                list_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
            'patch': {
                'input_type': patch_input_type,
                'output_type': type.VoidType(),
                'errors': patch_error_dict,
                'input_value_validator_list': patch_input_value_validator_list,
                'output_validator_list': patch_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'update': {
                'input_type':
                update_input_type,
                'output_type':
                type.ReferenceType('com.vmware.nsx_policy.model_client',
                                   'EnforcementPoint'),
                'errors':
                update_error_dict,
                'input_value_validator_list':
                update_input_value_validator_list,
                'output_validator_list':
                update_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
        }
        rest_metadata = {
            'delete': delete_rest_metadata,
            'get': get_rest_metadata,
            'list': list_rest_metadata,
            'patch': patch_rest_metadata,
            'update': update_rest_metadata,
        }
        ApiInterfaceStub.__init__(
            self,
            iface_name=
            'com.vmware.nsx_policy.infra.deployment_zones.enforcement_points',
            config=config,
            operations=operations,
            rest_metadata=rest_metadata,
            is_vapi_rest=False)
Пример #10
0
    def __init__(self, config):
        # properties for get operation
        get_input_type = type.StructType('operation-input', {})
        get_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        get_input_value_validator_list = []
        get_output_validator_list = []
        get_rest_metadata = OperationRestMetadata(
            http_method='GET',
            url_template='/api/v1/node/services/controller/profiler',
            path_variables={},
            query_parameters={},
            content_type='application/json')

        # properties for update operation
        update_input_type = type.StructType(
            'operation-input', {
                'controller_profiler_properties':
                type.ReferenceType('com.vmware.nsx.model_client',
                                   'ControllerProfilerProperties'),
            })
        update_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        update_input_value_validator_list = []
        update_output_validator_list = []
        update_rest_metadata = OperationRestMetadata(
            http_method='PUT',
            url_template='/api/v1/node/services/controller/profiler',
            request_body_parameter='controller_profiler_properties',
            path_variables={},
            query_parameters={},
            content_type='application/json')

        operations = {
            'get': {
                'input_type':
                get_input_type,
                'output_type':
                type.ReferenceType('com.vmware.nsx.model_client',
                                   'ControllerProfilerProperties'),
                'errors':
                get_error_dict,
                'input_value_validator_list':
                get_input_value_validator_list,
                'output_validator_list':
                get_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
            'update': {
                'input_type': update_input_type,
                'output_type': type.VoidType(),
                'errors': update_error_dict,
                'input_value_validator_list':
                update_input_value_validator_list,
                'output_validator_list': update_output_validator_list,
                'task_type': TaskType.NONE,
            },
        }
        rest_metadata = {
            'get': get_rest_metadata,
            'update': update_rest_metadata,
        }
        ApiInterfaceStub.__init__(
            self,
            iface_name='com.vmware.nsx.node.services.controller.profiler',
            config=config,
            operations=operations,
            rest_metadata=rest_metadata,
            is_vapi_rest=False)
Пример #11
0
    def __init__(self, config):
        # properties for test operation
        test_input_type = type.StructType(
            'operation-input', {
                'servers': type.ListType(type.StringType()),
            })
        test_error_dict = {
            'com.vmware.vapi.std.errors.error':
            type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
        }
        test_input_value_validator_list = []
        test_output_validator_list = []
        test_rest_metadata = OperationRestMetadata(
            http_method='POST',
            url_template='/appliance/networking/dns/servers/test',
            path_variables={},
            query_parameters={})

        # properties for add operation
        add_input_type = type.StructType('operation-input', {
            'server': type.StringType(),
        })
        add_error_dict = {
            'com.vmware.vapi.std.errors.error':
            type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
        }
        add_input_value_validator_list = []
        add_output_validator_list = []
        add_rest_metadata = OperationRestMetadata(
            http_method='POST',
            url_template='/appliance/networking/dns/servers',
            path_variables={},
            query_parameters={})

        # properties for set operation
        set_input_type = type.StructType('operation-input', {
            'config':
            type.ReferenceType(__name__, 'Servers.DNSServerConfig'),
        })
        set_error_dict = {
            'com.vmware.vapi.std.errors.error':
            type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
        }
        set_input_value_validator_list = []
        set_output_validator_list = []
        set_rest_metadata = OperationRestMetadata(
            http_method='PUT',
            url_template='/appliance/networking/dns/servers',
            path_variables={},
            query_parameters={})

        # properties for get operation
        get_input_type = type.StructType('operation-input', {})
        get_error_dict = {
            'com.vmware.vapi.std.errors.error':
            type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
        }
        get_input_value_validator_list = []
        get_output_validator_list = []
        get_rest_metadata = OperationRestMetadata(
            http_method='GET',
            url_template='/appliance/networking/dns/servers',
            path_variables={},
            query_parameters={})

        operations = {
            'test': {
                'input_type':
                test_input_type,
                'output_type':
                type.ReferenceType(__name__, 'Servers.TestStatusInfo'),
                'errors':
                test_error_dict,
                'input_value_validator_list':
                test_input_value_validator_list,
                'output_validator_list':
                test_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
            'add': {
                'input_type': add_input_type,
                'output_type': type.VoidType(),
                'errors': add_error_dict,
                'input_value_validator_list': add_input_value_validator_list,
                'output_validator_list': add_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'set': {
                'input_type': set_input_type,
                'output_type': type.VoidType(),
                'errors': set_error_dict,
                'input_value_validator_list': set_input_value_validator_list,
                'output_validator_list': set_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'get': {
                'input_type':
                get_input_type,
                'output_type':
                type.ReferenceType(__name__, 'Servers.DNSServerConfig'),
                'errors':
                get_error_dict,
                'input_value_validator_list':
                get_input_value_validator_list,
                'output_validator_list':
                get_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
        }
        rest_metadata = {
            'test': test_rest_metadata,
            'add': add_rest_metadata,
            'set': set_rest_metadata,
            'get': get_rest_metadata,
        }
        ApiInterfaceStub.__init__(
            self,
            iface_name='com.vmware.appliance.networking.dns.servers',
            config=config,
            operations=operations,
            rest_metadata=rest_metadata,
            is_vapi_rest=True)
Пример #12
0
    def __init__(self, config):
        # properties for get operation
        get_input_type = type.StructType(
            'operation-input', {
                'realized_path': type.OptionalType(type.StringType()),
            })
        get_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        get_input_value_validator_list = []
        get_output_validator_list = []
        get_rest_metadata = OperationRestMetadata(
            http_method='GET',
            url_template='/policy/api/v1/infra/realized-state/realized-entity',
            path_variables={},
            query_parameters={
                'realized_path': 'realized_path',
            },
            content_type='application/json')

        # properties for refresh operation
        refresh_input_type = type.StructType(
            'operation-input', {
                'intent_path': type.StringType(),
                'enforcement_point_path': type.OptionalType(type.StringType()),
            })
        refresh_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        refresh_input_value_validator_list = []
        refresh_output_validator_list = []
        refresh_rest_metadata = OperationRestMetadata(
            http_method='POST',
            url_template=
            '/policy/api/v1/infra/realized-state/realized-entity?action=refresh',
            path_variables={},
            query_parameters={
                'intent_path': 'intent_path',
                'enforcement_point_path': 'enforcement_point_path',
            },
            content_type='application/json')

        operations = {
            'get': {
                'input_type':
                get_input_type,
                'output_type':
                type.ReferenceType('com.vmware.nsx_policy.model_client',
                                   'GenericPolicyRealizedResource'),
                'errors':
                get_error_dict,
                'input_value_validator_list':
                get_input_value_validator_list,
                'output_validator_list':
                get_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
            'refresh': {
                'input_type': refresh_input_type,
                'output_type': type.VoidType(),
                'errors': refresh_error_dict,
                'input_value_validator_list':
                refresh_input_value_validator_list,
                'output_validator_list': refresh_output_validator_list,
                'task_type': TaskType.NONE,
            },
        }
        rest_metadata = {
            'get': get_rest_metadata,
            'refresh': refresh_rest_metadata,
        }
        ApiInterfaceStub.__init__(
            self,
            iface_name=
            'com.vmware.nsx_policy.infra.realized_state.realized_entity',
            config=config,
            operations=operations,
            rest_metadata=rest_metadata,
            is_vapi_rest=False)
Пример #13
0
    def __init__(self, config):
        # properties for set operation
        set_input_type = type.StructType('operation-input', {
            'rules':
            type.ListType(type.ReferenceType(__name__, 'Inbound.Rule')),
        })
        set_error_dict = {
            'com.vmware.vapi.std.errors.error':
            type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
        }
        set_input_value_validator_list = []
        set_output_validator_list = []
        set_rest_metadata = OperationRestMetadata(
            http_method='PUT',
            url_template='/appliance/networking/firewall/inbound',
            path_variables={},
            query_parameters={})

        # properties for get operation
        get_input_type = type.StructType('operation-input', {})
        get_error_dict = {
            'com.vmware.vapi.std.errors.error':
            type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
        }
        get_input_value_validator_list = []
        get_output_validator_list = []
        get_rest_metadata = OperationRestMetadata(
            http_method='GET',
            url_template='/appliance/networking/firewall/inbound',
            path_variables={},
            query_parameters={})

        operations = {
            'set': {
                'input_type': set_input_type,
                'output_type': type.VoidType(),
                'errors': set_error_dict,
                'input_value_validator_list': set_input_value_validator_list,
                'output_validator_list': set_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'get': {
                'input_type':
                get_input_type,
                'output_type':
                type.ListType(type.ReferenceType(__name__, 'Inbound.Rule')),
                'errors':
                get_error_dict,
                'input_value_validator_list':
                get_input_value_validator_list,
                'output_validator_list':
                get_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
        }
        rest_metadata = {
            'set': set_rest_metadata,
            'get': get_rest_metadata,
        }
        ApiInterfaceStub.__init__(
            self,
            iface_name='com.vmware.appliance.networking.firewall.inbound',
            config=config,
            operations=operations,
            rest_metadata=rest_metadata,
            is_vapi_rest=True)
Пример #14
0
    def __init__(self, config):
        # properties for validate operation
        validate_input_type = type.StructType(
            'operation-input', {
                'update_session_id':
                type.IdType(resource_types=
                            'com.vmware.content.library.item.UpdateSession'),
            })
        validate_error_dict = {
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
            'com.vmware.vapi.std.errors.not_allowed_in_current_state':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotAllowedInCurrentState'),
        }
        validate_input_value_validator_list = []
        validate_output_validator_list = []
        validate_rest_metadata = None

        # properties for add operation
        add_input_type = type.StructType(
            'operation-input', {
                'update_session_id':
                type.IdType(resource_types=
                            'com.vmware.content.library.item.UpdateSession'),
                'file_spec':
                type.ReferenceType(__name__, 'File.AddSpec'),
            })
        add_error_dict = {
            'com.vmware.vapi.std.errors.invalid_argument':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidArgument'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_allowed_in_current_state':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotAllowedInCurrentState'),
        }
        add_input_value_validator_list = []
        add_output_validator_list = []
        add_rest_metadata = None

        # properties for remove operation
        remove_input_type = type.StructType(
            'operation-input', {
                'update_session_id':
                type.IdType(resource_types=
                            'com.vmware.content.library.item.UpdateSession'),
                'file_name':
                type.StringType(),
            })
        remove_error_dict = {
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
            'com.vmware.vapi.std.errors.invalid_argument':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidArgument'),
        }
        remove_input_value_validator_list = []
        remove_output_validator_list = []
        remove_rest_metadata = None

        # properties for list operation
        list_input_type = type.StructType(
            'operation-input', {
                'update_session_id':
                type.IdType(resource_types=
                            'com.vmware.content.library.item.UpdateSession'),
            })
        list_error_dict = {
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        list_input_value_validator_list = []
        list_output_validator_list = []
        list_rest_metadata = None

        # properties for get operation
        get_input_type = type.StructType(
            'operation-input', {
                'update_session_id':
                type.IdType(resource_types=
                            'com.vmware.content.library.item.UpdateSession'),
                'file_name':
                type.StringType(),
            })
        get_error_dict = {
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
            'com.vmware.vapi.std.errors.invalid_argument':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidArgument'),
        }
        get_input_value_validator_list = []
        get_output_validator_list = []
        get_rest_metadata = None

        operations = {
            'validate': {
                'input_type':
                validate_input_type,
                'output_type':
                type.ReferenceType(__name__, 'File.ValidationResult'),
                'errors':
                validate_error_dict,
                'input_value_validator_list':
                validate_input_value_validator_list,
                'output_validator_list':
                validate_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
            'add': {
                'input_type': add_input_type,
                'output_type': type.ReferenceType(__name__, 'File.Info'),
                'errors': add_error_dict,
                'input_value_validator_list': add_input_value_validator_list,
                'output_validator_list': add_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'remove': {
                'input_type': remove_input_type,
                'output_type': type.VoidType(),
                'errors': remove_error_dict,
                'input_value_validator_list':
                remove_input_value_validator_list,
                'output_validator_list': remove_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'list': {
                'input_type':
                list_input_type,
                'output_type':
                type.ListType(type.ReferenceType(__name__, 'File.Info')),
                'errors':
                list_error_dict,
                'input_value_validator_list':
                list_input_value_validator_list,
                'output_validator_list':
                list_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
            'get': {
                'input_type': get_input_type,
                'output_type': type.ReferenceType(__name__, 'File.Info'),
                'errors': get_error_dict,
                'input_value_validator_list': get_input_value_validator_list,
                'output_validator_list': get_output_validator_list,
                'task_type': TaskType.NONE,
            },
        }
        rest_metadata = {
            'validate': validate_rest_metadata,
            'add': add_rest_metadata,
            'remove': remove_rest_metadata,
            'list': list_rest_metadata,
            'get': get_rest_metadata,
        }
        ApiInterfaceStub.__init__(
            self,
            iface_name='com.vmware.content.library.item.updatesession.file',
            config=config,
            operations=operations,
            rest_metadata=rest_metadata,
            is_vapi_rest=True)
    def __init__(self, config):
        # properties for delete operation
        delete_input_type = type.StructType(
            'operation-input', {
                'tier0_id': type.StringType(),
                'locale_service_id': type.StringType(),
                'service_instance_id': type.StringType(),
                'service_instance_endpoint_id': type.StringType(),
            })
        delete_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        delete_input_value_validator_list = []
        delete_output_validator_list = []
        delete_rest_metadata = OperationRestMetadata(
            http_method='DELETE',
            url_template=
            '/policy/api/v1/global-infra/tier-0s/{tier-0-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}',
            path_variables={
                'tier0_id': 'tier-0-id',
                'locale_service_id': 'locale-service-id',
                'service_instance_id': 'service-instance-id',
                'service_instance_endpoint_id': 'service-instance-endpoint-id',
            },
            query_parameters={},
            content_type='application/json')

        # properties for get operation
        get_input_type = type.StructType(
            'operation-input', {
                'tier0_id': type.StringType(),
                'locale_service_id': type.StringType(),
                'service_instance_id': type.StringType(),
                'service_instance_endpoint_id': type.StringType(),
            })
        get_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        get_input_value_validator_list = []
        get_output_validator_list = []
        get_rest_metadata = OperationRestMetadata(
            http_method='GET',
            url_template=
            '/policy/api/v1/global-infra/tier-0s/{tier-0-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}',
            path_variables={
                'tier0_id': 'tier-0-id',
                'locale_service_id': 'locale-service-id',
                'service_instance_id': 'service-instance-id',
                'service_instance_endpoint_id': 'service-instance-endpoint-id',
            },
            query_parameters={},
            content_type='application/json')

        # properties for list operation
        list_input_type = type.StructType(
            'operation-input', {
                'tier0_id':
                type.StringType(),
                'locale_service_id':
                type.StringType(),
                'service_instance_id':
                type.StringType(),
                'cursor':
                type.OptionalType(type.StringType()),
                'include_mark_for_delete_objects':
                type.OptionalType(type.BooleanType()),
                'included_fields':
                type.OptionalType(type.StringType()),
                'page_size':
                type.OptionalType(type.IntegerType()),
                'sort_ascending':
                type.OptionalType(type.BooleanType()),
                'sort_by':
                type.OptionalType(type.StringType()),
            })
        list_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        list_input_value_validator_list = []
        list_output_validator_list = []
        list_rest_metadata = OperationRestMetadata(
            http_method='GET',
            url_template=
            '/policy/api/v1/global-infra/tier-0s/{tier-0-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints',
            path_variables={
                'tier0_id': 'tier-0-id',
                'locale_service_id': 'locale-service-id',
                'service_instance_id': 'service-instance-id',
            },
            query_parameters={
                'cursor': 'cursor',
                'include_mark_for_delete_objects':
                'include_mark_for_delete_objects',
                'included_fields': 'included_fields',
                'page_size': 'page_size',
                'sort_ascending': 'sort_ascending',
                'sort_by': 'sort_by',
            },
            content_type='application/json')

        # properties for patch operation
        patch_input_type = type.StructType(
            'operation-input', {
                'tier0_id':
                type.StringType(),
                'locale_service_id':
                type.StringType(),
                'service_instance_id':
                type.StringType(),
                'service_instance_endpoint_id':
                type.StringType(),
                'service_instance_endpoint':
                type.ReferenceType('com.vmware.nsx_policy.model_client',
                                   'ServiceInstanceEndpoint'),
            })
        patch_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        patch_input_value_validator_list = []
        patch_output_validator_list = []
        patch_rest_metadata = OperationRestMetadata(
            http_method='PATCH',
            url_template=
            '/policy/api/v1/global-infra/tier-0s/{tier-0-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}',
            request_body_parameter='service_instance_endpoint',
            path_variables={
                'tier0_id': 'tier-0-id',
                'locale_service_id': 'locale-service-id',
                'service_instance_id': 'service-instance-id',
                'service_instance_endpoint_id': 'service-instance-endpoint-id',
            },
            query_parameters={},
            content_type='application/json')

        # properties for update operation
        update_input_type = type.StructType(
            'operation-input', {
                'tier0_id':
                type.StringType(),
                'locale_service_id':
                type.StringType(),
                'service_instance_id':
                type.StringType(),
                'service_instance_endpoint_id':
                type.StringType(),
                'service_instance_endpoint':
                type.ReferenceType('com.vmware.nsx_policy.model_client',
                                   'ServiceInstanceEndpoint'),
            })
        update_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        update_input_value_validator_list = []
        update_output_validator_list = []
        update_rest_metadata = OperationRestMetadata(
            http_method='PUT',
            url_template=
            '/policy/api/v1/global-infra/tier-0s/{tier-0-id}/locale-services/{locale-service-id}/byod-service-instances/{service-instance-id}/service-instance-endpoints/{service-instance-endpoint-id}',
            request_body_parameter='service_instance_endpoint',
            path_variables={
                'tier0_id': 'tier-0-id',
                'locale_service_id': 'locale-service-id',
                'service_instance_id': 'service-instance-id',
                'service_instance_endpoint_id': 'service-instance-endpoint-id',
            },
            query_parameters={},
            content_type='application/json')

        operations = {
            'delete': {
                'input_type': delete_input_type,
                'output_type': type.VoidType(),
                'errors': delete_error_dict,
                'input_value_validator_list':
                delete_input_value_validator_list,
                'output_validator_list': delete_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'get': {
                'input_type':
                get_input_type,
                'output_type':
                type.ReferenceType('com.vmware.nsx_policy.model_client',
                                   'ServiceInstanceEndpoint'),
                'errors':
                get_error_dict,
                'input_value_validator_list':
                get_input_value_validator_list,
                'output_validator_list':
                get_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
            'list': {
                'input_type':
                list_input_type,
                'output_type':
                type.ReferenceType('com.vmware.nsx_policy.model_client',
                                   'ServiceInstanceEndpointListResult'),
                'errors':
                list_error_dict,
                'input_value_validator_list':
                list_input_value_validator_list,
                'output_validator_list':
                list_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
            'patch': {
                'input_type': patch_input_type,
                'output_type': type.VoidType(),
                'errors': patch_error_dict,
                'input_value_validator_list': patch_input_value_validator_list,
                'output_validator_list': patch_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'update': {
                'input_type':
                update_input_type,
                'output_type':
                type.ReferenceType('com.vmware.nsx_policy.model_client',
                                   'ServiceInstanceEndpoint'),
                'errors':
                update_error_dict,
                'input_value_validator_list':
                update_input_value_validator_list,
                'output_validator_list':
                update_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
        }
        rest_metadata = {
            'delete': delete_rest_metadata,
            'get': get_rest_metadata,
            'list': list_rest_metadata,
            'patch': patch_rest_metadata,
            'update': update_rest_metadata,
        }
        ApiInterfaceStub.__init__(
            self,
            iface_name=
            'com.vmware.nsx_policy.global_infra.tier_0s.locale_services.byod_service_instances.service_instance_endpoints',
            config=config,
            operations=operations,
            rest_metadata=rest_metadata,
            is_vapi_rest=False)
Пример #16
0
    def __init__(self, config):
        # properties for create operation
        create_input_type = type.StructType('operation-input', {
            'vif_id': type.StringType(),
            'action': type.StringType(),
        })
        create_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),

        }
        create_input_value_validator_list = [
        ]
        create_output_validator_list = [
        ]
        create_rest_metadata = OperationRestMetadata(
            http_method='POST',
            url_template='/cloud-service/api/v1/infra/direct-connect/vifs/{vif-id}',
            path_variables={
                'vif_id': 'vif-id',
            },
            query_parameters={
                'action': 'action',
            },
            content_type='application/json'
        )

        # properties for delete operation
        delete_input_type = type.StructType('operation-input', {
            'vif_id': type.StringType(),
        })
        delete_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),

        }
        delete_input_value_validator_list = [
        ]
        delete_output_validator_list = [
        ]
        delete_rest_metadata = OperationRestMetadata(
            http_method='DELETE',
            url_template='/cloud-service/api/v1/infra/direct-connect/vifs/{vif-id}',
            path_variables={
                'vif_id': 'vif-id',
            },
            query_parameters={
            },
            content_type='application/json'
        )

        # properties for list operation
        list_input_type = type.StructType('operation-input', {})
        list_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),

        }
        list_input_value_validator_list = [
        ]
        list_output_validator_list = [
        ]
        list_rest_metadata = OperationRestMetadata(
            http_method='GET',
            url_template='/cloud-service/api/v1/infra/direct-connect/vifs',
            path_variables={
            },
            query_parameters={
            },
            content_type='application/json'
        )

        operations = {
            'create': {
                'input_type': create_input_type,
                'output_type': type.VoidType(),
                'errors': create_error_dict,
                'input_value_validator_list': create_input_value_validator_list,
                'output_validator_list': create_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'delete': {
                'input_type': delete_input_type,
                'output_type': type.VoidType(),
                'errors': delete_error_dict,
                'input_value_validator_list': delete_input_value_validator_list,
                'output_validator_list': delete_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'list': {
                'input_type': list_input_type,
                'output_type': type.ReferenceType('com.vmware.nsx_vmc_app.model_client', 'VifsListResult'),
                'errors': list_error_dict,
                'input_value_validator_list': list_input_value_validator_list,
                'output_validator_list': list_output_validator_list,
                'task_type': TaskType.NONE,
            },
        }
        rest_metadata = {
            'create': create_rest_metadata,
            'delete': delete_rest_metadata,
            'list': list_rest_metadata,
        }
        ApiInterfaceStub.__init__(
            self, iface_name='com.vmware.nsx_vmc_app.infra.direct_connect.vifs',
            config=config, operations=operations, rest_metadata=rest_metadata,
            is_vapi_rest=False)
    def __init__(self, config):
        # properties for create operation
        create_input_type = type.StructType(
            'operation-input', {
                'ipfix_collector_config':
                type.ReferenceType('com.vmware.nsx.model_client',
                                   'IpfixCollectorConfig'),
            })
        create_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        create_input_value_validator_list = []
        create_output_validator_list = []
        create_rest_metadata = OperationRestMetadata(
            http_method='POST',
            url_template='/api/v1/ipfix/collectorconfigs',
            request_body_parameter='ipfix_collector_config',
            path_variables={},
            query_parameters={},
            content_type='application/json')

        # properties for delete operation
        delete_input_type = type.StructType(
            'operation-input', {
                'collector_config_id': type.StringType(),
            })
        delete_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        delete_input_value_validator_list = []
        delete_output_validator_list = []
        delete_rest_metadata = OperationRestMetadata(
            http_method='DELETE',
            url_template='/api/v1/ipfix/collectorconfigs/{collector-config-id}',
            path_variables={
                'collector_config_id': 'collector-config-id',
            },
            query_parameters={},
            content_type='application/json')

        # properties for get operation
        get_input_type = type.StructType(
            'operation-input', {
                'collector_config_id': type.StringType(),
            })
        get_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        get_input_value_validator_list = []
        get_output_validator_list = []
        get_rest_metadata = OperationRestMetadata(
            http_method='GET',
            url_template='/api/v1/ipfix/collectorconfigs/{collector-config-id}',
            path_variables={
                'collector_config_id': 'collector-config-id',
            },
            query_parameters={},
            content_type='application/json')

        # properties for list operation
        list_input_type = type.StructType(
            'operation-input', {
                'cursor': type.OptionalType(type.StringType()),
                'included_fields': type.OptionalType(type.StringType()),
                'page_size': type.OptionalType(type.IntegerType()),
                'sort_ascending': type.OptionalType(type.BooleanType()),
                'sort_by': type.OptionalType(type.StringType()),
            })
        list_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        list_input_value_validator_list = []
        list_output_validator_list = []
        list_rest_metadata = OperationRestMetadata(
            http_method='GET',
            url_template='/api/v1/ipfix/collectorconfigs',
            path_variables={},
            query_parameters={
                'cursor': 'cursor',
                'included_fields': 'included_fields',
                'page_size': 'page_size',
                'sort_ascending': 'sort_ascending',
                'sort_by': 'sort_by',
            },
            content_type='application/json')

        # properties for update operation
        update_input_type = type.StructType(
            'operation-input', {
                'collector_config_id':
                type.StringType(),
                'ipfix_collector_config':
                type.ReferenceType('com.vmware.nsx.model_client',
                                   'IpfixCollectorConfig'),
            })
        update_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        update_input_value_validator_list = []
        update_output_validator_list = []
        update_rest_metadata = OperationRestMetadata(
            http_method='PUT',
            url_template='/api/v1/ipfix/collectorconfigs/{collector-config-id}',
            request_body_parameter='ipfix_collector_config',
            path_variables={
                'collector_config_id': 'collector-config-id',
            },
            query_parameters={},
            content_type='application/json')

        operations = {
            'create': {
                'input_type':
                create_input_type,
                'output_type':
                type.ReferenceType('com.vmware.nsx.model_client',
                                   'IpfixCollectorConfig'),
                'errors':
                create_error_dict,
                'input_value_validator_list':
                create_input_value_validator_list,
                'output_validator_list':
                create_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
            'delete': {
                'input_type': delete_input_type,
                'output_type': type.VoidType(),
                'errors': delete_error_dict,
                'input_value_validator_list':
                delete_input_value_validator_list,
                'output_validator_list': delete_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'get': {
                'input_type':
                get_input_type,
                'output_type':
                type.ReferenceType('com.vmware.nsx.model_client',
                                   'IpfixCollectorConfig'),
                'errors':
                get_error_dict,
                'input_value_validator_list':
                get_input_value_validator_list,
                'output_validator_list':
                get_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
            'list': {
                'input_type':
                list_input_type,
                'output_type':
                type.ReferenceType('com.vmware.nsx.model_client',
                                   'IpfixCollectorConfigListResult'),
                'errors':
                list_error_dict,
                'input_value_validator_list':
                list_input_value_validator_list,
                'output_validator_list':
                list_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
            'update': {
                'input_type':
                update_input_type,
                'output_type':
                type.ReferenceType('com.vmware.nsx.model_client',
                                   'IpfixCollectorConfig'),
                'errors':
                update_error_dict,
                'input_value_validator_list':
                update_input_value_validator_list,
                'output_validator_list':
                update_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
        }
        rest_metadata = {
            'create': create_rest_metadata,
            'delete': delete_rest_metadata,
            'get': get_rest_metadata,
            'list': list_rest_metadata,
            'update': update_rest_metadata,
        }
        ApiInterfaceStub.__init__(
            self,
            iface_name='com.vmware.nsx.ipfix.collectorconfigs',
            config=config,
            operations=operations,
            rest_metadata=rest_metadata,
            is_vapi_rest=False)
Пример #18
0
    def __init__(self, config):
        # properties for get operation
        get_input_type = type.StructType(
            'operation-input', {
                'vm': type.IdType(resource_types='VirtualMachine'),
            })
        get_error_dict = {
            'com.vmware.vapi.std.errors.error':
            type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        get_input_value_validator_list = []
        get_output_validator_list = []
        get_rest_metadata = OperationRestMetadata(
            http_method='GET',
            url_template='/vcenter/vm/{vm}/guest/power',
            path_variables={
                'vm': 'vm',
            },
            query_parameters={})

        # properties for shutdown operation
        shutdown_input_type = type.StructType(
            'operation-input', {
                'vm': type.IdType(resource_types='VirtualMachine'),
            })
        shutdown_error_dict = {
            'com.vmware.vapi.std.errors.error':
            type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
            'com.vmware.vapi.std.errors.already_in_desired_state':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'AlreadyInDesiredState'),
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.not_allowed_in_current_state':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotAllowedInCurrentState'),
            'com.vmware.vapi.std.errors.resource_busy':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ResourceBusy'),
            'com.vmware.vapi.std.errors.unsupported':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unsupported'),
        }
        shutdown_input_value_validator_list = []
        shutdown_output_validator_list = []
        shutdown_rest_metadata = OperationRestMetadata(
            http_method='POST',
            url_template='/vcenter/vm/{vm}/guest/power',
            path_variables={
                'vm': 'vm',
            },
            query_parameters={})

        # properties for reboot operation
        reboot_input_type = type.StructType(
            'operation-input', {
                'vm': type.IdType(resource_types='VirtualMachine'),
            })
        reboot_error_dict = {
            'com.vmware.vapi.std.errors.error':
            type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
            'com.vmware.vapi.std.errors.not_allowed_in_current_state':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotAllowedInCurrentState'),
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.resource_busy':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ResourceBusy'),
            'com.vmware.vapi.std.errors.unsupported':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unsupported'),
        }
        reboot_input_value_validator_list = []
        reboot_output_validator_list = []
        reboot_rest_metadata = OperationRestMetadata(
            http_method='POST',
            url_template='/vcenter/vm/{vm}/guest/power',
            path_variables={
                'vm': 'vm',
            },
            query_parameters={})

        # properties for standby operation
        standby_input_type = type.StructType(
            'operation-input', {
                'vm': type.IdType(resource_types='VirtualMachine'),
            })
        standby_error_dict = {
            'com.vmware.vapi.std.errors.error':
            type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
            'com.vmware.vapi.std.errors.already_in_desired_state':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'AlreadyInDesiredState'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.not_allowed_in_current_state':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotAllowedInCurrentState'),
            'com.vmware.vapi.std.errors.resource_busy':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ResourceBusy'),
            'com.vmware.vapi.std.errors.unsupported':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unsupported'),
        }
        standby_input_value_validator_list = []
        standby_output_validator_list = []
        standby_rest_metadata = OperationRestMetadata(
            http_method='POST',
            url_template='/vcenter/vm/{vm}/guest/power',
            path_variables={
                'vm': 'vm',
            },
            query_parameters={})

        operations = {
            'get': {
                'input_type': get_input_type,
                'output_type': type.ReferenceType(__name__, 'Power.Info'),
                'errors': get_error_dict,
                'input_value_validator_list': get_input_value_validator_list,
                'output_validator_list': get_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'shutdown': {
                'input_type': shutdown_input_type,
                'output_type': type.VoidType(),
                'errors': shutdown_error_dict,
                'input_value_validator_list':
                shutdown_input_value_validator_list,
                'output_validator_list': shutdown_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'reboot': {
                'input_type': reboot_input_type,
                'output_type': type.VoidType(),
                'errors': reboot_error_dict,
                'input_value_validator_list':
                reboot_input_value_validator_list,
                'output_validator_list': reboot_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'standby': {
                'input_type': standby_input_type,
                'output_type': type.VoidType(),
                'errors': standby_error_dict,
                'input_value_validator_list':
                standby_input_value_validator_list,
                'output_validator_list': standby_output_validator_list,
                'task_type': TaskType.NONE,
            },
        }
        rest_metadata = {
            'get': get_rest_metadata,
            'shutdown': shutdown_rest_metadata,
            'reboot': reboot_rest_metadata,
            'standby': standby_rest_metadata,
        }
        ApiInterfaceStub.__init__(
            self,
            iface_name='com.vmware.vcenter.vm.guest.power',
            config=config,
            operations=operations,
            rest_metadata=rest_metadata,
            is_vapi_rest=True)
Пример #19
0
    def __init__(self, config):
        # properties for add operation
        add_input_type = type.StructType('operation-input', {
            'group_name': type.StringType(),
        })
        add_error_dict = {
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.error':
            type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
        }
        add_input_value_validator_list = []
        add_output_validator_list = []
        add_rest_metadata = OperationRestMetadata(
            http_method='POST',
            url_template='/hvc/management/administrators',
            path_variables={},
            query_parameters={})

        # properties for remove operation
        remove_input_type = type.StructType('operation-input', {
            'group_name': type.StringType(),
        })
        remove_error_dict = {
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.error':
            type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
        }
        remove_input_value_validator_list = []
        remove_output_validator_list = []
        remove_rest_metadata = OperationRestMetadata(
            http_method='POST',
            url_template='/hvc/management/administrators',
            path_variables={},
            query_parameters={})

        # properties for set operation
        set_input_type = type.StructType(
            'operation-input', {
                'group_names': type.SetType(type.StringType()),
            })
        set_error_dict = {
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.error':
            type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
        }
        set_input_value_validator_list = []
        set_output_validator_list = []
        set_rest_metadata = OperationRestMetadata(
            http_method='PUT',
            url_template='/hvc/management/administrators',
            path_variables={},
            query_parameters={})

        # properties for get operation
        get_input_type = type.StructType('operation-input', {})
        get_error_dict = {
            'com.vmware.vapi.std.errors.error':
            type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
        }
        get_input_value_validator_list = []
        get_output_validator_list = []
        get_rest_metadata = OperationRestMetadata(
            http_method='GET',
            url_template='/hvc/management/administrators',
            path_variables={},
            query_parameters={})

        operations = {
            'add': {
                'input_type': add_input_type,
                'output_type': type.VoidType(),
                'errors': add_error_dict,
                'input_value_validator_list': add_input_value_validator_list,
                'output_validator_list': add_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'remove': {
                'input_type': remove_input_type,
                'output_type': type.VoidType(),
                'errors': remove_error_dict,
                'input_value_validator_list':
                remove_input_value_validator_list,
                'output_validator_list': remove_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'set': {
                'input_type': set_input_type,
                'output_type': type.VoidType(),
                'errors': set_error_dict,
                'input_value_validator_list': set_input_value_validator_list,
                'output_validator_list': set_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'get': {
                'input_type': get_input_type,
                'output_type': type.SetType(type.StringType()),
                'errors': get_error_dict,
                'input_value_validator_list': get_input_value_validator_list,
                'output_validator_list': get_output_validator_list,
                'task_type': TaskType.NONE,
            },
        }
        rest_metadata = {
            'add': add_rest_metadata,
            'remove': remove_rest_metadata,
            'set': set_rest_metadata,
            'get': get_rest_metadata,
        }
        ApiInterfaceStub.__init__(
            self,
            iface_name='com.vmware.vcenter.hvc.management.administrators',
            config=config,
            operations=operations,
            rest_metadata=rest_metadata,
            is_vapi_rest=True)
Пример #20
0
    def __init__(self, config):
        # properties for create operation
        create_input_type = type.StructType('operation-input', {})
        create_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),

        }
        create_input_value_validator_list = [
        ]
        create_output_validator_list = [
        ]
        create_rest_metadata = OperationRestMetadata(
            http_method='POST',
            url_template='/policy/api/v1/aaa/registration-token',
            path_variables={
            },
            query_parameters={
            }
        )

        # properties for delete operation
        delete_input_type = type.StructType('operation-input', {
            'token': type.StringType(),
        })
        delete_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),

        }
        delete_input_value_validator_list = [
        ]
        delete_output_validator_list = [
        ]
        delete_rest_metadata = OperationRestMetadata(
            http_method='DELETE',
            url_template='/policy/api/v1/aaa/registration-token/{token}',
            path_variables={
                'token': 'token',
            },
            query_parameters={
            }
        )

        # properties for get operation
        get_input_type = type.StructType('operation-input', {
            'token': type.StringType(),
        })
        get_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),

        }
        get_input_value_validator_list = [
        ]
        get_output_validator_list = [
        ]
        get_rest_metadata = OperationRestMetadata(
            http_method='GET',
            url_template='/policy/api/v1/aaa/registration-token/{token}',
            path_variables={
                'token': 'token',
            },
            query_parameters={
            }
        )

        operations = {
            'create': {
                'input_type': create_input_type,
                'output_type': type.ReferenceType('com.vmware.nsx_policy.model_client', 'RegistrationToken'),
                'errors': create_error_dict,
                'input_value_validator_list': create_input_value_validator_list,
                'output_validator_list': create_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'delete': {
                'input_type': delete_input_type,
                'output_type': type.VoidType(),
                'errors': delete_error_dict,
                'input_value_validator_list': delete_input_value_validator_list,
                'output_validator_list': delete_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'get': {
                'input_type': get_input_type,
                'output_type': type.ReferenceType('com.vmware.nsx_policy.model_client', 'RegistrationToken'),
                'errors': get_error_dict,
                'input_value_validator_list': get_input_value_validator_list,
                'output_validator_list': get_output_validator_list,
                'task_type': TaskType.NONE,
            },
        }
        rest_metadata = {
            'create': create_rest_metadata,
            'delete': delete_rest_metadata,
            'get': get_rest_metadata,
        }
        ApiInterfaceStub.__init__(
            self, iface_name='com.vmware.nsx_policy.aaa.registration_token',
            config=config, operations=operations, rest_metadata=rest_metadata,
            is_vapi_rest=False)
Пример #21
0
    def __init__(self, config):
        # properties for create operation
        create_input_type = type.StructType(
            'operation-input', {
                'service_id':
                type.StringType(),
                'base_service_instance':
                type.DynamicStructType(
                    'vmware.vapi.dynamic_struct', {}, VapiStruct, [
                        type.ReferenceType('com.vmware.nsx.model_client',
                                           'BaseServiceInstance')
                    ]),
            })
        create_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        create_input_value_validator_list = [HasFieldsOfValidator()]
        create_output_validator_list = [HasFieldsOfValidator()]
        create_rest_metadata = OperationRestMetadata(
            http_method='POST',
            url_template=
            '/api/v1/serviceinsertion/services/{service-id}/service-instances',
            request_body_parameter='base_service_instance',
            path_variables={
                'service_id': 'service-id',
            },
            query_parameters={},
            content_type='application/json')

        # properties for delete operation
        delete_input_type = type.StructType(
            'operation-input', {
                'service_id': type.StringType(),
                'service_instance_id': type.StringType(),
            })
        delete_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        delete_input_value_validator_list = []
        delete_output_validator_list = []
        delete_rest_metadata = OperationRestMetadata(
            http_method='DELETE',
            url_template=
            '/api/v1/serviceinsertion/services/{service-id}/service-instances/{service-instance-id}',
            path_variables={
                'service_id': 'service-id',
                'service_instance_id': 'service-instance-id',
            },
            query_parameters={},
            content_type='application/json')

        # properties for get operation
        get_input_type = type.StructType(
            'operation-input', {
                'service_id': type.StringType(),
                'service_instance_id': type.StringType(),
            })
        get_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        get_input_value_validator_list = []
        get_output_validator_list = [HasFieldsOfValidator()]
        get_rest_metadata = OperationRestMetadata(
            http_method='GET',
            url_template=
            '/api/v1/serviceinsertion/services/{service-id}/service-instances/{service-instance-id}',
            path_variables={
                'service_id': 'service-id',
                'service_instance_id': 'service-instance-id',
            },
            query_parameters={},
            content_type='application/json')

        # properties for list operation
        list_input_type = type.StructType('operation-input', {
            'service_id': type.StringType(),
        })
        list_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        list_input_value_validator_list = []
        list_output_validator_list = [HasFieldsOfValidator()]
        list_rest_metadata = OperationRestMetadata(
            http_method='GET',
            url_template=
            '/api/v1/serviceinsertion/services/{service-id}/service-instances',
            path_variables={
                'service_id': 'service-id',
            },
            query_parameters={},
            content_type='application/json')

        # properties for update operation
        update_input_type = type.StructType(
            'operation-input', {
                'service_id':
                type.StringType(),
                'service_instance_id':
                type.StringType(),
                'base_service_instance':
                type.DynamicStructType(
                    'vmware.vapi.dynamic_struct', {}, VapiStruct, [
                        type.ReferenceType('com.vmware.nsx.model_client',
                                           'BaseServiceInstance')
                    ]),
            })
        update_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        update_input_value_validator_list = [HasFieldsOfValidator()]
        update_output_validator_list = [HasFieldsOfValidator()]
        update_rest_metadata = OperationRestMetadata(
            http_method='PUT',
            url_template=
            '/api/v1/serviceinsertion/services/{service-id}/service-instances/{service-instance-id}',
            request_body_parameter='base_service_instance',
            path_variables={
                'service_id': 'service-id',
                'service_instance_id': 'service-instance-id',
            },
            query_parameters={},
            content_type='application/json')

        operations = {
            'create': {
                'input_type':
                create_input_type,
                'output_type':
                type.DynamicStructType(
                    'vmware.vapi.dynamic_struct', {}, VapiStruct, [
                        type.ReferenceType('com.vmware.nsx.model_client',
                                           'BaseServiceInstance')
                    ]),
                'errors':
                create_error_dict,
                'input_value_validator_list':
                create_input_value_validator_list,
                'output_validator_list':
                create_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
            'delete': {
                'input_type': delete_input_type,
                'output_type': type.VoidType(),
                'errors': delete_error_dict,
                'input_value_validator_list':
                delete_input_value_validator_list,
                'output_validator_list': delete_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'get': {
                'input_type':
                get_input_type,
                'output_type':
                type.DynamicStructType(
                    'vmware.vapi.dynamic_struct', {}, VapiStruct, [
                        type.ReferenceType('com.vmware.nsx.model_client',
                                           'BaseServiceInstance')
                    ]),
                'errors':
                get_error_dict,
                'input_value_validator_list':
                get_input_value_validator_list,
                'output_validator_list':
                get_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
            'list': {
                'input_type':
                list_input_type,
                'output_type':
                type.ReferenceType('com.vmware.nsx.model_client',
                                   'ServiceInstanceListResult'),
                'errors':
                list_error_dict,
                'input_value_validator_list':
                list_input_value_validator_list,
                'output_validator_list':
                list_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
            'update': {
                'input_type':
                update_input_type,
                'output_type':
                type.DynamicStructType(
                    'vmware.vapi.dynamic_struct', {}, VapiStruct, [
                        type.ReferenceType('com.vmware.nsx.model_client',
                                           'BaseServiceInstance')
                    ]),
                'errors':
                update_error_dict,
                'input_value_validator_list':
                update_input_value_validator_list,
                'output_validator_list':
                update_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
        }
        rest_metadata = {
            'create': create_rest_metadata,
            'delete': delete_rest_metadata,
            'get': get_rest_metadata,
            'list': list_rest_metadata,
            'update': update_rest_metadata,
        }
        ApiInterfaceStub.__init__(
            self,
            iface_name=
            'com.vmware.nsx.serviceinsertion.services.service_instances',
            config=config,
            operations=operations,
            rest_metadata=rest_metadata,
            is_vapi_rest=False)
Пример #22
0
    def __init__(self, config):
        # properties for create operation
        create_input_type = type.StructType(
            'operation-input', {
                'section_id':
                type.StringType(),
                'firewall_rule':
                type.ReferenceType('com.vmware.nsx.model_client',
                                   'FirewallRule'),
                'id':
                type.OptionalType(type.StringType()),
                'operation':
                type.OptionalType(type.StringType()),
            })
        create_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        create_input_value_validator_list = [HasFieldsOfValidator()]
        create_output_validator_list = [HasFieldsOfValidator()]
        create_rest_metadata = OperationRestMetadata(
            http_method='POST',
            url_template='/api/v1/firewall/sections/{section-id}/rules',
            request_body_parameter='firewall_rule',
            path_variables={
                'section_id': 'section-id',
            },
            query_parameters={
                'id': 'id',
                'operation': 'operation',
            },
            content_type='application/json')

        # properties for createmultiple operation
        createmultiple_input_type = type.StructType(
            'operation-input', {
                'section_id':
                type.StringType(),
                'firewall_rule_list':
                type.ReferenceType('com.vmware.nsx.model_client',
                                   'FirewallRuleList'),
                'id':
                type.OptionalType(type.StringType()),
                'operation':
                type.OptionalType(type.StringType()),
            })
        createmultiple_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        createmultiple_input_value_validator_list = [HasFieldsOfValidator()]
        createmultiple_output_validator_list = [HasFieldsOfValidator()]
        createmultiple_rest_metadata = OperationRestMetadata(
            http_method='POST',
            url_template=
            '/api/v1/firewall/sections/{section-id}/rules?action=create_multiple',
            request_body_parameter='firewall_rule_list',
            path_variables={
                'section_id': 'section-id',
            },
            query_parameters={
                'id': 'id',
                'operation': 'operation',
            },
            content_type='application/json')

        # properties for delete operation
        delete_input_type = type.StructType('operation-input', {
            'section_id': type.StringType(),
            'rule_id': type.StringType(),
        })
        delete_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        delete_input_value_validator_list = []
        delete_output_validator_list = []
        delete_rest_metadata = OperationRestMetadata(
            http_method='DELETE',
            url_template=
            '/api/v1/firewall/sections/{section-id}/rules/{rule-id}',
            path_variables={
                'section_id': 'section-id',
                'rule_id': 'rule-id',
            },
            query_parameters={},
            content_type='application/json')

        # properties for get operation
        get_input_type = type.StructType('operation-input', {
            'section_id': type.StringType(),
            'rule_id': type.StringType(),
        })
        get_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        get_input_value_validator_list = []
        get_output_validator_list = [HasFieldsOfValidator()]
        get_rest_metadata = OperationRestMetadata(
            http_method='GET',
            url_template=
            '/api/v1/firewall/sections/{section-id}/rules/{rule-id}',
            path_variables={
                'section_id': 'section-id',
                'rule_id': 'rule-id',
            },
            query_parameters={},
            content_type='application/json')

        # properties for list operation
        list_input_type = type.StructType(
            'operation-input', {
                'section_id': type.StringType(),
                'applied_tos': type.OptionalType(type.StringType()),
                'context_profiles': type.OptionalType(type.StringType()),
                'cursor': type.OptionalType(type.StringType()),
                'deep_search': type.OptionalType(type.BooleanType()),
                'destinations': type.OptionalType(type.StringType()),
                'extended_sources': type.OptionalType(type.StringType()),
                'filter_type': type.OptionalType(type.StringType()),
                'included_fields': type.OptionalType(type.StringType()),
                'page_size': type.OptionalType(type.IntegerType()),
                'search_invalid_references': type.OptionalType(
                    type.BooleanType()),
                'services': type.OptionalType(type.StringType()),
                'sort_ascending': type.OptionalType(type.BooleanType()),
                'sort_by': type.OptionalType(type.StringType()),
                'sources': type.OptionalType(type.StringType()),
            })
        list_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        list_input_value_validator_list = []
        list_output_validator_list = [HasFieldsOfValidator()]
        list_rest_metadata = OperationRestMetadata(
            http_method='GET',
            url_template='/api/v1/firewall/sections/{section-id}/rules',
            path_variables={
                'section_id': 'section-id',
            },
            query_parameters={
                'applied_tos': 'applied_tos',
                'context_profiles': 'context_profiles',
                'cursor': 'cursor',
                'deep_search': 'deep_search',
                'destinations': 'destinations',
                'extended_sources': 'extended_sources',
                'filter_type': 'filter_type',
                'included_fields': 'included_fields',
                'page_size': 'page_size',
                'search_invalid_references': 'search_invalid_references',
                'services': 'services',
                'sort_ascending': 'sort_ascending',
                'sort_by': 'sort_by',
                'sources': 'sources',
            },
            content_type='application/json')

        # properties for revise operation
        revise_input_type = type.StructType(
            'operation-input', {
                'section_id':
                type.StringType(),
                'rule_id':
                type.StringType(),
                'firewall_rule':
                type.ReferenceType('com.vmware.nsx.model_client',
                                   'FirewallRule'),
                'id':
                type.OptionalType(type.StringType()),
                'operation':
                type.OptionalType(type.StringType()),
            })
        revise_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        revise_input_value_validator_list = [HasFieldsOfValidator()]
        revise_output_validator_list = [HasFieldsOfValidator()]
        revise_rest_metadata = OperationRestMetadata(
            http_method='POST',
            url_template=
            '/api/v1/firewall/sections/{section-id}/rules/{rule-id}?action=revise',
            request_body_parameter='firewall_rule',
            path_variables={
                'section_id': 'section-id',
                'rule_id': 'rule-id',
            },
            query_parameters={
                'id': 'id',
                'operation': 'operation',
            },
            content_type='application/json')

        # properties for update operation
        update_input_type = type.StructType(
            'operation-input', {
                'section_id':
                type.StringType(),
                'rule_id':
                type.StringType(),
                'firewall_rule':
                type.ReferenceType('com.vmware.nsx.model_client',
                                   'FirewallRule'),
            })
        update_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        update_input_value_validator_list = [HasFieldsOfValidator()]
        update_output_validator_list = [HasFieldsOfValidator()]
        update_rest_metadata = OperationRestMetadata(
            http_method='PUT',
            url_template=
            '/api/v1/firewall/sections/{section-id}/rules/{rule-id}',
            request_body_parameter='firewall_rule',
            path_variables={
                'section_id': 'section-id',
                'rule_id': 'rule-id',
            },
            query_parameters={},
            content_type='application/json')

        operations = {
            'create': {
                'input_type':
                create_input_type,
                'output_type':
                type.ReferenceType('com.vmware.nsx.model_client',
                                   'FirewallRule'),
                'errors':
                create_error_dict,
                'input_value_validator_list':
                create_input_value_validator_list,
                'output_validator_list':
                create_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
            'createmultiple': {
                'input_type':
                createmultiple_input_type,
                'output_type':
                type.ReferenceType('com.vmware.nsx.model_client',
                                   'FirewallRuleList'),
                'errors':
                createmultiple_error_dict,
                'input_value_validator_list':
                createmultiple_input_value_validator_list,
                'output_validator_list':
                createmultiple_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
            'delete': {
                'input_type': delete_input_type,
                'output_type': type.VoidType(),
                'errors': delete_error_dict,
                'input_value_validator_list':
                delete_input_value_validator_list,
                'output_validator_list': delete_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'get': {
                'input_type':
                get_input_type,
                'output_type':
                type.ReferenceType('com.vmware.nsx.model_client',
                                   'FirewallRule'),
                'errors':
                get_error_dict,
                'input_value_validator_list':
                get_input_value_validator_list,
                'output_validator_list':
                get_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
            'list': {
                'input_type':
                list_input_type,
                'output_type':
                type.ReferenceType('com.vmware.nsx.model_client',
                                   'FirewallRuleListResult'),
                'errors':
                list_error_dict,
                'input_value_validator_list':
                list_input_value_validator_list,
                'output_validator_list':
                list_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
            'revise': {
                'input_type':
                revise_input_type,
                'output_type':
                type.ReferenceType('com.vmware.nsx.model_client',
                                   'FirewallRule'),
                'errors':
                revise_error_dict,
                'input_value_validator_list':
                revise_input_value_validator_list,
                'output_validator_list':
                revise_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
            'update': {
                'input_type':
                update_input_type,
                'output_type':
                type.ReferenceType('com.vmware.nsx.model_client',
                                   'FirewallRule'),
                'errors':
                update_error_dict,
                'input_value_validator_list':
                update_input_value_validator_list,
                'output_validator_list':
                update_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
        }
        rest_metadata = {
            'create': create_rest_metadata,
            'createmultiple': createmultiple_rest_metadata,
            'delete': delete_rest_metadata,
            'get': get_rest_metadata,
            'list': list_rest_metadata,
            'revise': revise_rest_metadata,
            'update': update_rest_metadata,
        }
        ApiInterfaceStub.__init__(
            self,
            iface_name='com.vmware.nsx.firewall.sections.rules',
            config=config,
            operations=operations,
            rest_metadata=rest_metadata,
            is_vapi_rest=False)
Пример #23
0
    def __init__(self, config):
        # properties for create operation
        create_input_type = type.StructType('operation-input', {
            'node_syslog_exporter_properties': type.ReferenceType('com.vmware.nsx.model_client', 'NodeSyslogExporterProperties'),
        })
        create_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'),
            'com.vmware.vapi.std.errors.concurrent_change':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'ConcurrentChange'),
            'com.vmware.vapi.std.errors.unauthorized':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),

        }
        create_input_value_validator_list = [
        ]
        create_output_validator_list = [
        ]
        create_rest_metadata = OperationRestMetadata(
            http_method='POST',
            url_template='/api/v1/node/services/syslog/exporters',
            request_body_parameter='node_syslog_exporter_properties',
            path_variables={
            },
            query_parameters={
            },
            content_type='application/json'
        )

        # properties for delete operation
        delete_input_type = type.StructType('operation-input', {
            'exporter_name': type.StringType(),
        })
        delete_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),

        }
        delete_input_value_validator_list = [
        ]
        delete_output_validator_list = [
        ]
        delete_rest_metadata = OperationRestMetadata(
            http_method='DELETE',
            url_template='/api/v1/node/services/syslog/exporters/{exporter-name}',
            path_variables={
                'exporter_name': 'exporter-name',
            },
            query_parameters={
            },
            content_type='application/json'
        )

        # properties for get operation
        get_input_type = type.StructType('operation-input', {
            'exporter_name': type.StringType(),
        })
        get_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),

        }
        get_input_value_validator_list = [
        ]
        get_output_validator_list = [
        ]
        get_rest_metadata = OperationRestMetadata(
            http_method='GET',
            url_template='/api/v1/node/services/syslog/exporters/{exporter-name}',
            path_variables={
                'exporter_name': 'exporter-name',
            },
            query_parameters={
            },
            content_type='application/json'
        )

        # properties for list operation
        list_input_type = type.StructType('operation-input', {})
        list_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),

        }
        list_input_value_validator_list = [
        ]
        list_output_validator_list = [
        ]
        list_rest_metadata = OperationRestMetadata(
            http_method='GET',
            url_template='/api/v1/node/services/syslog/exporters',
            path_variables={
            },
            query_parameters={
            },
            content_type='application/json'
        )

        operations = {
            'create': {
                'input_type': create_input_type,
                'output_type': type.ReferenceType('com.vmware.nsx.model_client', 'NodeSyslogExporterProperties'),
                'errors': create_error_dict,
                'input_value_validator_list': create_input_value_validator_list,
                'output_validator_list': create_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'delete': {
                'input_type': delete_input_type,
                'output_type': type.VoidType(),
                'errors': delete_error_dict,
                'input_value_validator_list': delete_input_value_validator_list,
                'output_validator_list': delete_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'get': {
                'input_type': get_input_type,
                'output_type': type.ReferenceType('com.vmware.nsx.model_client', 'NodeSyslogExporterProperties'),
                'errors': get_error_dict,
                'input_value_validator_list': get_input_value_validator_list,
                'output_validator_list': get_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'list': {
                'input_type': list_input_type,
                'output_type': type.ReferenceType('com.vmware.nsx.model_client', 'NodeSyslogExporterPropertiesListResult'),
                'errors': list_error_dict,
                'input_value_validator_list': list_input_value_validator_list,
                'output_validator_list': list_output_validator_list,
                'task_type': TaskType.NONE,
            },
        }
        rest_metadata = {
            'create': create_rest_metadata,
            'delete': delete_rest_metadata,
            'get': get_rest_metadata,
            'list': list_rest_metadata,
        }
        ApiInterfaceStub.__init__(
            self, iface_name='com.vmware.nsx.node.services.syslog.exporters',
            config=config, operations=operations, rest_metadata=rest_metadata,
            is_vapi_rest=False)
    def __init__(self, config):
        # properties for set operation
        set_input_type = type.StructType('operation-input', {
            'name': type.StringType(),
        })
        set_error_dict = {
            'com.vmware.vapi.std.errors.invalid_argument':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidArgument'),
            'com.vmware.vapi.std.errors.error':
            type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
        }
        set_input_value_validator_list = []
        set_output_validator_list = []
        set_rest_metadata = OperationRestMetadata(
            http_method='PUT',
            url_template='/appliance/system/time/timezone',
            path_variables={},
            query_parameters={})

        # properties for get operation
        get_input_type = type.StructType('operation-input', {})
        get_error_dict = {
            'com.vmware.vapi.std.errors.error':
            type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
        }
        get_input_value_validator_list = []
        get_output_validator_list = []
        get_rest_metadata = OperationRestMetadata(
            http_method='GET',
            url_template='/appliance/system/time/timezone',
            path_variables={},
            query_parameters={})

        operations = {
            'set': {
                'input_type': set_input_type,
                'output_type': type.VoidType(),
                'errors': set_error_dict,
                'input_value_validator_list': set_input_value_validator_list,
                'output_validator_list': set_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'get': {
                'input_type': get_input_type,
                'output_type': type.StringType(),
                'errors': get_error_dict,
                'input_value_validator_list': get_input_value_validator_list,
                'output_validator_list': get_output_validator_list,
                'task_type': TaskType.NONE,
            },
        }
        rest_metadata = {
            'set': set_rest_metadata,
            'get': get_rest_metadata,
        }
        ApiInterfaceStub.__init__(
            self,
            iface_name='com.vmware.appliance.system.time.timezone',
            config=config,
            operations=operations,
            rest_metadata=rest_metadata,
            is_vapi_rest=True)
Пример #25
0
    def __init__(self, config):
        # properties for create operation
        create_input_type = type.StructType(
            'operation-input', {
                'spec': type.ReferenceType(__name__, 'Links.CreateSpec'),
            })
        create_error_dict = {
            'com.vmware.vapi.std.errors.already_exists':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'AlreadyExists'),
            'com.vmware.vapi.std.errors.invalid_argument':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidArgument'),
            'com.vmware.vapi.std.errors.unsupported':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unsupported'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.unverified_peer':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'UnverifiedPeer'),
            'com.vmware.vapi.std.errors.error':
            type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
        }
        create_input_value_validator_list = []
        create_output_validator_list = []
        create_rest_metadata = OperationRestMetadata(
            http_method='POST',
            url_template='/hvc/links',
            path_variables={},
            query_parameters={},
            content_type='application/json')

        # properties for delete operation
        delete_input_type = type.StructType('operation-input', {
            'link':
            type.IdType(resource_types='com.vmware.vcenter.hvc.Links'),
        })
        delete_error_dict = {
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.error':
            type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
        }
        delete_input_value_validator_list = []
        delete_output_validator_list = []
        delete_rest_metadata = OperationRestMetadata(
            http_method='DELETE',
            url_template='/hvc/links/{link_id}',
            path_variables={
                'link': 'link_id',
            },
            query_parameters={},
            content_type='application/json')

        # properties for list operation
        list_input_type = type.StructType('operation-input', {})
        list_error_dict = {
            'com.vmware.vapi.std.errors.error':
            type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
        }
        list_input_value_validator_list = []
        list_output_validator_list = []
        list_rest_metadata = OperationRestMetadata(
            http_method='GET',
            url_template='/hvc/links',
            path_variables={},
            query_parameters={},
            content_type='application/json')

        operations = {
            'create': {
                'input_type':
                create_input_type,
                'output_type':
                type.IdType(resource_types='com.vmware.vcenter.hvc.Links'),
                'errors':
                create_error_dict,
                'input_value_validator_list':
                create_input_value_validator_list,
                'output_validator_list':
                create_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
            'delete': {
                'input_type': delete_input_type,
                'output_type': type.VoidType(),
                'errors': delete_error_dict,
                'input_value_validator_list':
                delete_input_value_validator_list,
                'output_validator_list': delete_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'list': {
                'input_type':
                list_input_type,
                'output_type':
                type.ListType(type.ReferenceType(__name__, 'Links.Summary')),
                'errors':
                list_error_dict,
                'input_value_validator_list':
                list_input_value_validator_list,
                'output_validator_list':
                list_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
        }
        rest_metadata = {
            'create': create_rest_metadata,
            'delete': delete_rest_metadata,
            'list': list_rest_metadata,
        }
        ApiInterfaceStub.__init__(self,
                                  iface_name='com.vmware.vcenter.hvc.links',
                                  config=config,
                                  operations=operations,
                                  rest_metadata=rest_metadata,
                                  is_vapi_rest=True)
    def __init__(self, config):
        # properties for list operation
        list_input_type = type.StructType('operation-input', {
            'link': type.IdType(resource_types='com.vmware.vcenter.hvc.Links'),
        })
        list_error_dict = {
            'com.vmware.vapi.std.errors.error':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
            'com.vmware.vapi.std.errors.unauthorized':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),

        }
        list_input_value_validator_list = [
        ]
        list_output_validator_list = [
        ]
        list_rest_metadata = OperationRestMetadata(
            http_method='GET',
            url_template='/hvc/links/{link_id}/sync/providers',
            path_variables={
                'link': 'link_id',
            },
            query_parameters={
            }
        )

        # properties for get operation
        get_input_type = type.StructType('operation-input', {
            'link': type.IdType(resource_types='com.vmware.vcenter.hvc.Links'),
            'provider': type.IdType(resource_types='com.vmware.vcenter.hvc.sync.Providers'),
        })
        get_error_dict = {
            'com.vmware.vapi.std.errors.error':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
            'com.vmware.vapi.std.errors.not_found':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),
            'com.vmware.vapi.std.errors.unauthorized':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),

        }
        get_input_value_validator_list = [
        ]
        get_output_validator_list = [
        ]
        get_rest_metadata = OperationRestMetadata(
            http_method='GET',
            url_template='/hvc/links/{link_id}/sync/providers/{provider_id}',
            path_variables={
                'link': 'link_id',
                'provider': 'provider_id',
            },
            query_parameters={
            }
        )

        # properties for start operation
        start_input_type = type.StructType('operation-input', {
            'link': type.IdType(resource_types='com.vmware.vcenter.hvc.Links'),
            'provider': type.IdType(resource_types='com.vmware.vcenter.hvc.sync.Providers'),
        })
        start_error_dict = {
            'com.vmware.vapi.std.errors.error':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
            'com.vmware.vapi.std.errors.not_found':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),
            'com.vmware.vapi.std.errors.unauthorized':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),
            'com.vmware.vapi.std.errors.resource_busy':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'ResourceBusy'),

        }
        start_input_value_validator_list = [
        ]
        start_output_validator_list = [
        ]
        start_rest_metadata = OperationRestMetadata(
            http_method='POST',
            url_template='/hvc/links/{link_id}/sync/providers/{provider_id}?action=start',
            path_variables={
                'link': 'link_id',
                'provider': 'provider_id',
            },
            query_parameters={
            }
        )

        operations = {
            'list': {
                'input_type': list_input_type,
                'output_type': type.ListType(type.ReferenceType(__name__, 'Providers.Summary')),
                'errors': list_error_dict,
                'input_value_validator_list': list_input_value_validator_list,
                'output_validator_list': list_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'get': {
                'input_type': get_input_type,
                'output_type': type.ReferenceType(__name__, 'Providers.Info'),
                'errors': get_error_dict,
                'input_value_validator_list': get_input_value_validator_list,
                'output_validator_list': get_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'start': {
                'input_type': start_input_type,
                'output_type': type.VoidType(),
                'errors': start_error_dict,
                'input_value_validator_list': start_input_value_validator_list,
                'output_validator_list': start_output_validator_list,
                'task_type': TaskType.NONE,
            },
        }
        rest_metadata = {
            'list': list_rest_metadata,
            'get': get_rest_metadata,
            'start': start_rest_metadata,
        }
        ApiInterfaceStub.__init__(
            self, iface_name='com.vmware.vcenter.hvc.links.sync.providers',
            config=config, operations=operations, rest_metadata=rest_metadata,
            is_vapi_rest=True)
Пример #27
0
    def __init__(self, config):
        # properties for list operation
        list_input_type = type.StructType(
            'operation-input', {
                'spec':
                type.OptionalType(
                    type.ReferenceType(__name__, 'Services.FilterSpec')),
            })
        list_error_dict = {
            'com.vmware.vapi.std.errors.error':
            type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
            'com.vmware.vapi.std.errors.unauthenticated':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthenticated'),
        }
        list_input_value_validator_list = []
        list_output_validator_list = []
        list_rest_metadata = OperationRestMetadata(
            http_method='POST',
            url_template='/vcenter/trusted-infrastructure/kms/services',
            request_body_parameter='spec',
            path_variables={},
            query_parameters={},
            dispatch_parameters={
                'action': 'query',
            },
            header_parameters={},
            dispatch_header_parameters={})

        # properties for get operation
        get_input_type = type.StructType(
            'operation-input', {
                'service':
                type.IdType(
                    resource_types=
                    'com.vmware.vcenter.trusted_infrastructure.kms.Service'),
            })
        get_error_dict = {
            'com.vmware.vapi.std.errors.error':
            type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
            'com.vmware.vapi.std.errors.unauthenticated':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthenticated'),
        }
        get_input_value_validator_list = []
        get_output_validator_list = []
        get_rest_metadata = OperationRestMetadata(
            http_method='GET',
            url_template=
            '/vcenter/trusted-infrastructure/kms/services/{service}',
            path_variables={
                'service': 'service',
            },
            query_parameters={},
            dispatch_parameters={},
            header_parameters={},
            dispatch_header_parameters={})

        # properties for create operation
        create_input_type = type.StructType(
            'operation-input', {
                'spec': type.ReferenceType(__name__, 'Services.CreateSpec'),
            })
        create_error_dict = {
            'com.vmware.vapi.std.errors.already_exists':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'AlreadyExists'),
            'com.vmware.vapi.std.errors.error':
            type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
            'com.vmware.vapi.std.errors.invalid_argument':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidArgument'),
            'com.vmware.vapi.std.errors.unauthenticated':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthenticated'),
        }
        create_input_value_validator_list = []
        create_output_validator_list = []
        create_rest_metadata = OperationRestMetadata(
            http_method='POST',
            url_template='/vcenter/trusted-infrastructure/kms/services',
            request_body_parameter='spec',
            path_variables={},
            query_parameters={},
            dispatch_parameters={},
            header_parameters={},
            dispatch_header_parameters={})

        # properties for delete operation
        delete_input_type = type.StructType(
            'operation-input', {
                'service':
                type.IdType(
                    resource_types=
                    'com.vmware.vcenter.trusted_infrastructure.kms.Service'),
            })
        delete_error_dict = {
            'com.vmware.vapi.std.errors.error':
            type.ReferenceType('com.vmware.vapi.std.errors_client', 'Error'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
            'com.vmware.vapi.std.errors.resource_busy':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'ResourceBusy'),
            'com.vmware.vapi.std.errors.unauthenticated':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthenticated'),
        }
        delete_input_value_validator_list = []
        delete_output_validator_list = []
        delete_rest_metadata = OperationRestMetadata(
            http_method='DELETE',
            url_template=
            '/vcenter/trusted-infrastructure/kms/services/{service}',
            path_variables={
                'service': 'service',
            },
            query_parameters={},
            dispatch_parameters={},
            header_parameters={},
            dispatch_header_parameters={})

        operations = {
            'list': {
                'input_type':
                list_input_type,
                'output_type':
                type.ListType(type.ReferenceType(__name__,
                                                 'Services.Summary')),
                'errors':
                list_error_dict,
                'input_value_validator_list':
                list_input_value_validator_list,
                'output_validator_list':
                list_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
            'get': {
                'input_type': get_input_type,
                'output_type': type.ReferenceType(__name__, 'Services.Info'),
                'errors': get_error_dict,
                'input_value_validator_list': get_input_value_validator_list,
                'output_validator_list': get_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'create': {
                'input_type':
                create_input_type,
                'output_type':
                type.IdType(
                    resource_types=
                    'com.vmware.vcenter.trusted_infrastructure.kms.Service'),
                'errors':
                create_error_dict,
                'input_value_validator_list':
                create_input_value_validator_list,
                'output_validator_list':
                create_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
            'delete': {
                'input_type': delete_input_type,
                'output_type': type.VoidType(),
                'errors': delete_error_dict,
                'input_value_validator_list':
                delete_input_value_validator_list,
                'output_validator_list': delete_output_validator_list,
                'task_type': TaskType.NONE,
            },
        }
        rest_metadata = {
            'list': list_rest_metadata,
            'get': get_rest_metadata,
            'create': create_rest_metadata,
            'delete': delete_rest_metadata,
        }
        ApiInterfaceStub.__init__(
            self,
            iface_name='com.vmware.vcenter.trusted_infrastructure.kms.services',
            config=config,
            operations=operations,
            rest_metadata=rest_metadata,
            is_vapi_rest=True)
Пример #28
0
    def __init__(self, config):
        # properties for delete operation
        delete_input_type = type.StructType(
            'operation-input', {
                'org': type.StringType(),
                'sddc': type.StringType(),
                'edge_id': type.StringType(),
            })
        delete_error_dict = {
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        delete_input_value_validator_list = []
        delete_output_validator_list = []
        delete_rest_metadata = OperationRestMetadata(
            http_method='DELETE',
            url_template=
            '/vmc/api/orgs/{org}/sddcs/{sddc}/networks/4.0/edges/{edgeId}/firewall/config',
            path_variables={
                'org': 'org',
                'sddc': 'sddc',
                'edge_id': 'edgeId',
            },
            query_parameters={})

        # properties for get operation
        get_input_type = type.StructType(
            'operation-input', {
                'org': type.StringType(),
                'sddc': type.StringType(),
                'edge_id': type.StringType(),
            })
        get_error_dict = {
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        get_input_value_validator_list = []
        get_output_validator_list = []
        get_rest_metadata = OperationRestMetadata(
            http_method='GET',
            url_template=
            '/vmc/api/orgs/{org}/sddcs/{sddc}/networks/4.0/edges/{edgeId}/firewall/config',
            path_variables={
                'org': 'org',
                'sddc': 'sddc',
                'edge_id': 'edgeId',
            },
            query_parameters={})

        # properties for update operation
        update_input_type = type.StructType(
            'operation-input', {
                'org':
                type.StringType(),
                'sddc':
                type.StringType(),
                'edge_id':
                type.StringType(),
                'firewall_config':
                type.ReferenceType('com.vmware.vmc.model_client',
                                   'FirewallConfig'),
            })
        update_error_dict = {
            'com.vmware.vapi.std.errors.invalid_request':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'InvalidRequest'),
            'com.vmware.vapi.std.errors.unauthorized':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
            type.ReferenceType('com.vmware.vapi.std.errors_client',
                               'NotFound'),
        }
        update_input_value_validator_list = []
        update_output_validator_list = []
        update_rest_metadata = OperationRestMetadata(
            http_method='PUT',
            url_template=
            '/vmc/api/orgs/{org}/sddcs/{sddc}/networks/4.0/edges/{edgeId}/firewall/config',
            request_body_parameter='firewall_config',
            path_variables={
                'org': 'org',
                'sddc': 'sddc',
                'edge_id': 'edgeId',
            },
            query_parameters={})

        operations = {
            'delete': {
                'input_type': delete_input_type,
                'output_type': type.VoidType(),
                'errors': delete_error_dict,
                'input_value_validator_list':
                delete_input_value_validator_list,
                'output_validator_list': delete_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'get': {
                'input_type':
                get_input_type,
                'output_type':
                type.ReferenceType('com.vmware.vmc.model_client',
                                   'FirewallConfig'),
                'errors':
                get_error_dict,
                'input_value_validator_list':
                get_input_value_validator_list,
                'output_validator_list':
                get_output_validator_list,
                'task_type':
                TaskType.NONE,
            },
            'update': {
                'input_type': update_input_type,
                'output_type': type.VoidType(),
                'errors': update_error_dict,
                'input_value_validator_list':
                update_input_value_validator_list,
                'output_validator_list': update_output_validator_list,
                'task_type': TaskType.NONE,
            },
        }
        rest_metadata = {
            'delete': delete_rest_metadata,
            'get': get_rest_metadata,
            'update': update_rest_metadata,
        }
        ApiInterfaceStub.__init__(
            self,
            iface_name=
            'com.vmware.vmc.orgs.sddcs.networks.edges.firewall.config',
            config=config,
            operations=operations,
            rest_metadata=rest_metadata,
            is_vapi_rest=False)
Пример #29
0
    def __init__(self, config):
        # properties for get operation
        get_input_type = type.StructType('operation-input', {})
        get_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),

        }
        get_input_value_validator_list = [
        ]
        get_output_validator_list = [
        ]
        get_rest_metadata = OperationRestMetadata(
            http_method='GET',
            url_template='/policy/api/v1/infra/settings/firewall/security',
            path_variables={
            },
            query_parameters={
            },
            content_type='application/json'
        )

        # properties for patch operation
        patch_input_type = type.StructType('operation-input', {
            'dfw_firewall_configuration': type.ReferenceType('com.vmware.nsx_policy.model_client', 'DfwFirewallConfiguration'),
        })
        patch_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),

        }
        patch_input_value_validator_list = [
        ]
        patch_output_validator_list = [
        ]
        patch_rest_metadata = OperationRestMetadata(
            http_method='PATCH',
            url_template='/policy/api/v1/infra/settings/firewall/security',
            request_body_parameter='dfw_firewall_configuration',
            path_variables={
            },
            query_parameters={
            },
            content_type='application/json'
        )

        # properties for update operation
        update_input_type = type.StructType('operation-input', {
            'dfw_firewall_configuration': type.ReferenceType('com.vmware.nsx_policy.model_client', 'DfwFirewallConfiguration'),
        })
        update_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),

        }
        update_input_value_validator_list = [
        ]
        update_output_validator_list = [
        ]
        update_rest_metadata = OperationRestMetadata(
            http_method='PUT',
            url_template='/policy/api/v1/infra/settings/firewall/security',
            request_body_parameter='dfw_firewall_configuration',
            path_variables={
            },
            query_parameters={
            },
            content_type='application/json'
        )

        operations = {
            'get': {
                'input_type': get_input_type,
                'output_type': type.ReferenceType('com.vmware.nsx_policy.model_client', 'DfwFirewallConfiguration'),
                'errors': get_error_dict,
                'input_value_validator_list': get_input_value_validator_list,
                'output_validator_list': get_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'patch': {
                'input_type': patch_input_type,
                'output_type': type.VoidType(),
                'errors': patch_error_dict,
                'input_value_validator_list': patch_input_value_validator_list,
                'output_validator_list': patch_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'update': {
                'input_type': update_input_type,
                'output_type': type.ReferenceType('com.vmware.nsx_policy.model_client', 'DfwFirewallConfiguration'),
                'errors': update_error_dict,
                'input_value_validator_list': update_input_value_validator_list,
                'output_validator_list': update_output_validator_list,
                'task_type': TaskType.NONE,
            },
        }
        rest_metadata = {
            'get': get_rest_metadata,
            'patch': patch_rest_metadata,
            'update': update_rest_metadata,
        }
        ApiInterfaceStub.__init__(
            self, iface_name='com.vmware.nsx_policy.infra.settings.firewall.security',
            config=config, operations=operations, rest_metadata=rest_metadata,
            is_vapi_rest=False)
    def __init__(self, config):
        # properties for create operation
        create_input_type = type.StructType('operation-input', {
            'container_cluster_status': type.ReferenceType('com.vmware.nsx.model_client', 'ContainerClusterStatus'),
        })
        create_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),

        }
        create_input_value_validator_list = [
        ]
        create_output_validator_list = [
        ]
        create_rest_metadata = OperationRestMetadata(
            http_method='POST',
            url_template='/api/v1/systemhealth/container-cluster/ncp/status',
            request_body_parameter='container_cluster_status',
            path_variables={
            },
            query_parameters={
            },
            content_type='application/json'
        )

        # properties for delete operation
        delete_input_type = type.StructType('operation-input', {
            'cluster_id': type.StringType(),
        })
        delete_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),

        }
        delete_input_value_validator_list = [
        ]
        delete_output_validator_list = [
        ]
        delete_rest_metadata = OperationRestMetadata(
            http_method='DELETE',
            url_template='/api/v1/systemhealth/container-cluster/{cluster-id}/ncp/status',
            path_variables={
                'cluster_id': 'cluster-id',
            },
            query_parameters={
            },
            content_type='application/json'
        )

        # properties for get operation
        get_input_type = type.StructType('operation-input', {
            'cursor': type.OptionalType(type.StringType()),
            'included_fields': type.OptionalType(type.StringType()),
            'page_size': type.OptionalType(type.IntegerType()),
            'sort_ascending': type.OptionalType(type.BooleanType()),
            'sort_by': type.OptionalType(type.StringType()),
        })
        get_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),

        }
        get_input_value_validator_list = [
        ]
        get_output_validator_list = [
        ]
        get_rest_metadata = OperationRestMetadata(
            http_method='GET',
            url_template='/api/v1/systemhealth/container-cluster/ncp/status',
            path_variables={
            },
            query_parameters={
                'cursor': 'cursor',
                'included_fields': 'included_fields',
                'page_size': 'page_size',
                'sort_ascending': 'sort_ascending',
                'sort_by': 'sort_by',
            },
            content_type='application/json'
        )

        # properties for get_0 operation
        get_0_input_type = type.StructType('operation-input', {
            'cluster_id': type.StringType(),
        })
        get_0_error_dict = {
            'com.vmware.vapi.std.errors.service_unavailable':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'ServiceUnavailable'),
            'com.vmware.vapi.std.errors.invalid_request':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'InvalidRequest'),
            'com.vmware.vapi.std.errors.internal_server_error':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'InternalServerError'),
            'com.vmware.vapi.std.errors.unauthorized':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'Unauthorized'),
            'com.vmware.vapi.std.errors.not_found':
                type.ReferenceType('com.vmware.vapi.std.errors_client', 'NotFound'),

        }
        get_0_input_value_validator_list = [
        ]
        get_0_output_validator_list = [
        ]
        get_0_rest_metadata = OperationRestMetadata(
            http_method='GET',
            url_template='/api/v1/systemhealth/container-cluster/{cluster-id}/ncp/status',
            path_variables={
                'cluster_id': 'cluster-id',
            },
            query_parameters={
            },
            content_type='application/json'
        )

        operations = {
            'create': {
                'input_type': create_input_type,
                'output_type': type.ReferenceType('com.vmware.nsx.model_client', 'ContainerClusterStatus'),
                'errors': create_error_dict,
                'input_value_validator_list': create_input_value_validator_list,
                'output_validator_list': create_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'delete': {
                'input_type': delete_input_type,
                'output_type': type.VoidType(),
                'errors': delete_error_dict,
                'input_value_validator_list': delete_input_value_validator_list,
                'output_validator_list': delete_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'get': {
                'input_type': get_input_type,
                'output_type': type.ReferenceType('com.vmware.nsx.model_client', 'ContainerClusterStatusList'),
                'errors': get_error_dict,
                'input_value_validator_list': get_input_value_validator_list,
                'output_validator_list': get_output_validator_list,
                'task_type': TaskType.NONE,
            },
            'get_0': {
                'input_type': get_0_input_type,
                'output_type': type.ReferenceType('com.vmware.nsx.model_client', 'ContainerClusterSummary'),
                'errors': get_0_error_dict,
                'input_value_validator_list': get_0_input_value_validator_list,
                'output_validator_list': get_0_output_validator_list,
                'task_type': TaskType.NONE,
            },
        }
        rest_metadata = {
            'create': create_rest_metadata,
            'delete': delete_rest_metadata,
            'get': get_rest_metadata,
            'get_0': get_0_rest_metadata,
        }
        ApiInterfaceStub.__init__(
            self, iface_name='com.vmware.nsx.systemhealth.container_cluster.ncp.status',
            config=config, operations=operations, rest_metadata=rest_metadata,
            is_vapi_rest=False)