Update REPP limit

This commit is contained in:
Martin Lensment 2015-04-01 17:00:19 +03:00
parent ce2b87f7da
commit 39b9459ab5
4 changed files with 19 additions and 19 deletions

View file

@ -5,13 +5,13 @@ module Repp
resource :contacts do resource :contacts do
desc 'Return list of contact' desc 'Return list of contact'
params do params do
optional :limit, type: Integer, values: (1..20).to_a, desc: 'How many contacts to show' optional :limit, type: Integer, values: (1..200).to_a, desc: 'How many contacts to show'
optional :offset, type: Integer, desc: 'Contact number to start at' optional :offset, type: Integer, desc: 'Contact number to start at'
optional :details, type: String, values: %w(true false), desc: 'Whether to include details' optional :details, type: String, values: %w(true false), desc: 'Whether to include details'
end end
get '/' do get '/' do
limit = params[:limit] || 20 limit = params[:limit] || 200
offset = params[:offset] || 0 offset = params[:offset] || 0
if params[:details] == 'true' if params[:details] == 'true'

View file

@ -5,13 +5,13 @@ module Repp
resource :domains do resource :domains do
desc 'Return list of domains' desc 'Return list of domains'
params do params do
optional :limit, type: Integer, values: (1..20).to_a, desc: 'How many domains to show' optional :limit, type: Integer, values: (1..200).to_a, desc: 'How many domains to show'
optional :offset, type: Integer, desc: 'Domain number to start at' optional :offset, type: Integer, desc: 'Domain number to start at'
optional :details, type: String, values: %w(true false), desc: 'Whether to include details' optional :details, type: String, values: %w(true false), desc: 'Whether to include details'
end end
get '/' do get '/' do
limit = params[:limit] || 20 limit = params[:limit] || 200
offset = params[:offset] || 0 offset = params[:offset] || 0
if params[:details] == 'true' if params[:details] == 'true'

View file

@ -6,7 +6,7 @@ Returns contacts of the current registrar.
| Field name | Required | Type | Allowed values | Description | | Field name | Required | Type | Allowed values | Description |
| ---------- | -------- | ---- | -------------- | ----------- | | ---------- | -------- | ---- | -------------- | ----------- |
| limit | false | Integer | [1..20] | How many contacts to show | | limit | false | Integer | [1..200] | How many contacts to show |
| offset | false | Integer | | Contact number to start at | | offset | false | Integer | | Contact number to start at |
| details | false | String | ["true", "false"] | Whether to include details | | details | false | String | ["true", "false"] | Whether to include details |
@ -23,26 +23,26 @@ Content-Type: application/json
``` ```
HTTP/1.1 200 HTTP/1.1 200
Cache-Control: max-age=0, private, must-revalidate Cache-Control: max-age=0, private, must-revalidate
Content-Length: 573 Content-Length: 562
Content-Type: application/json Content-Type: application/json
{ {
"contacts": [ "contacts": [
{ {
"id": 1, "id": 1,
"code": "sh095058820", "code": "sh995165920",
"reg_no": null, "reg_no": null,
"phone": "+372.12345678", "phone": "+372.12345678",
"email": "shakira.reichert@corkery.com", "email": "ronaldo@sauer.biz",
"fax": null, "fax": null,
"created_at": "2015-04-01T10:51:49.854Z", "created_at": "2015-04-01T13:59:45.332Z",
"updated_at": "2015-04-01T10:51:49.854Z", "updated_at": "2015-04-01T13:59:45.332Z",
"ident": "37605030299", "ident": "37605030299",
"ident_type": "priv", "ident_type": "priv",
"created_by_id": null, "created_by_id": null,
"updated_by_id": null, "updated_by_id": null,
"auth_info": "password", "auth_info": "password",
"name": "Henderson Feest0", "name": "Meagan Roob Jr.0",
"org_name": null, "org_name": null,
"registrar_id": 1, "registrar_id": 1,
"creator_str": "autotest", "creator_str": "autotest",
@ -81,7 +81,7 @@ Content-Type: application/json
{ {
"contacts": [ "contacts": [
"sh331036241" "sh818918181"
], ],
"total_number_of_records": 2 "total_number_of_records": 2
} }

View file

@ -6,7 +6,7 @@ Returns domains of the current registrar.
| Field name | Required | Type | Allowed values | Description | | Field name | Required | Type | Allowed values | Description |
| ---------- | -------- | ---- | -------------- | ----------- | | ---------- | -------- | ---- | -------------- | ----------- |
| limit | false | Integer | [1..20] | How many domains to show | | limit | false | Integer | [1..200] | How many domains to show |
| offset | false | Integer | | Domain number to start at | | offset | false | Integer | | Domain number to start at |
| details | false | String | ["true", "false"] | Whether to include details | | details | false | String | ["true", "false"] | Whether to include details |
@ -23,7 +23,7 @@ Content-Type: application/json
``` ```
HTTP/1.1 200 HTTP/1.1 200
Cache-Control: max-age=0, private, must-revalidate Cache-Control: max-age=0, private, must-revalidate
Content-Length: 909 Content-Length: 506
Content-Type: application/json Content-Type: application/json
{ {
@ -32,21 +32,21 @@ Content-Type: application/json
"id": 1, "id": 1,
"name": "domain0.ee", "name": "domain0.ee",
"registrar_id": 1, "registrar_id": 1,
"registered_at": "2015-04-01T10:51:53.445Z", "registered_at": "2015-04-01T13:59:45.874Z",
"status": null, "status": null,
"valid_from": "2015-04-01T00:00:00.000Z", "valid_from": "2015-04-01T00:00:00.000Z",
"valid_to": "2016-04-01T00:00:00.000Z", "valid_to": "2016-04-01T00:00:00.000Z",
"owner_contact_id": 1, "owner_contact_id": 1,
"auth_info": "15d4b95d0611312ee96e63e48fcab2de", "auth_info": "78d0edcd105c8e1936457c1eef659611",
"created_at": "2015-04-01T10:51:53.439Z", "created_at": "2015-04-01T13:59:45.871Z",
"updated_at": "2015-04-01T10:51:53.432Z", "updated_at": "2015-04-01T13:59:45.871Z",
"name_dirty": "domain0.ee", "name_dirty": "domain0.ee",
"name_puny": "domain0.ee", "name_puny": "domain0.ee",
"period": 1, "period": 1,
"period_unit": "y", "period_unit": "y",
"creator_str": null, "creator_str": null,
"updator_str": null, "updator_str": null,
"whois_body": " This Whois Server contains information on\n Estonian Top Level Domain ee TLD\n\n domain: domain0.ee\n registrar: registrar1\n status:\n registered: \n changed: 2015-04-01 10:51:53\n expire:\n outzone:\n delete:\n\n \n\n nsset:\n nserver:\n\n registrar: registrar1\n phone: \n address: Street 111, Town, County, Postal\n created: 2015-04-01 10:51:53\n changed: 2015-04-01 10:51:53\n" "whois_body": null
} }
], ],
"total_number_of_records": 2 "total_number_of_records": 2