X4 Produktdokumentation

Microsoft Azure Blob Storage Connector

This adapter allows you to connect to a Microsoft Azure Blob storage to perform various operations.

Properties

Operation

Operation executed by the adapter

Possible values:

The containerName and blobName parameters are required for all operations.

  • Search: Searches for information (containers or blobs) in the Microsoft Azure account

  • Append: Adds information about the selected blob in the Microsoft Azure account
    Required parameters: fileLocation

  • Upload: Uploads containers or blobs or creates containers or blobs in the Microsoft Azure account
    Required parameters: fileLocation

  • Download: Downloads a blob from the Microsoft Azure account

  • Delete : Deletes a container or blob from the Microsoft Azure account

  • UpdateDirectory: Updates the name of the source directory with the name of the destination directory
    Required parameters: sourceDirectoryName, targetDirectoryName

  • MoveDirectory: Moves the content from the source directory to the destination directory
    Required parameters: sourceDirectoryName , targetDirectoryName

  • DeleteDirectory: Deletes the content of the source directory
    Required parameters: sourceDirectoryName, targetDirectoryName

  • MoveBlobDirectory: Moves a specific blob from the source directory to the destination directory
    Required parameters: sourceDirectoryName, targetDirectoryName

Parameters

accountName

Name of the Microsoft Azure account

Possible values: Any string (for example, MQSR2402)

accountKey

Password for the Microsoft Azure account

Possible values: Any string with the key, e.g. AD9ohFhJ6Hve9ODJEXTw53MjR1tjoUZ8lWfDlw5UFqGMih3VtUCapIwIfEMBmITeShQN9MbCITE4SzxTcGIybw

containerName

Name of the container in which the blobs are organized

Possible values: Any string with the name

Container names must meet the following naming conventions:

    • Container names must begin with a letter or number and can only contain letters, numbers, or hyphens (-)

    • Each hyphen (-) must be immediately before and after a letter or number; consecutive hyphens are not allowed in container names

    • Container names can only contain lowercase letters

    • Container names must be between 3 and 63 characters

blobName

Name of the stored blobs

Possible values: Any string with the blob name

Blob names must meet the following naming conventions:

    • Blob names can contain any combination of characters

    • Blob names must be at least one character and must not exceed 1,024 characters

    • Blob names are case-sensitive

    • Reserved URL characters must be properly masked

    • The number of path segments that include the blob name must not exceed 254. A path segment is the string between successive delimiters (for example, the forward slash '/') that match the name of a virtual directory.

fileLocation

Path of the file to upload; this parameter is only valid for the Upload operation.

Possible values:

  • System path, e.g.: C:\X4\V_5.9\Server\X4DB\1\ExampleProcess\GoogleCloud\Config\serviceAccountFile.json

  • X4db path, for example, x4db://1/ExampleProcess/MAzureBlobStore/Data/TextDocument.txt

  • Xstore path, such as XStore://ExampleProcess/MAzureBlobStore/Data/TextDocument.txt

overwrite

Information on whether blobs should be overwritten or not

sourceDirectoryName

Name of the source directory for all Directory operations

Possible values: Any valid string with a concluding /, e.g. sourceFolder/

targetDirectoryName

Name of the destination directory for all Directory operations

Possible values: Any valid string with a concluding / , e.g. targetFolder/

Status values

1

The adapter operation was executed successfully

-1

An error occurred during execution

0

  • Download operation: The blob to download does not exist

  • Delete operation: The blob to be deleted does not exist

  • UpdateDirectory, MoveDirectory, DeleteDirectory, MoveBlobDirectory operations:

    • the source directory does not exist

    • the target directory could not be found (MoveDirectory , MoveBlobDirectory operations)

    • the blob does not exist in the source directory (MoveBlobDirectory operation)

Input

The adapter expects any input document, for example, a binary or Base64 document (XML or text).

  • Upload operation: If the fileLocation parameter is specified, the input document can be omitted. In all other cases, an input document is expected.

  • All other operations do not require an input document.

Output

Depending on the selected operation, the adapter returns various documents:

