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

Update README.md #1294

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
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 CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ As a result we have added 2.0-maintenance branch which is the path to EOL for Op
* Instead of the old version-mixed OSClient a OSClientV2 for only Identity V2 API and OSClientV3 for only Identity V3 API are available
* Same refactoring for the OSClientSession: introducing new OSClientSessionV2 and OSClientV3

### 2.20
### 2.1.0

This marks the last of the 2.X OpenStack4j versioning scheme. Going forward only critical or specific pull requests will justify future release. It is strongly encourage to consider moving to OpenStack4j 3.0.X which offers the full Identity V3 Support.

Expand Down
40 changes: 19 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ The legacy Identity V2 API now uses the class ```OSClientV2``` in place of the c
```java
// Identity V2 Authentication Example
OSClientV2 os = OSFactory.builderV2()
.endpoint("http://127.0.0.1:5000/v2.0")
.credentials("admin","sample")
.tenantName("admin")
.authenticate();
.endpoint("http://127.0.0.1:5000/v2.0")
.credentials("admin","sample")
.tenantName("admin")
.authenticate();
```

##### Using Identity V3 authentication
Expand Down Expand Up @@ -219,12 +219,12 @@ The examples below are only a small fraction of the existing API so please refer
```java
// Create a User associated to the new Project
User user = os.identity().users().create(Builders.user()
.domainId("domain id")
.name("foobar")
.password("secret")
.email("[email protected]")
.enabled(true)
.build());
.domainId("domain id")
.name("foobar")
.password("secret")
.email("[email protected]")
.enabled(true)
.build());
//or
User user = os.identity().users().create("domain id", "foobar", "secret", "[email protected]", true);

Expand Down Expand Up @@ -253,15 +253,14 @@ os.identity().roles().getByName("role name);
```

**Project operations**

```java
// Create a project
os.identity().project().create(Builders.project()
.name("project name")
.description("project description")
.domainId("project domain id")
.enabled(true)
.build());
.name("project name")
.description("project description")
.domainId("project domain id")
.enabled(true)
.build());
```

#### Identity Operations (Keystone) V2
Expand Down Expand Up @@ -385,11 +384,10 @@ InputStream is = os.images().getAsStream("imageId");
// (URL Payload in this example, File, InputStream are other payloads available)
Image image = os.images().create(Builders.image()
.name("Cirros 0.3.0 x64")
.isPublic(true)
.containerFormat(ContainerFormat.BARE)
.diskFormat(DiskFormat.QCOW2)
.build()
), Payloads.create(new URL("https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img")));
.isPublic(true)
.containerFormat(ContainerFormat.BARE)
.diskFormat(DiskFormat.QCOW2)
.build()), Payloads.create(new URL("https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img")));
```

License
Expand Down