Class CreateResourceHandler


  • public class CreateResourceHandler
    extends Object
    Handler for the ingestion resource creation process. A new instance of the handler must be created using the builder.

    For more information about the resource creation process see createResource.

    • Method Detail

      • createResource

        public static Variant createResource​(Session session,
                                             String name,
                                             Variant resourceId,
                                             Variant ingestionConfigurations,
                                             String id,
                                             boolean enabled,
                                             Variant resourceMetadata)
        Default handler method for the PUBLIC.CREATE_RESOURCE procedure.
        Parameters:
        session - Snowpark session object
        name - resource name
        resourceId - properties which identify the resource in the source system
        ingestionConfigurations - resource ingestion configurations
        id - resource ingestion definition id
        enabled - should the ingestion for the resource be enabled
        resourceMetadata - additional resource metadata
        Returns:
        a variant representing the ConnectorResponse returned by createResource
      • createResource

        public ConnectorResponse createResource​(String id,
                                                String name,
                                                boolean enabled,
                                                Variant resourceId,
                                                Variant resourceMetadata,
                                                Variant ingestionConfigurations)
        Executes the main logic of the handler, with logging using withExceptionLogging.

        The resource creation process consists of:

        Parameters:
        id - resource ingestion definition id
        name - resource name
        enabled - should the ingestion for the resource be enabled
        resourceId - properties which identify the resource in the source system
        resourceMetadata - additional resource metadata
        ingestionConfigurations - resource ingestion configurations
        Returns:
        a response with the code OK if the execution was successful, otherwise a response with an error code and an error message