Upload operation:

  • If the operation was executed successful (Status 1, the adapter prints an XML document containing the URL of the uploaded file or document.

    Upload operation: Status 1

    XML
    <?xml version="1.0" encoding="UTF-8"
    <BLOB>
    	<Upload>https://storage_account_name.blob.core.windows.net/container_name/blob_name</Upload>
    </BLOB>
    
  • In the event of an error (status -1 ), the output corresponds to the input document.

Search operation:

  • If the operation is successful (status 1), the adapter outputs an XML document containing all the containers and their Blob URI objects.

    Search operation: Status 1

    XML
    <?xml version="1.0" encoding="UTF-8"
    <ListBlobs>
    	<Container name="pc-files">
    		<Blob name="C-structure.xml">https://softproject.blob.core.windows.net/pc-files/C-structure.xml</Blob>
    		<Blob name="XStore_WordDocument.doc">https://softproject.blob.core.windows.net/pc-files/XStore_WordDocument.doc</Blob>
    		<Blob name="jar_files(1).zip">https://softproject.blob.core.windows.net/pc-files/jar_files(1).zip</Blob>
    		<Blob name="x4db/HipChat-4.30.6.1676.exe">https://softproject.blob.core.windows.net/pc-files/x4db/HipChat-4.30.6.1676.exe</Blob>
    		<Blob name="xstore/MWDocument.doc">https://softproject.blob.core.windows.net/pc-files/xstore/MWDocument.doc</Blob>
    	</Container>
    	<Container name="testcontainer-prototype">
    		<Blob name="base64Files/file1">https://softproject.blob.core.windows.net/testcontainer-prototype/base64Files/file1</Blob>
    		<Blob name="documents/doc1">https://softproject.blob.core.windows.net/testcontainer-prototype/documents/doc1</Blob>
    		<Blob name="documents/doc1.docx">https://softproject.blob.core.windows.net/testcontainer-prototype/documents/doc1.docx</Blob>
    		<Blob name="imagesFiles/image1">https://softproject.blob.core.windows.net/testcontainer-prototype/imagesFiles/image1</Blob>
    		<Blob name="textFiles/subTextFiles/text5.txt">https://softproject.blob.core.windows.net/testcontainer-prototype/textFiles/subTextFiles/text5.txt</Blob>
    		<Blob name="xml1.xml">https://softproject.blob.core.windows.net/testcontainer-prototype/xml1.xml</Blob>
    		<Blob name="xmlFiles/xml1">https://softproject.blob.core.windows.net/testcontainer-prototype/xmlFiles/xml1</Blob>
    		<Blob name="xmlFiles/xml1.xml">https://softproject.blob.core.windows.net/testcontainer-prototype/xmlFiles/xml1.xml</Blob>
    	</Container>
    	<Container name="test">... </Container>
    </ListBlobs>
    
  • In the event of an error (status -1), the output corresponds to the input document.

Download operation:

  • If the operation has been executed successfully (status 1), the downloaded blob (text, XML binary document, etc.) is issued.

  • In the event of an error (status -1), the output corresponds to the input document.

  • If there are no blob or containers (status 0), the output corresponds to the input document.

UpdateDirectory operation:

  • If the operation is successful (status 1), the output document will return all affected blobs after updating the source folder with the destination folder name.

    UpdateDirectory operation: Status 1

    XML
    <?xml version="1.0" encoding="UTF-8"
    <UpdateDirectory targetDirectory="testFolderR/" sourceDirectory="testFolder/">
    	<Blob newName="testFolderR/C-structure.xml" name="testFolder/C-structure.xml"/>
    	<Blob newName="testFolderR/X4_1_Configuration.txt" name="testFolder/X4_1_Configuration.txt"/>
    </UpdateDirectory>
    
  • In the event of an error (status -1), the output corresponds to the input document.

  • If the source directory does not exist (status 0), the output is an empty XML document.

    UpdateDirectory operation: Status 0

    XML
    <?xml version="1.0" encoding="UTF-8"
    <UpdateDirectory targetDirectory="otherFiles/testSubFolderR/" sourceDirectory="textFiles/subTextFiles"/>
    

MoveDirectoryoperation:

  • If the operation is successful (status 1), the output document will return all affected blobs after moving the source folder to the destination folder.

    MoveDirectory operation: Status 1

    XML
    <?xml version="1.0" encoding="UTF-8"
    <MoveDirectory targetDirectory="textFiles/" sourceDirectory="testFolderR/">
    	<Blob newName="textFiles/C-structure.xml" name="testFolderR/C-structure.xml"/>
    	<Blob newName="textFiles/X4_1_Configuration.txt" name="testFolderR/X4_1_Configuration.txt"/>
    </MoveDirectory>
    
  • In the event of an error (status -1), the output corresponds to the input document.

  • If the source or destination directory does not exist (status 0), the output is an empty XML document.

    MoveDirectory operation: Status 0 - target directory does not exist

    XML
    <?xml version="1.0" encoding="UTF-8"
    <MoveDirectory targetDirectory="otherFiles/testSubFolderR/" sourceDirectory="textFiles/subFolderR"> Target Directory not found for Move operation </MoveDirectory>
    

    MoveDirectory operation: Status 0 - source directory does not exist

    XML
    <?xml version="1.0" encoding="UTF-8"
    <MoveBlobDirectory targetDirectory="textFiles/" sourceDirectory="otherFiles/testSubFolderR"/>
    

DeleteDirectory operation

  • If the operation is successful (status 1), the output document will return all affected blobs after deleting the source folder and its contents.

    DeleteDirectory operation: Status 1

    XML
    <?xml version="1.0" encoding="UTF-8"
    <DeleteDirectory targetDirectory="" sourceDirectory="imagesFiles2/">
    	<Blob newName="" name="imagesFiles2/image1.png"/>
    </DeleteDirectory>
    
  • In the event of an error (status -1), the output corresponds to the input document.

  • If the source directory does not exist (status 0), the output is an empty XML document.

    DeleteDirectory operation: Status 0

    XML
    <?xml version="1.0" encoding="UTF-8"
    <DeleteDirectory targetDirectory="" sourceDirectory="imagesFiles2/"/>
    

MoveBlobDirectory operation

  • If the operation is successful (status 1), the output document will return all blobs that have been moved from the source folder to the destination folder.

    MoveBlobDirectory operation: Status 1

    XML
    <?xml version="1.0" encoding="UTF-8"
    <MoveBlobDirectory targetDirectory="/" sourceDirectory="textFiles/">
    	<Blob newName="X4_1_Configuration.txt" name="textFiles/X4_1_Configuration.txt"/>
    </MoveBlobDirectory>
    
  • In the event of an error (status -1), the output corresponds to the input document.

  • If the source or target directory does not exist (status 0), the output is an empty XML document.

    MoveBlobDirectory operation: Status 0 - target directory does not exist

    XML
    <?xml version="1.0" encoding="UTF-8"
    <MoveBlobDirectory targetDirectory="otherFiles/testSubFolderR/" sourceDirectory="textFiles/subFolderR"> Target Directory not found for Move operation </MoveDirectory>
    

    MoveBlobDirectory operation: Status 0 - source directory does not exist

    XML
    <?xml version="1.0" encoding="UTF-8"
    <MoveBlobDirectory targetDirectory="textFiles/" sourceDirectory="otherFiles/testSubFolderR"/>