Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group = fi.linuxbox.upcloud
version = 0.0.8-SNAPSHOT
version = 0.1.0-SNAPSHOT

sourceCompatibility = 1.8
targetCompatibility = 1.8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ trait UpCloudApi {
* <pre><code class="groovy">
* upcloud.prices { resp, err ->
* assert resp?.prices instanceof List
* assert rest.prices.every { it instanceof Zone }
* assert resp.prices.every { it instanceof Zone }
* }
* </code></pre>
* <p>
* When zones are listed via this API, they will <b>not</b> include
* {@link fi.linuxbox.upcloud.resource.Zone#id} properties, but {@link fi.linuxbox.upcloud.resource.Zone#name}
* properties instead. They are the same.
* When zones are listed via this API, as opposed to {@link #zones([Ljava.lang.Object;) zones}, they will <b>not</b>
* include {@link fi.linuxbox.upcloud.resource.Zone#id} properties, but
* {@link fi.linuxbox.upcloud.resource.Zone#name} properties instead. They are the same.
* </p>
*
* @param args Request callbacks for the {@code GET /price} call.
Expand All @@ -97,13 +97,19 @@ trait UpCloudApi {
* <pre><code class="groovy">
* upcloud.zones { resp, err ->
* assert resp?.zones instanceof List
* assert rest.zones.every { it instanceof Zone }
* assert resp.zones.every { it instanceof Zone }
* }
* </code></pre>
* <p>
* When zones are listed via this API, they will <b>not</b> include
* {@link fi.linuxbox.upcloud.resource.Zone#name} properties, but {@link fi.linuxbox.upcloud.resource.Zone#id}
* properties instead. They are the same.
* When zones are listed via this API, as opposed to {@link #prices([Ljava.lang.Object;) prices}, they will <b>not</b>
* include {@link fi.linuxbox.upcloud.resource.Zone#name} properties, but
* {@link fi.linuxbox.upcloud.resource.Zone#id} properties instead. They are the same.
* </p>
* <p>
* NOTE: Since {@code public} is a keyword in Groovy, there's no {@code public} field declared in the
* {@link fi.linuxbox.upcloud.resource.Zone} class. In dynamic Groovy, you can still access the property as
* {@code zone.public}, but in static Groovy you will need to use {@code zone.getProperty("public")} instead.
* The value is {@code "yes"} for public zones and {@code "no"} for private cloud zones.
* </p>
*
* @param args Request callbacks for the {@code GET /zone} call.
Expand All @@ -122,7 +128,7 @@ trait UpCloudApi {
* <pre><code class="groovy">
* upcloud.timezones { resp, err ->
* assert resp?.timezones instanceof List
* assert rest.timezones.every { it instanceof String }
* assert resp.timezones.every { it instanceof String }
* }
* </code></pre>
*
Expand All @@ -143,7 +149,7 @@ trait UpCloudApi {
* <pre><code class="groovy">
* upcloud.plans { resp, err ->
* assert resp?.plans instanceof List
* assert rest.plans.every { it instanceof Plan }
* assert resp.plans.every { it instanceof Plan }
* }
* </code></pre>
*
Expand All @@ -164,7 +170,7 @@ trait UpCloudApi {
* <pre><code class="groovy">
* upcloud.serverSizes { resp, err ->
* assert resp?.serverSizes instanceof List
* assert rest.serverSizes.every { it instanceof ServerSize }
* assert resp.serverSizes.every { it instanceof ServerSize }
* }
* </code></pre>
*
Expand All @@ -185,7 +191,7 @@ trait UpCloudApi {
* <pre><code class="groovy">
* upcloud.servers { resp, err ->
* assert resp?.servers instanceof List
* assert rest.servers.every { it instanceof Server }
* assert resp.servers.every { it instanceof Server }
* }
* </code></pre>
* <p>
Expand All @@ -210,7 +216,7 @@ trait UpCloudApi {
* <pre><code class="groovy">
* upcloud.ipAddresses { resp, err ->
* assert resp?.ipAddresses instanceof List
* assert rest.ipAddresses.every { it instanceof IpAddress }
* assert resp.ipAddresses.every { it instanceof IpAddress }
* }
* </code></pre>
* @param args Request callbacks for the {@code GET /ip_address} call.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class UpCloudContract {
/**
* UpCloud API context path.
*/
static final String API_VERSION = '/1.2/'
static final String API_VERSION = '/1.3/'

/**
* Construct request headers for a session.
Expand All @@ -50,7 +50,7 @@ class UpCloudContract {
'Authorization': 'Basic ' + "$username:$password".bytes.encodeBase64().toString(),
'Content-Type' : 'application/json',
'Host' : 'api.upcloud.com',
'User-Agent' : 'Groovy UpCloud/0.0.8-SNAPSHOT ' + userAgent,
'User-Agent' : 'Groovy UpCloud/0.1.0-SNAPSHOT ' + userAgent,
])
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class SessionSpec extends Specification {
case 'Host':
return it.value == 'api.upcloud.com'
case 'User-Agent':
return it.value.startsWith('Groovy UpCloud/0.0.8-SNAPSHOT ')
return it.value.startsWith('Groovy UpCloud/0.1.0-SNAPSHOT ')
default:
return false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ import groovy.transform.InheritConstructors
* upcloud.account { Resource resp, Throwable err ->
* if (err) {
* // The err.message is something like:
* // - "failed to start http exchange (GET /1.2/account)"
* // - "failed to finish http exchange (GET /1.2/account)"
* // - "cancelled http exchange (GET /1.2/account)"
* // - "failed to start http exchange (GET /1.3/account)"
* // - "failed to finish http exchange (GET /1.3/account)"
* // - "cancelled http exchange (GET /1.3/account)"
* log.fatal("Network error", err)
* } else if (resp.error) {
* // "HTTP error: 401 Unauthorized (GET /1.2/account)"
* // "HTTP error: 401 Unauthorized (GET /1.3/account)"
* log.error "HTTP error: ${resp.META}"
* // "Details: Error(errorCode: xxx, errorMessage: yyy)"
* log.error "Details: ${resp.error}"
Expand Down
Loading