{"action":"created","issue":{"url":"https://api.github.com/repos/globus/globus-sdk-python/issues/32","repository_url":"https://api.github.com/repos/globus/globus-sdk-python","labels_url":"https://api.github.com/repos/globus/globus-sdk-python/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/globus/globus-sdk-python/issues/32/comments","events_url":"https://api.github.com/repos/globus/globus-sdk-python/issues/32/events","html_url":"https://github.com/globus/globus-sdk-python/issues/32","id":156300574,"number":32,"title":"Creating a share fails","user":{"login":"rw2","id":744241,"avatar_url":"https://avatars.githubusercontent.com/u/744241?v=3","gravatar_id":"","url":"https://api.github.com/users/rw2","html_url":"https://github.com/rw2","followers_url":"https://api.github.com/users/rw2/followers","following_url":"https://api.github.com/users/rw2/following{/other_user}","gists_url":"https://api.github.com/users/rw2/gists{/gist_id}","starred_url":"https://api.github.com/users/rw2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rw2/subscriptions","organizations_url":"https://api.github.com/users/rw2/orgs","repos_url":"https://api.github.com/users/rw2/repos","events_url":"https://api.github.com/users/rw2/events{/privacy}","received_events_url":"https://api.github.com/users/rw2/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-05-23T15:07:27Z","updated_at":"2016-05-24T14:45:51Z","closed_at":null,"body":"**Use case:**\r\n\r\nI'm writing a script that will create a share when triggered by a request from a user through our web interface.\r\n\r\n**Using this script:** \r\n\r\nshared_ep_data = {\r\n  \"DATA_TYPE\": \"shared_endpoint\",\r\n  \"host_endpoint\": 'e25a4bda-0636-11e6-a732-22000bf2d559',\r\n  \"host_path\": \"/data/bulktest/greatest\",\r\n  \"display_name\": \"generated by test script\",\r\n  # optionally specify additional endpoint fields\r\n  \"description\": \"my test share\"\r\n}\r\ntc.endpoint_autoactivate('e25a4bda-0636-11e6-a732-22000bf2d559', if_expires_in=3600)\r\ncreate_result = tc.create_shared_endpoint(shared_ep_data)\r\nendpoint_id = create_result[\"id\"]\r\nprint(\"new endpoint id: \", endpoint_id)\r\n\r\n\r\n**I get the following error:**\r\n\r\nrw2@macbook2:~/dev/anl/endpoints$ python3 endpoint-test.py\r\nTraceback (most recent call last):\r\n  File \"endpoint-test.py\", line 41, in <module>\r\n    create_result = tc.create_shared_endpoint(shared_ep_data)\r\n  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/globus_sdk/transfer/client.py\", line 340, in create_shared_endpoint\r\n    return self.post('shared_endpoint', json_body=data)\r\n  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/globus_sdk/base.py\", line 156, in post\r\n    response_class=response_class)\r\n  File \"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/globus_sdk/base.py\", line 241, in _request\r\n    raise self.error_class(r)\r\nglobus_sdk.exc.TransferAPIError: (409, 'Exists', 'That endpoint already exists', 'CSH1MYMqq')\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/globus/globus-sdk-python/issues/comments/221294446","html_url":"https://github.com/globus/globus-sdk-python/issues/32#issuecomment-221294446","issue_url":"https://api.github.com/repos/globus/globus-sdk-python/issues/32","id":221294446,"user":{"login":"jaswilli","id":214142,"avatar_url":"https://avatars.githubusercontent.com/u/214142?v=3","gravatar_id":"","url":"https://api.github.com/users/jaswilli","html_url":"https://github.com/jaswilli","followers_url":"https://api.github.com/users/jaswilli/followers","following_url":"https://api.github.com/users/jaswilli/following{/other_user}","gists_url":"https://api.github.com/users/jaswilli/gists{/gist_id}","starred_url":"https://api.github.com/users/jaswilli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaswilli/subscriptions","organizations_url":"https://api.github.com/users/jaswilli/orgs","repos_url":"https://api.github.com/users/jaswilli/repos","events_url":"https://api.github.com/users/jaswilli/events{/privacy}","received_events_url":"https://api.github.com/users/jaswilli/received_events","type":"User","site_admin":false},"created_at":"2016-05-24T14:45:51Z","updated_at":"2016-05-24T14:45:51Z","body":"@rw2 You can have many shares on a given endpoint. The issue you're having is caused by reusing \"generated by test script\" in the `display_name` property. A shared endpoint's display name has to be unique (even if it's two different shares on two different endpoints).\r\n\r\nIt sounds like attaching some unique piece of information to the `display_name` (like a timestamp, or a UUID) might get you over this hurdle."}}
{"actor":{"display_login":"jaswilli"}}