diff --git a/contrib/st2/opensds/actions/attach_volume.py b/contrib/st2/opensds/actions/attach_volume.py index 0ad5368..9434fdb 100644 --- a/contrib/st2/opensds/actions/attach_volume.py +++ b/contrib/st2/opensds/actions/attach_volume.py @@ -23,18 +23,14 @@ def run(self, ip_addr="", port="", tenant_id="", - mount_point="", - host_info="", - connection_info="", - access_protocol="", + attach_mode="", + host_id="", auth_token="", volume_id=""): data = { - "Mountpoint": mount_point, - "HostInfo": host_info, - "ConnectionInfo": connection_info, + "AttachMode": attach_mode, + "HostId": host_id, "TenantId": tenant_id, - "AccessProtocol": access_protocol, "VolumeId": volume_id} headers = { 'content-type': 'application/json', diff --git a/contrib/st2/opensds/actions/attach_volume.yaml b/contrib/st2/opensds/actions/attach_volume.yaml index 33a595d..629e81b 100644 --- a/contrib/st2/opensds/actions/attach_volume.yaml +++ b/contrib/st2/opensds/actions/attach_volume.yaml @@ -16,18 +16,12 @@ parameters: volume_id: type: string required: true - mount_point: + attach_mode: type: string required: false - host_info: - type: object - required: false - connection_info: - type: object - required: false - access_protocol: + host_id: type: string - required: false + required: true auth_token: type: string required: false diff --git a/contrib/st2/opensds/actions/provision_volume.yaml b/contrib/st2/opensds/actions/provision_volume.yaml index 06d04e7..3f3514d 100644 --- a/contrib/st2/opensds/actions/provision_volume.yaml +++ b/contrib/st2/opensds/actions/provision_volume.yaml @@ -46,22 +46,14 @@ parameters: type: string description: "Snapshot from cloud to create volume" required: false - mount_point: + attach_mode: type: string - description: "Mount point to attach volume" + description: "Attach Mode 'ro' or 'rw' to attach volume" required: false - host_info: - type: object - description: "Host info JSON to attach volume" - required: false - connection_info: - type: object - description: "Connectin info JSON to attach volume" - required: false - access_protocol: + host_id: type: string - description: "Access protocol for attach volume" - required: false + description: "Host id to attach volume" + required: true auth_token: type: string description: "Authentication Token" diff --git a/contrib/st2/opensds/actions/workflows/provision_volume.yaml b/contrib/st2/opensds/actions/workflows/provision_volume.yaml index 7fa5a22..527ffcb 100644 --- a/contrib/st2/opensds/actions/workflows/provision_volume.yaml +++ b/contrib/st2/opensds/actions/workflows/provision_volume.yaml @@ -16,10 +16,8 @@ workflows: - profile_id - snapshot_id - snapshot_from_cloud - - mount_point - - host_info - - connection_info - - access_protocol + - attach_mode + - host_id - auth_token - timeout output: @@ -53,10 +51,8 @@ workflows: port: "<% $.port %>" tenant_id: "<% $.tenant_id %>" volume_id: <% $.volume_id %> - mount_point: <% $.mount_point %> - host_info: <% $.host_info %> - connection_info: <% $.connection_info %> - access_protocol: <% $.access_protocol %> + attach_mode: <% $.attach_mode %> + host_id: <% $.host_id %> auth_token: "<% $.auth_token %>" publish: print_status : <% task(attach_volume).result.stdout %> diff --git a/docs/INSTALL.md b/docs/INSTALL.md index 1b2516e..edddc75 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -108,7 +108,7 @@ For the examples below OpenSDS is installed on VM and both StackStorm and Orches https://localhost/api/v1/executions \ -H 'content-type: application/json' \ -H 'X-Auth-Token: ' \ - -d '{"action": "opensds.provision-volume", "user": null, "parameters": {"i_paddr": "", "port": "50040", "size": 1, "tenant_id": "", "name": "test000", "auth_token": "", "host_info": {"host":"ubuntu","initiator":"iqn.1993-08.org.debian:01:437bac3717c8","ip":""}}}' + -d '{"action": "opensds.provision-volume", "user": null, "parameters": {"i_paddr": "", "port": "50040", "size": 1, "tenant_id": "", "name": "test000", "auth_token": "", "host_id": ""}}' ``` * Create Volume using StackStorm Action with input arguments