Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

copy source image docs #65

Merged
merged 1 commit into from
Mar 28, 2018
Merged

copy source image docs #65

merged 1 commit into from
Mar 28, 2018

Conversation

chregu
Copy link
Contributor

@chregu chregu commented Mar 3, 2018

Backend is deployed

you can do a `COPY` request to `/sourceimages/{org}/{hash}` and send the `Destination` header with the destination organization.
If you send a `Overwrite: F` header with it, it won't copy it, if it already exists at the destination.
Your API user needs to have read permissions on the source organization and write permissions on the destination organization.
The [memberships endpoint](memberships.html) has methods to give an API user access to more organizations,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

organizations, -> organizations.

Returns a 404 http code, if the source image was not found.

```language-bash
curl -X POST -H 'Destination: mycompany-stage' 'https://api.rokka.io/sourceimages/mycompany/c412d8d6e4b9b7b058320b06972ac0ec72cfe6e5'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't be curl -X COPY -H ... ?

Returns a 201 http code, if the image was newly created at the destination.
Returns a 204 http code, if the image was overwritten at the destination.
Returns a 412 http code, if `Overwrite: F` was sent and the destination exists already.
Returns a 404 http code, if the source image was not found.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we return a 400 if the destination organization does not exist?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we return a 403 if the user has no write permissions on Destination org?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both added and the rest is adjusted too, thank

## Restore a source image

To restore a deleted image, do a `POST`request to `/sourceimages/{org}/{hash}/restore`.
To restore a deleted image, do a `POST` request to `/sourceimages/{org}/{hash}/restore`.
Copy link
Contributor

@thePanz thePanz Mar 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two (spaces) before __do

@thePanz thePanz merged commit cd0e1be into master Mar 28, 2018
@thePanz thePanz deleted the copy-sourceimage branch March 28, 2018 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants