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

REST API: more metadata from domains table? #2188

Closed
jpmens opened this issue Feb 4, 2015 · 3 comments
Closed

REST API: more metadata from domains table? #2188

jpmens opened this issue Feb 4, 2015 · 3 comments

Comments

@jpmens
Copy link
Contributor

jpmens commented Feb 4, 2015

Enhancement request.

(I'm still trying to understand the use of the comments table (related to #2064); comments are obtainable only when the whole zone is retrieved which seems a bit of a waste.)

I think the API (servers/localhost/zones) should list the account column of the domains table.

In addition to that, what I'd very much like to see are additional columns a customer creates. For example:

ALTER TABLE domains ADD cust VARCHAR(80);
UPDATE domains SET cust = 'something1' WHERE id = 2;

followed by

curl -s -XGET -H 'X-API-Key: otto' http://192.168.1.114:8081/servers/localhost/zones
[
  {
    "last_check": 0,
    "id": "example.net.",
    "url": "/servers/localhost/zones/example.net.",
    "name": "example.net",
    "kind": "Master",
    "dnssec": false,
    "masters": [],
    "serial": 2015012903,
    "notified_serial": 2015012903,
   "cust" : "something1"     <------------
  },

The precondition would be that a column name doesn't clobber an existing JSON element the API currently uses. Alternatively, the API could prefix with with x-.

@zeha
Copy link
Collaborator

zeha commented Feb 8, 2015

account is done; having custom fields in there will be ... interesting.

@jpmens
Copy link
Contributor Author

jpmens commented Feb 9, 2015

I glanced at the hard-coded SQL queries in the code. "Interesting" is an understatement...

account is already very valuable for us, thank you.

@zeha zeha added the auth label Feb 9, 2015
@jpmens
Copy link
Contributor Author

jpmens commented Feb 9, 2015

domains.account is already very useful for which I thank you. I am closing this as completed.

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

2 participants