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

origin api #682

Merged
merged 1 commit into from
Jun 9, 2016
Merged

origin api #682

merged 1 commit into from
Jun 9, 2016

Conversation

bookshelfdave
Copy link
Contributor

@bookshelfdave bookshelfdave commented Jun 8, 2016

create an origin

curl -H "Content-Type: application/json" -H "Authorization: Bearer xyz" --data @example.json http://172.17.0.2:9636/v1/depot/origins

example.json:

{
  "name": "myorigin"
}

get the members of an origin

curl -v -H "Authorization: Bearer xyz" -X GET http://172.17.0.2:9636/v1/depot/origins/myorigin/users

create an invitation

curl -v -H "Authorization: Bearer xyz" -X POST http://172.17.0.2:9636/v1/depot/origins/myorigin/users/someuser/invitations

list my invitations

curl -v -H "Authorization: Bearer xyz" -X GET http://172.17.0.2:9636/v1/user/invitations

list current origin invitations

curl -v -H "Authorization: Bearer xyz" -X GET http://172.17.0.2:9636/v1/depot/origins/myorigin/invitations

accept an invitation

curl -v -H "Authorization: Bearer xyz" --data @invite.json -X PUT http://172.17.0.2:9636/v1/user/invitations/41259592096677888

invite.json:

{
        "ignore":false
}

NOTE: ignoring invites isn't implemented yet

get the origins that I'm a member of

curl -v -H "Authorization: Bearer xyz" -X GET http://172.17.0.2:9636/v1/user/origins

Sample output json here:
https://gist.github.com/metadave/52e59f764ededa581207d87d27234322#file-jsonsamples-txt

Signed-off-by: Dave Parfitt <[email protected]>
@@ -42,6 +42,10 @@ fn protocol_files() -> Vec<PathBuf> {
let mut files = vec![];
for entry in fs::read_dir("protocols").unwrap() {
let file = entry.unwrap();
// skip vim temp files
if file.file_name().to_str().unwrap().starts_with(".") {
Copy link
Collaborator

@reset reset Jun 8, 2016

Choose a reason for hiding this comment

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

Are there any other things we should ignore here? I didn't even think about this! Maybe we should just process things that explicitly end in .proto?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we should probably stick with .proto, but this will work for now.

@reset
Copy link
Collaborator

reset commented Jun 8, 2016

@metadave this is exactly what we need to get started. It appears that you totally got the message routing/persistence traits and that makes me happy 😄

gif-keyboard-6972694764431483304

Merge when ready!

@bookshelfdave
Copy link
Contributor Author

@thesentinels r+

@thesentinels
Copy link
Contributor

📌 Commit 05971d9 has been approved by metadave

@bookshelfdave
Copy link
Contributor Author

@habitat-sh/habitat-core-maintainers please don't update willem yet until we have the cli login stuff in place.

thesentinels pushed a commit that referenced this pull request Jun 9, 2016
Signed-off-by: Dave Parfitt <[email protected]>

Pull request: #682
Approved by: metadave
@thesentinels
Copy link
Contributor

⌛ Testing commit 05971d9 with merge f274c36...

@thesentinels
Copy link
Contributor

☀️ Test successful - travis

@thesentinels thesentinels merged commit 05971d9 into master Jun 9, 2016
@juliandunn
Copy link
Contributor

image

@reset reset deleted the dp_origins branch June 9, 2016 03:16
jtimberman pushed a commit that referenced this pull request Jun 12, 2016
Signed-off-by: Dave Parfitt <[email protected]>

Pull request: #682
Approved by: metadave
raskchanky pushed a commit that referenced this pull request Apr 16, 2019
Signed-off-by: Dave Parfitt <[email protected]>

Pull request: #682
Approved by: metadave
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.

4 participants