Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
157 commits
Select commit Hold shift + click to select a range
7599de4
Change Sahara date time format to ISO 8601
ekasitk Jul 27, 2015
e145a7a
Include the EndpointURLResolver in the services defined in the
Oct 22, 2016
0ec788c
use Long insead of Integer
tongh-qtl Nov 1, 2016
3a5f002
use Long insead of Integer,fix test bug
tongh-qtl Nov 1, 2016
6e7a4cd
Merge branch 'master' into endpointurlresolver-api
bcornelis Nov 2, 2016
479afa7
revert privious implementation using the API endpoint method
bcornelis Nov 2, 2016
5c42f9a
Update the Config class to allow for EndpointURLResvoler configuration
bcornelis Nov 2, 2016
edccf7d
Remove unused imports
bcornelis Nov 2, 2016
e79727b
fix bug and support
tongh-qtl Nov 11, 2016
d96b825
avoid null pointer
tongh-qtl Nov 11, 2016
816e262
support snapshot_id in volume backups
Dec 2, 2016
41ea1da
telemetry_aodh support
zhangjianweibj Dec 6, 2016
f21f188
Merge pull request #898 from aiionx/master
auhlig Dec 8, 2016
4c1fec6
Merge pull request #862 from bcornelis/endpointurlresolver-api
auhlig Dec 9, 2016
2256542
telemetry_aodh test cases
zhangjianweibj Dec 12, 2016
0550287
Kept the portsecurityenabled property as undefined
Dec 16, 2016
17617cb
Merge pull request #904 from vinodborole/#768
vinodborole Dec 19, 2016
6589faf
Initialization function of BaseTelemetryAodhServices code optimize
zhangjianweibj Dec 22, 2016
41ea251
Merge pull request #900 from inspur-iop/openstack_telemetry_aodh_support
auhlig Dec 22, 2016
94c7a6b
add fields in TroveInstanceFlavor class (+ updated tests)
Dec 28, 2016
8670b9d
add a test file: DB Instance
Dec 28, 2016
dbffc68
update DBFlavorServiceImplTest
Dec 28, 2016
1676dbc
fix typo error
Dec 29, 2016
14bf1c0
add getDatastoreType&Version in TroveInstance
Dec 29, 2016
d22c301
add toString in TroveInstance
Dec 29, 2016
6f78722
add missing annotation
Dec 29, 2016
cd1f1a5
add ‘ip’ field in TroveInstance
Dec 29, 2016
8b851ac
Merge branch 'feature/trove'
Jan 3, 2017
b7c7f84
Merge pull request #910 from suho-hahn/master
auhlig Jan 3, 2017
7c3b2d4
Add api for nova service list
Jan 8, 2017
d5b3660
Minor syntax fix
Jan 10, 2017
431a64f
Issue 903: Bugfix to be able to remove the last route from a router
silvanstrueby Jan 10, 2017
fc934aa
code formatter...
silvanstrueby Jan 10, 2017
55e52c4
Merge pull request #914 from esommar/novaApi
auhlig Jan 11, 2017
de0646b
Merge pull request #917 from silvanstrueby/issue_903_remove_last_route
auhlig Jan 22, 2017
f7d0fa8
Bug #913: add SSLContext and HostnameVerifier to hashCode and equals
Jan 22, 2017
fd4f376
Merge pull request #923 from m-kochaji/master
auhlig Jan 23, 2017
58f091c
OS4J client for Openstack Glare
PavanVadavi Jan 25, 2017
369ab88
Some refactoring + more API implementation
PavanVadavi Jan 27, 2017
edd2642
Sample unit test case committed
PavanVadavi Feb 2, 2017
165b256
Fix for the failure of build + some more refactoring.
PavanVadavi Feb 3, 2017
77da5a8
Unit test cases added + some more refactoring.
PavanVadavi Feb 7, 2017
66fd60e
More java doc + some more refactoring.
PavanVadavi Feb 7, 2017
939464e
Removed test class from distribution
PavanVadavi Feb 8, 2017
6f970dc
Merge pull request #876 from whaon/master
vinodborole Feb 8, 2017
265dc81
Evacuate Server (evacuate Action)
test-1pro Feb 9, 2017
1dd132e
Add evacuate server Testunit.
test-1pro Feb 10, 2017
f98e183
Add the JSON contains the response as defined in OpenStacks API.
test-1pro Feb 13, 2017
0d60140
Update Test Code : assertNotNull -> assertEquals
test-1pro Feb 13, 2017
a8e0627
Merge pull request #931 from taemin77/master
auhlig Feb 14, 2017
4875223
- return commit update (evacuate)
test-1pro Feb 15, 2017
0e90fe8
Review comments incorporated
PavanVadavi Feb 16, 2017
383d545
More review comments incorporated
PavanVadavi Feb 21, 2017
7b91e2a
Merge pull request #926 from PavanVadavi/os4j_glare
auhlig Feb 23, 2017
a155383
added unit test readme
auhlig Feb 24, 2017
46caa58
Merge pull request #945 from auhlig/test-readme
auhlig Feb 26, 2017
92d98c4
fix domain null pointer exception
ayberkcal Feb 27, 2017
c3ef45e
Merge pull request #947 from ayberkcal/master
auhlig Feb 27, 2017
7ff6abd
fix typo
auhlig Feb 27, 2017
0f0064c
Use an entity for compute.getConsoleOutput API instead of JSON string
lorenzo-biava Feb 28, 2017
523ed20
Add unit tests for compute.getConsoleOutput API
lorenzo-biava Feb 28, 2017
d24cfee
add missed 'os-vol-host-attr:host' property on CinderVolume
ayberkcal Mar 1, 2017
1b9eb8e
Merge pull request #952 from ayberkcal/master
auhlig Mar 2, 2017
870fb10
Merge pull request #949 from lorenzo-biava/795-failed-to-get-console-log
auhlig Mar 2, 2017
30b2e35
extract etag from header for inclusion in the swift object
gonewest818 Mar 3, 2017
4f9e636
whitespace
gonewest818 Mar 3, 2017
d380cde
Unit test for etag parsing
gonewest818 Mar 4, 2017
bbf3243
run as non-root user in docker
gonewest818 Mar 5, 2017
346e51b
Merge pull request #958 from gonewest818/944-etag-support
auhlig Mar 5, 2017
5bd6da3
Merge remote-tracking branch 'upstream/master' into sahara
ekasitk Mar 6, 2017
daa7572
add public host property getter
ayberkcal Mar 6, 2017
fe7413c
Create subnet / Show subnet details
test-1pro Mar 6, 2017
e731076
Fixing port name list option.
evgenyfedoruk Mar 8, 2017
566ed7c
Merge pull request #959 from gonewest818/957-test-failure-in-docker
auhlig Mar 8, 2017
1f92d58
Merge pull request #962 from ayberkcal/master
auhlig Mar 8, 2017
33d07d4
Fixing port name list option.
evgenyfedoruk Mar 8, 2017
264f01b
Merge branch 'master' of https://github.com/evgenyfedoruk/openstack4j
evgenyfedoruk Mar 8, 2017
3459826
Merge branch 'master' of https://github.com/evgenyfedoruk/openstack4j
evgenyfedoruk Mar 8, 2017
4bab9bb
Merge branch 'master' of https://github.com/evgenyfedoruk/openstack4j
evgenyfedoruk Mar 8, 2017
0f3f038
Merge pull request #965 from evgenyfedoruk/master
auhlig Mar 9, 2017
5279ac6
Add Block Strage Service List API
test-1pro Mar 10, 2017
5d2e121
Block Storage Service Test class code update
test-1pro Mar 10, 2017
bc0531c
Block Storage Service Test class code update
test-1pro Mar 10, 2017
d2751d0
Adding neutron port binding data support.
evgenyfedoruk Mar 12, 2017
f0b3a00
Add Block Strage Service List API
test-1pro Mar 13, 2017
f32caf8
Revert "Create subnet / Show subnet details Add Optional Parameters f…
test-1pro Mar 14, 2017
b404ffd
Extended OS4J to support OpenStack Magnum Service APIs
sohaninfo Mar 14, 2017
cc4da64
Merge pull request #964 from taemin77/master
auhlig Mar 15, 2017
2db3d29
Merge pull request #967 from evgenyfedoruk/master
auhlig Mar 15, 2017
7431546
Merge branch 'master' into openstack4j-blockstorage
test-1pro Mar 15, 2017
a3d1450
Merge branch 'master' into master
sohaninfo Mar 15, 2017
cfe56fc
Typo: BlockStroageServices -> BlockStorageService
test-1pro Mar 16, 2017
a5510e9
Merge pull request #969 from sohaninfo/master
auhlig Mar 16, 2017
60eeceb
BlockStroageServices -> BlockStorageService
test-1pro Mar 16, 2017
498e0a3
Merge branch 'master' into openstack4j-blockstorage
test-1pro Mar 16, 2017
52cf7cb
Allow set ID when creating image
baseman79 Mar 16, 2017
6a84992
BlockStroageServicesService -> BlockStroageServiceService
test-1pro Mar 17, 2017
a0a853b
Merge pull request #961 from ekasitk/sahara
auhlig Mar 17, 2017
e0473df
fix using the wrong getter
baseman79 Mar 17, 2017
2df2afc
Merge pull request #972 from baseman79/master
auhlig Mar 17, 2017
38d44c8
BlockStroageServiceService -> BlockStorageServiceService (roa->ora)
test-1pro Mar 17, 2017
14ad070
BlockStroageService -> BlockStorageService (roa->ora)
test-1pro Mar 17, 2017
ff97f02
Merge pull request #968 from taemin77/openstack4j-blockstorage
auhlig Mar 17, 2017
92981ff
support ipv6 properties in subnet
test-1pro Mar 20, 2017
bfd2431
subnet test code update
test-1pro Mar 20, 2017
397e3bb
Implement Security Group Update API
ayberkcal Mar 20, 2017
7eab316
support updating enabledhcp in subnet
ayberkcal Mar 20, 2017
b309031
Merge pull request #976 from taemin77/master
auhlig Mar 20, 2017
639de2e
Merge pull request #978 from ayberkcal/master
auhlig Mar 20, 2017
8058aab
add security group and rules filterable list method
ayberkcal Mar 21, 2017
662d355
Merge pull request #981 from ayberkcal/master
auhlig Mar 22, 2017
3c0c00e
Fixed result return type for container APIs
sohaninfo Mar 24, 2017
edc887b
Merge remote-tracking branch 'upstream/master'
sohaninfo Mar 24, 2017
814b372
Merge pull request #984 from sohaninfo/master
auhlig Mar 27, 2017
e9a85ea
Allow passing additional properties for Glance V2
baseman79 Mar 31, 2017
ff6ae6e
Allow Port Creation in Bulk
Rizwan-Qamar Mar 31, 2017
ab4dff8
Merge pull request #986 from baseman79/master
auhlig Mar 31, 2017
76c50bd
Merge pull request #988 from Rizwan-Qamar/master
auhlig Mar 31, 2017
b440996
Add additional two preporties of block device api: disk_bus and devic…
baseman79 Apr 3, 2017
0e9d6b9
Merge pull request #989 from baseman79/master
auhlig Apr 17, 2017
d748377
3.0.4 release
auhlig Apr 19, 2017
f337610
SenlinNodeService: retrieve the properties about the physical object …
sakno Apr 24, 2017
d1d13cd
Merge pull request #1001 from sakno/master
auhlig May 4, 2017
6515717
designate v2 service
auhlig May 4, 2017
c6db075
fix formatting
auhlig May 7, 2017
d4fb1d9
Merge pull request #1011 from auhlig/designate
auhlig May 7, 2017
fcb1679
Merge pull request #999 from auhlig/3.0.4_release
auhlig May 7, 2017
23d2314
update maven-javadoc-plugin
auhlig May 8, 2017
710dd00
Solve the problem of hostAggregates creation failure
Cherry522 Feb 13, 2017
08b56ad
Add 'MTU' property to 'network'
Cherry522 Feb 14, 2017
cb2eaae
Add 'distributed' property to 'Router'.
Cherry522 Feb 14, 2017
c1902e0
Add 'state' and 'status' fields in 'ExtHypervisor'.
Cherry522 Feb 14, 2017
3a1f00e
minor fixes, formatting
auhlig May 8, 2017
12b9bc7
add a attaching volume funtion in Volumes
Cherry522 Feb 14, 2017
0d7cb67
fixing checkNotNull()
auhlig May 8, 2017
423d377
add os-hosts and os-services interface
Cherry522 Feb 15, 2017
92c3435
Override equal and hashcode method of Neutron class
JackSunshine May 9, 2017
97f296a
update method name from 'getAvaiablityZone()' to 'getAvailablityZone(…
Cherry522 Feb 16, 2017
d109051
add hostAggregates list test
Cherry522 Feb 17, 2017
6399cf3
add hostAggregates list create
Cherry522 Feb 17, 2017
ac15d6c
Merge pull request #1017 from auhlig/cherry_dev
auhlig May 9, 2017
78577a7
Api for glance image cache, list cached
esommar May 10, 2017
1a3b86a
Override equal and hashcode method of Neutron class
JackSunshine May 10, 2017
c98888f
Merge branch 'master' into master
JackSunshine May 10, 2017
441d2d7
Override equal and hashcode method of Neutron class
JackSunshine May 10, 2017
24e554e
Api for glance image cache, list cached
esommar May 10, 2017
7bb25a8
Merge remote-tracking branch 'origin/cached' into temp
esommar May 12, 2017
411f28b
Api for glance image cache, list cached
esommar May 12, 2017
22a7a05
Merge remote-tracking branch 'origin/cached' into temp
esommar May 12, 2017
209cd93
Fix unit test problem for resteasy connector
esommar May 17, 2017
e7279de
Merge pull request #1015 from JackSunshine/master
auhlig May 17, 2017
e6bc0b2
update guava version to 20.0 (21.0 supports only jdk8)
sodre90 May 12, 2017
d9a6417
Merge pull request #1021 from sequenceiq/update-guava
auhlig May 18, 2017
001d695
Minor change, int to Integer
esommar May 18, 2017
102c48f
Add http headers for supporting keystone tokenless
Apr 19, 2017
c636ce4
Merge pull request #1020 from esommar/cached
auhlig May 18, 2017
07fabdb
Merge pull request #1002 from ningyougang/master
auhlig May 18, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ Pull requests should be made against the master (development)
branch and include relevant tests, if applicable.

Code should compile and tests should pass under all Java versions
which the OpenStack4j currently supports. Currently we support
a minimum version of Java 6.
which the OpenStack4j currently supports.
Refer to [unit tests README](./core-test/README.md) or [integration tests README](./core-integration-test/README.md) for more details on how to write tests.
Currently we support a minimum version of Java 7.

Please insure all code is formatted like the rest of the API, well documented and same patterns applied. When configuring your IDE workspace make sure tabs are represented as spaces.

Expand Down
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@ FROM maven:latest

COPY . /usr/src/app
WORKDIR /usr/src/app

RUN useradd -m -u 1000 builder
RUN chown -R builder /usr/src/app
USER builder

RUN mvn clean compile

4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
IMAGE_NAME := openstack4j-dev$(if $(GIT_BRANCH),:$(GIT_BRANCH))
DOCKER_RUN := docker run --rm -it --privileged $(IMAGE_NAME)
DOCKER_RUN := docker run --rm -it --privileged -e MAVEN_CONFIG=/home/builder/.m2 $(IMAGE_NAME)

default: build

Expand All @@ -21,4 +21,4 @@ package: build
$(DOCKER_RUN) mvn clean package

build:
docker build -t "$(IMAGE_NAME)" .
docker build -t "$(IMAGE_NAME)" .
33 changes: 31 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ OpenStack4j version 2.0.0+ is now modular. One of the benefits to this is the a
<dependency>
<groupId>org.pacesys</groupId>
<artifactId>openstack4j</artifactId>
<version>3.0.3</version>
<version>3.0.4</version>
</dependency>
```

Expand All @@ -54,7 +54,7 @@ See notes above about connectors (same rules apply) to development branches.
<dependency>
<groupId>org.pacesys</groupId>
<artifactId>openstack4j</artifactId>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
</dependency>
```

