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

Implementation of new API/Webservice to replace XMWS #70

Open
allebb opened this issue Oct 18, 2014 · 6 comments
Open

Implementation of new API/Webservice to replace XMWS #70

allebb opened this issue Oct 18, 2014 · 6 comments
Milestone

Comments

@allebb
Copy link
Contributor

allebb commented Oct 18, 2014

I intend of completely overhauling the current XML based API to a more standardised format. - I'm sure everyone agrees that this is probably wayyyy overdue! lol

The new solution will be a RESTful based web-service (which can talk both JSON and XML based on user preference - Simply by requesting the desire content-ype in the header) I will also complete the implementation of the remaining functionality for all core modules as at present only about 20% of the core functionality is covered by the core at present..

I intend to use a standard 'Resource' type design and utilising RESTful practice to CREATE (POST), READ (GET), UPDATE (PUT) and DELETE (DELETE).

@allebb allebb added this to the 1.0.1 milestone Oct 18, 2014
@allebb allebb self-assigned this Oct 18, 2014
@MBlagui
Copy link
Contributor

MBlagui commented Oct 24, 2014

Great ! to see rest API!!
Do you need help ? Testing? Feedback?

@allebb
Copy link
Contributor Author

allebb commented Oct 26, 2014

Don't need any help at the moment buddy as I'm going to lay down the API
framework code first, I personally want to get the main API base classes
down first though (so authorisation etc. is taken care of) and then would
be good if you would like to give me a hand getting the remaining API
endpoints done for the existing core modules in Sentora :) - Give me a few
weeks though and I'll hook up with you again and we can get started :)

On 24 October 2014 17:58, MBlagui notifications@github.com wrote:

Great ! to see rest API!!
Do you need help ? Testing? Feedback?


Reply to this email directly or view it on GitHub
#70 (comment).

@MBlagui
Copy link
Contributor

MBlagui commented Oct 26, 2014

My pleasure... Try to think about the api in it's own Vhost/port ;-)
So we can firewall it even with iptables.

@allebb
Copy link
Contributor Author

allebb commented Oct 26, 2014

Thats a good idea, I'll completely decouple the API from the control panel
interface to enable the ability to host it on a separate port etc.

On 26 October 2014 11:06, MBlagui notifications@github.com wrote:

My pleasure... Try to think about the api in it's own Vhost/port ;-)
So we can firewall it even with iptables.


Reply to this email directly or view it on GitHub
#70 (comment).

@MBlagui
Copy link
Contributor

MBlagui commented Oct 26, 2014

Api is first layer before we can think multiserver panel. But implementation is not so hard in DB.

We need to add serverID in all packages/ressources ( web/ftp/email) so we know where the ressource will be setup. We can easily move into that model.

@alpha1125
Copy link
Contributor

Bobby, If you want, I'd love to help out with this.

I've been looking to see how I could bootstrap zpanel, so I could use the functions.
I was then informed of XMWS, the API. Upon looking at the code, I was like... huh? A lack of examples put me off from walking through the code with xdebug.

Rest is best. :)

What rest walkable tree structure are you thinking of?
Are we using some best practises?

Some better rest classes I've used have included:

  • Versioning in the url.
  • Standardized wrapper in json, which included error, result count, pagesize, result

The below is just a sample, I grabbed from another RESTful API (http://rallydev.com). It's a sample query for say a user.

{
  QueryResult: {
    _versionAPIMajor: "2",
    _versionAPIMinor: "0",
    Errors: [ ],
    Warnings: [ ],
    TotalResultCount: 1,
    StartIndex: 1,
    PageSize: 20,
    Results: [
      {
        _rallyAPIMajor: "2",
        _rallyAPIMinor: "0",
        _ref: "http://localhost/api/webservice/v2.0/user/19223487150",
        _refObjectUUID: "some UUID",
        _refObjectName: "Alpha1125",
        _type: "User"
      }
    ]
  }
}

Where underscored prefixes, are system values.

@5050 5050 unassigned allebb Apr 7, 2015
@Caffe1neAdd1ct Caffe1neAdd1ct modified the milestones: 1.0.1, 1.1.0, Backlog Sep 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants