Skip to content

Commit 2f504b4

Browse files
committed
Update im api documentation
1 parent 7bb35d7 commit 2f504b4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,23 @@ The log4j.properties file of the tests can help you with the logger configuratio
3737

3838
1.4 USAGE
3939
-----------------
40-
The tests defined in the class **InfrastructureManagerApiClientTest** show how to use the im-java-api.
40+
The tests defined in the class **InfrastructureManagerTest** show how to use the im-java-api.
4141
Also check the following lines to see some examples of use:
4242

4343
### 1.4.1 Create the API client
4444
```
45-
InfrastructureManagerApiClient imClient = new InfrastructureManagerApiClient("IM_ENDPOINT", "AUTH_FILE_PATH");
45+
InfrastructureManager im = new InfrastructureManager("IM_ENDPOINT", "AUTH_FILE_PATH");
4646
```
47-
When creating a new client you have to specify a valid IM URL, and an authorization file path with the credentials required for the infrastrcture deployment.
47+
When creating a new client you have to specify a valid IM URL, and an authorization file path with the credentials required for the infrastructure deployment.
4848
More information about the authorization file can be found here: [Auth file](http://www.grycap.upv.es/im/doc/client.html#auth-file).
4949
You can also check the authorization file used for the tests that is available in 'src/test/resources/'.
5050

5151
### 1.4.2 Create and destroy an infrastructure
5252
```
5353
// Infrastructure creation based on a TOSCA file
54-
ServiceResponse response = getImApiClient().createInfrastructure(FileIO.readUTF8File(TOSCA_FILE_PATH));
54+
InfrastructureUri newInfrastructureUri = im.createInfrastructure(readFile(TOSCA_FILE_PATH), BodyContentType.TOSCA);
5555
... USE THE INFRASTRUCTURE ...
5656
// Infrastructure destruction
57-
imClient.destroyInfrastructure(getInfrastructureId());
57+
im.destroyInfrastructure(getInfrastructureId());
5858
```
59-
The **ServiceResponse** class returned by the **createInfrastructure** method contains all the information of the web service response. Check the **ServiceResponse** class methods for more information.
59+
The 'im' client always returns a POJO with the information of the call. If an error occurs, an **ImClientErrorException** is thrown. This exception contains the error message and the error code returned by the server.

0 commit comments

Comments
 (0)