Expand Down Expand Up @@ -177,6 +177,35 @@ OSClientV3 os = OSFactory.builderV3()
.scopeToProject(Identifier.byId("project id"))
.authenticate());
```
(5) authenticate using client certificate
```bash
openssl pkcs12 -export -out client-certificate-keystore.p12 -inkey key.pem -in cert.pem -certfile ca.pem
Enter Export Password:encrypt
Verifying - Enter Export Password:encrypt
```
```java
String encrypt = "encrypt";
KeyStore keyStore = KeyStore.getInstance("PKCS12");
keyStore.load(new FileInputStream(new File("client-certificate-keystore.p12")), encrypt.toCharArray());
SSLContext sslContext = SSLContexts.custom()
//ignore server verify
.loadTrustMaterial(new TrustStrategy() {
@Override
public boolean isTrusted(X509Certificate[] chain, String authType) throws CertificateException {
return true;
}
})
.loadKeyMaterial(keyStore,encrypt.toCharArray())
.build();
Config config = Config.newConfig();
config.withSSLContext(sslContext);
OSClient.OSClientV3 osClient = OSFactory.builderV3()
.endpoint("https://<fqdn>:5000/v3")
.withConfig(config)
.scopeToProject(Identifier.byId("project id"))
//.scopeToDomain(Identifier.byId("domain id"))
.authenticate();
```

#### Identity Operations (Keystone) V3

Expand Down
2 changes: 1 addition & 1 deletion connectors/http-connector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.pacesys.openstack4j.connectors</groupId>
<artifactId>openstack4j-connectors</artifactId>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
</parent>
<name>OpenStack4j HttpURL Connector</name>
<artifactId>openstack4j-http-connector</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion connectors/httpclient/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<parent>
<groupId>org.pacesys.openstack4j.connectors</groupId>
<artifactId>openstack4j-connectors</artifactId>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>openstack4j-httpclient</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion connectors/jersey2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<parent>
<groupId>org.pacesys.openstack4j.connectors</groupId>
<artifactId>openstack4j-connectors</artifactId>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>openstack4j-jersey2</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion connectors/okhttp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<parent>
<groupId>org.pacesys.openstack4j.connectors</groupId>
<artifactId>openstack4j-connectors</artifactId>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>openstack4j-okhttp</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion connectors/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<parent>
<groupId>org.pacesys</groupId>
<artifactId>openstack4j-parent</artifactId>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.pacesys.openstack4j.connectors</groupId>
Expand Down
2 changes: 1 addition & 1 deletion connectors/resteasy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<parent>
<groupId>org.pacesys.openstack4j.connectors</groupId>
<artifactId>openstack4j-connectors</artifactId>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>openstack4j-resteasy</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion core-integration-test/it-httpclient/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.pacesys</groupId>
<artifactId>openstack4j-core-integration-test</artifactId>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
</parent>
<artifactId>it-httpclient</artifactId>
<name>OpenStack4j IntegrationTest Apache HttpClient</name>
Expand Down
2 changes: 1 addition & 1 deletion core-integration-test/it-jersey2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.pacesys</groupId>
<artifactId>openstack4j-core-integration-test</artifactId>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
</parent>
<artifactId>it-jersey2</artifactId>
<name>OpenStack4j IntegrationTest Jersey2 Connector</name>
Expand Down
2 changes: 1 addition & 1 deletion core-integration-test/it-okhttp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.pacesys</groupId>
<artifactId>openstack4j-core-integration-test</artifactId>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
</parent>
<artifactId>it-okhttp</artifactId>
<name>OpenStack4j IntegrationTest OKHttp Connector</name>
Expand Down
2 changes: 1 addition & 1 deletion core-integration-test/it-resteasy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.pacesys</groupId>
<artifactId>openstack4j-core-integration-test</artifactId>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
</parent>
<artifactId>it-resteasy</artifactId>
<name>OpenStack4j IntegrationTest RestEasy Connector</name>
Expand Down
2 changes: 1 addition & 1 deletion core-integration-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<parent>
<groupId>org.pacesys</groupId>
<artifactId>openstack4j-parent</artifactId>
<version>3.0.4-SNAPSHOT</version>
<version>3.0.5-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>openstack4j-core-integration-test</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
/*
package org.openstack4j.api.dns.v2

import co.freeside.betamax.TapeMode
import groovy.util.logging.Slf4j
import org.junit.Rule
import org.junit.rules.TestName
import org.openstack4j.api.AbstractSpec
import org.openstack4j.api.Builders
import org.openstack4j.api.OSClient.OSClientV3
import org.openstack4j.model.common.ActionResponse
import org.openstack4j.model.common.Identifier
import org.openstack4j.model.dns.v2.Recordset
import org.openstack4j.openstack.OSFactory
import software.betamax.Configuration
import software.betamax.MatchRules
import software.betamax.TapeMode
import software.betamax.junit.Betamax
import software.betamax.junit.RecorderRule
import spock.lang.IgnoreIf

@Slf4j
class DesignateRecordsetServiceSpec extends AbstractSpec {

@Rule TestName DesignateRecordsetServiceTest
@Rule public RecorderRule recorderRule = new RecorderRule(
Configuration.builder()
.tapeRoot(new File(TAPEROOT + "identity.v3"))
//.defaultMatchRules(MatchRules.method, MatchRules.path, MatchRules.queryParams)
.defaultMode(TapeMode.WRITE_SEQUENTIAL)
.build());

// used for domain crud tests
def static final String RECORDSET_NAME = "Atest."
def static final String RECORDSET_TYPE = "A"
def static final List<String> RECORDSET_RECORDS= ["10.1.0.2"]
def static final String RECORDSET_DESCRIPTION = "This is my recordset."
def String ZONE_ID, ZONE_NAME, RECORDSET_ID

static final boolean skipTest

static {
if(
USER_ID == null ||
AUTH_URL == null ||
PASSWORD == null ||
DOMAIN_ID == null ) {

skipTest = true
}
else{
skipTest = false
}
}


// run before the first feature method; similar to JUnit's @BeforeClass
def setupSpec() {

if( skipTest != true ) {
log.info("USER_NAME: " + USER_NAME)
log.info("USER_DOMAIN_ID: " + USER_DOMAIN_ID)
log.info("AUTH_URL: " + AUTH_URL)
log.info("PROJECT_ID: " + PROJECT_ID)
}
else {
log.warn("Skipping integration-test cases because not all mandatory attributes are set.");
}
}

def setup() {
log.info("-> Test: '$DesignateRecordsetServiceTest.methodName'")
}


// ------------ DomainService Tests ------------

@IgnoreIf({ skipTest })
@Betamax(tape="recordsetService_crud")
def "dns/v2/recordset test cases"() {

given: "an authenticated OSClient"
OSClientV3 os = OSFactory.builderV3()
.endpoint(AUTH_URL)
.credentials(USER_NAME, PASSWORD, Identifier.byId(USER_DOMAIN_ID))
.scopeToProject(Identifier.byId(PROJECT_ID))
.withConfig(CONFIG_PROXY_BETAMAX)
.authenticate()

and: "get the id of a dns zone"
ZONE_ID = os.dns().zones().list().first().getId()

and: "the id of the zone shouldn't be null"
ZONE_ID != null

and: "get name of the zone"
ZONE_NAME = os.dns().zones().list().first().getName()

and: "the name of the zone shouldn't be null"
ZONE_NAME != null

when: "we try to create a recordset with argument 'null' "
os.dns().recordsets().create(null, null)

then: "a NPE is thrown"
thrown NullPointerException

when: "creating a recordset"
Recordset recordset = os.dns().recordsets().create(ZONE_ID, RECORDSET_NAME+ZONE_NAME, RECORDSET_TYPE, RECORDSET_RECORDS)

then: "the attributes of the recordset should be equal"
recordset.getName() == RECORDSET_NAME+ZONE_NAME
recordset.getZoneId() == ZONE_ID
recordset.getType() == RECORDSET_TYPE
recordset.getRecords() == RECORDSET_RECORDS

when: "getting the id of the recordset"
RECORDSET_ID = recordset.getId()

then: "this shouldn't be null"
RECORDSET_ID != null

when: "list recordsets owned by project"
List<? extends Recordset> recordsetList = os.dns().recordsets().list()

then: "the list shouldn't be empty and the recordset belongs to the project"
recordsetList.isEmpty() == false
recordsetList.first().getProjectId() == PROJECT_ID

when: "list recordsets in a zone"
List<? extends Recordset> recordsetListZone = os.dns().recordsets().list(ZONE_ID)

then: "the list shouldn't be empty and the recordset is within the zone"
recordsetListZone.isEmpty() == false
recordsetListZone.first().getZoneId() == ZONE_ID

when: "get a recordset by id"
Recordset recordsetById = os.dns().recordsets().get(ZONE_ID,RECORDSET_ID)

then: "the attributes of the recordset should be equal"
recordsetById.getZoneId() == ZONE_ID
recordsetById.getId() == RECORDSET_ID

when: "updating a recordset"
Recordset recordsetUpdated = os.dns().recordsets().update(ZONE_ID, Builders.recordset().id(RECORDSET_ID).description(RECORDSET_DESCRIPTION).build())

then: "the attribute of the recordset should be updated"
recordsetUpdated.getDescription() == RECORDSET_DESCRIPTION

when: "deleting a recordset"
ActionResponse deleteRecordset = os.dns().recordsets().delete(ZONE_ID,RECORDSET_ID)

then: "this should be successful"
deleteRecordset.isSuccess() == true

cleanup: "delete created recordset in case of errors"
os.dns().recordsets().delete(ZONE_ID,RECORDSET_ID)

}
}
*/
Loading