Difference between revisions of "stoney mail: Mail Resource - REST API"

From stoney cloud
Jump to: navigation, search
[unchecked revision][unchecked revision]
(stoney vm)
(Permission & Ownership object)
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
== stoney mail ==
 
== stoney mail ==
 
<pre>
 
<pre>
stoney mail: Mail Domains Resource - REST API
 
stoney mail: Mail Accounts Resource - REST API
 
 
 
https://api.example.com/v1/services/mail
 
https://api.example.com/v1/services/mail
 
https://api.example.com/v1/services/mail/domains
 
https://api.example.com/v1/services/mail/domains
https://api.example.com/v1/services/mail/domains/stepping-stone.ch
+
https://api.example.com/v1/services/mail/domains/5000000
https://api.example.com/v1/services/mail/domains/stepping-stone.ch/accounts
+
https://api.example.com/v1/services/mail/domains/5000000/accounts
https://api.example.com/v1/services/mail/domains/stepping-stone.ch/accounts/michael.eichenberger
+
https://api.example.com/v1/services/mail/domains/5000000/accounts/5000001
 +
https://api.example.com/v1/services/mail/domains/5000000/aliases/5000002
 +
https://api.example.com/v1/services/mail/domainaliases
 +
https://api.example.com/v1/services/mail/domainaliases/5000003
 
https://api.example.com/v1/services/mail/accounts
 
https://api.example.com/v1/services/mail/accounts
https://api.example.com/v1/services/mail/accounts/michael.eichenberger@stepping-stone.ch
+
https://api.example.com/v1/services/mail/accounts/5000001
</pre>
+
https://api.example.com/v1/services/mail/aliases
 
+
https://api.example.com/v1/services/mail/aliases/5000002
== stoney vm ==
+
<pre>
+
stoney vm: Virtual Machines Resource - REST API
+
 
+
https://api.example.com/v1/services/vm
+
https://api.example.com/v1/services/vm/vms
+
https://api.example.com/v1/services/vm/vms/kvm-0211
+
https://api.example.com/v1/services/vm/vms/3712345
+
 
</pre>
 
</pre>
How to we hande actions (start/stop/...)?
 
  
= Notes =
+
== Permission & Ownership object ==
* Points we need to discuss --[[User:Chrigu|Chrigu]] ([[User talk:Chrigu|talk]]) 09:35, 30 January 2014 (CET)
+
We need a generic permission & ownership object which can be added to all service creation and modification requests. The following points needs to be clarified:
** services vs. products
+
* Shall the roles be set during the service creation / modification or on the users resource?
*** Product: stone mail, stoney vm, stoney backup --[[User:Michael|Michael]] ([[User talk:Michael|talk]]) 09:47, 30 January 2014 (CET)
+
* Is this object always mandatory, or can the roles be defined via some clever inherited default values if missing.
*** Service: mail domains and accounts, backup accounts, virtual machines (as defined in the directory under ou=services https://api.example.com/v1/services/vm/vms
+
* Which roles are available and can be set on which level
** product UIDs vs. names (<code>mail/12345678</code> vs. <code>mail/example.com</code>)
+
* Which informations apart from the user (people) and the role name are necessary?
*** Maybe both should work? If not, uid would be preferable, as they stay fix, even if you rename the mail account. --[[User:Michael|Michael]] ([[User talk:Michael|talk]]) 09:47, 30 January 2014 (CET)
+
* Do we want to reference the location URI or the UID of a role
** Maybe create examples for other products/services to get a feeling about what is the better, more generic way.
+
* Does anyone have a better name for the <code>roles</code> object? :)
*** See above. --[[User:Michael|Michael]] ([[User talk:Michael|talk]]) 09:47, 30 January 2014 (CET)
+
  
 +
<source lang="javascript">
 +
"roles":
 +
{
 +
  [
 +
    {
 +
      /* The user 3000000 has the Admin role for this service */
 +
      "location": "https://api.example.com/v1/users/3000000",
 +
      "role": "Admin"
 +
    },
 +
    {
 +
      /* The user 3000001 has the Admin role for this service */
 +
      "location": "https://api.example.com/v1/users/3000001",
 +
      "role": "Admin"
 +
    },
 +
    {
 +
      /* The user 3000002 has the User role for this service */
 +
      "location": "https://api.example.com/v1/users/3000002",
 +
      "role": "User"
 +
    },
 +
    {
 +
      /* ... */
 +
    }
 +
  ]
 +
}
 +
