azurestoragebinder

1.2.0 • Public • Published

AzureStorageBinder

  1. A binder REST service for Azure Storage APIs.These Binder APIs can be called from both Mobile and Web applications using corresponding client libraries.
  2. Dockerfile is included which would help containerize the service and also can be used seamlessly with Azure Container Registry or Docker Cloud or running locally. This would help in local testing and then hosting in Azure as Web API (or any other hosting services)
  3. No need to send Storage account details as part of the request (although that option is open); these secured information can be in Azure Web API layer and service can read from process.env dictionary
  4. Server host address is kept at 0.0.0.0 - so that it can be accesses from containerized hosting solutions like Docker Swarm

API Endpoints:

Default

URL - https://<host_server_details>
GET request body - { }

Table

  1. URL - https://<host_server_details>/table/create
    PUT request body -

    {
      "tablename" : <TABLE_NAME>
    }
    
  2. URL - https://<host_server_details>/table/delete
    DELETE request body -

    {
      "tablename" : <TABLE_NAME>
    }
    
  3. URL - https://<host_server_details>/table/row/insert
    PUT request body -

    {
      "tablename" : <TABLE_NAME>,
      "entity" :
      {
          "PartitionKey" : <PARTITION_KEY>,
          "RowKey" : <ROW_KEY>,
          ... (OTHER FIELDS as per requirement)
      }
    }
    
  4. URL - https://<host_server_details>/table/delete
    DELETE request body -

    {
      "tablename" : <TABLE_NAME>,
      "entity" :
      {
          "PartitionKey" : <PARTITION_KEY>,
          "RowKey" : <ROW_KEY>
      }
    }
    
  5. URL - https://<host_server_details>/table/rows/insert
    PUT request body -

    {
      "tablename" : <TABLE_NAME>,
      "entity" :
      [{
          "PartitionKey" : <PARTITION_KEY>,
          "RowKey" : <ROW_KEY>,
          ... (Other Fields as per requirement)
          },
          ... (Other Entities)
      ]
    }
    
  6. URL - https://<host_server_details>/table/fetch
    GET query parameters -

    tablename=<TABKLE_NAME>&condition=<CONDITION>
    
    
  7. URL - https://<host_server_details>/table/row/update
    POST request body -

    {
      "tablename" : <TABLE_NAME>,
      "entity" :
      {
          "PartitionKey" : <PARTITION_KEY>,
          "RowKey" : <ROW_KEY>
      }
    }
    

    POST query parameters -

    force=<boolean>&merge=<boolean>&where=<CONDITION>
    
    
  8. URL - https://<host_server_details>/table/retrieve
    GET request body -

    tablename=<TABLE_NAME>&partitionkey=<PARTITION_KEY>&rowkey=<ROW_KEY>
    
    

Blob

  1. URL - https://<host_server_details>/blob/container/create
    PUT request body -

    {
      "containername" : <CONTAINER_NAME>
    }
    
  2. URL - https://<host_server_details>/blob/container/delete
    DELETE request body -

    {
      "containername" : <CONTAINER_NAME>
    }
    
  3. URL - https://<host_server_details>/blob/upload
    POST request body -

    {
      "containername" : <CONTAINER_NAME>,
      "blobname" : <BLOB_NAME>
    }
    
  4. URL - https://<host_server_details>/blob/download
    POST request body -

    {
      "containername" : <CONTAINER_NAME>,
      "blobname" : <BLOB_NAME>
    }
    
  5. URL - https://<host_server_details>/blob/delete
    DELETE request body -

    {
      "containername" : <CONTAINER_NAME>,
      "blobname" : <BLOB_NAME>
    }
    

Queue

  1. URL - https://<host_server_details>/queue/create
    PUT request body -

    {
      "queuename" : <QUEUE_NAME>
    }
    
  2. URL - https://<host_server_details>/queue/delete
    DELETE request body -

    {
      "queuename" : <QUEUE_NAME>
      
    }
    
  3. URL - https://<host_server_details>/queue/message/add
    PUT request body -

    {
      "queuename" : <QUEUE_NAME>,
      "message" : <MESSAGE>
      
    }
    
  4. URL - https://<host_server_details>/queue/message/delete
    DELETE request body -

    {
      "queuename" : <QUEUE_NAME>,
      "messageid" : <MESSAGE_ID>,
      "popreceipt" : <POP_RECEIPT_NUMBER>
      
    }
    
  5. URL - https://<host_server_details>/queue/message/
    POST request body -

    {
      "queuename" : <QUEUE_NAME>
      
    }
    
  6. URL - https://<host_server_details>/queue/messages/all
    POST request body -

    {
      "queuename" : <QUEUE_NAME>
      
    }
    
  7. URL - https://<host_server_details>/queue/message/update
    POST request body -

    {
      "queuename" : <QUEUE_NAME>,
      "popreceipt" : <POP_RECEIPT_NUMBER>,
      "updatemessage" :
      {
          "messageText" : <MESSAGE_TEXT_TEXT>
      }
    }
    
  8. URL - https://<host_server_details>/queue/dequeue
    POST request body -

    {
      "queuename" : <QUEUE_NAME>
    }
    
  9. URL - https://<host_server_details>/queue/dequeue/all
    POST request body -

    {
      "queuename" : <QUEUE_NAME>
    }
    

Package Sidebar

Install

npm i azurestoragebinder

Weekly Downloads

0

Version

1.2.0

License

MIT

Unpacked Size

113 kB

Total Files

21

Last publish

Collaborators

  • monojitnpm