From 30054397a49279fcb7e36cdef1d8e4812c174b84 Mon Sep 17 00:00:00 2001 From: lifeifei Date: Thu, 5 Dec 2019 16:02:30 +0800 Subject: [PATCH] Update README.md --- README.md | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 6313f5904..c28c5df48 100644 --- a/README.md +++ b/README.md @@ -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("foobar@example.com") - .enabled(true) - .build()); + .domainId("domain id") + .name("foobar") + .password("secret") + .email("foobar@example.com") + .enabled(true) + .build()); //or User user = os.identity().users().create("domain id", "foobar", "secret", "foobar@example.org", true); @@ -257,11 +257,11 @@ os.identity().roles().getByName("role name); ```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 @@ -385,11 +385,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