</source>
  
 +
The opposite while querying a users resource, for example https://api.example.com/v1/users/3000000
 +
<source lang="javascript">
 +
"roles":
 +
{
 +
  [
 +
    {
 +
      /* MailAccountAdmin role for the mail account 5000001 */
 +
      "location": "https://api.example.com/v1/services/mail/domains/5000000/accounts/5000001",
 +
      "role": "Admin"
 +
    },
 +
    {
 +
      /* BackupAdmin role for all backup products of the customer 1000001 */
 +
      "location": "https://api.example.com/v1/services/backups/accounts/?customerUid=1000001",
 +
      "role": "Admin"
 +
    },
 +
    {
 +
      /* VirtualizationUser role for the VM 6000001 */
 +
      "location": "https://api.example.com/v1/services/virtualization/vms/6000001",
 +
      "role": "User"
 +
    },
 +
    {
 +
      /* ... */
 +
    }
 +
  ]
 +
}
 +
</source>
  
 +
== Notes ==
 +
* We need to be able to query the size of the mailbox and the used space. Do we also return the percentage of used space or do we let the client calculate this value?
  
[[Category:REST API]]
+
[[Category:REST API]][[Category:stoney mail]]

Latest revision as of 10:42, 19 March 2014

stoney mail

https://api.example.com/v1/services/mail
https://api.example.com/v1/services/mail/domains
https://api.example.com/v1/services/mail/domains/5000000
https://api.example.com/v1/services/mail/domains/5000000/accounts
https://api.example.com/v1/services/mail/domains/5000000/accounts/5000001
https://api.example.com/v1/services/mail/domains/5000000/aliases/5000002
https://api.example.com/v1/services/mail/domainaliases
https://api.example.com/v1/services/mail/domainaliases/5000003
https://api.example.com/v1/services/mail/accounts
https://api.example.com/v1/services/mail/accounts/5000001
https://api.example.com/v1/services/mail/aliases
https://api.example.com/v1/services/mail/aliases/5000002

Permission & Ownership object

We need a generic permission & ownership object which can be added to all service creation and modification requests. The following points needs to be clarified:

  • Shall the roles be set during the service creation / modification or on the users resource?
  • Is this object always mandatory, or can the roles be defined via some clever inherited default values if missing.
  • Which roles are available and can be set on which level
  • Which informations apart from the user (people) and the role name are necessary?
  • Do we want to reference the location URI or the UID of a role
  • Does anyone have a better name for the roles object? :)
"roles":
{
  [
    {
      /* The user 3000000 has the Admin role for this service */
      "location": "https://api.example.com/v1/users/3000000",
      "role": "Admin"
    },
    {
      /* The user 3000001 has the Admin role for this service */
      "location": "https://api.example.com/v1/users/3000001",
      "role": "Admin"
    },
    {
      /* The user 3000002 has the User role for this service */
      "location": "https://api.example.com/v1/users/3000002",
      "role": "User"
    },
    { 
      /* ... */
    }
  ]
}

The opposite while querying a users resource, for example https://api.example.com/v1/users/3000000

"roles":
{
  [
    {
      /* MailAccountAdmin role for the mail account 5000001 */
      "location": "https://api.example.com/v1/services/mail/domains/5000000/accounts/5000001",
      "role": "Admin"
    },
    {
      /* BackupAdmin role for all backup products of the customer 1000001 */
      "location": "https://api.example.com/v1/services/backups/accounts/?customerUid=1000001",
      "role": "Admin"
    },
    {
      /* VirtualizationUser role for the VM 6000001 */
      "location": "https://api.example.com/v1/services/virtualization/vms/6000001",
      "role": "User"
    },
    { 
      /* ... */
    }
  ]
}

Notes

  • We need to be able to query the size of the mailbox and the used space. Do we also return the percentage of used space or do we let the client calculate this value?