Package com.octopusdeploy.api
Class EnvironmentsApi
- java.lang.Object
-
- com.octopusdeploy.api.EnvironmentsApi
-
public class EnvironmentsApi extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description EnvironmentsApi(AuthenticatedWebClient webClient)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<Environment>
getAllEnvironments()
Get all environments from the Octopus server as Environment objects.Environment
getEnvironmentByName(java.lang.String name)
Get the Environment with the given name if it exists, return null otherwise.Environment
getEnvironmentByName(java.lang.String name, boolean ignoreCase)
Get the Environment with the given name if it exists, return null otherwise.
-
-
-
Constructor Detail
-
EnvironmentsApi
public EnvironmentsApi(AuthenticatedWebClient webClient)
-
-
Method Detail
-
getAllEnvironments
public java.util.Set<Environment> getAllEnvironments() throws java.lang.IllegalArgumentException, java.io.IOException
Get all environments from the Octopus server as Environment objects.- Returns:
- A set of all environments on the Octopus server.
- Throws:
java.lang.IllegalArgumentException
- when the web client receives a bad parameterjava.io.IOException
- When the AuthenticatedWebClient receives and error response code
-
getEnvironmentByName
public Environment getEnvironmentByName(java.lang.String name) throws java.lang.IllegalArgumentException, java.io.IOException
Get the Environment with the given name if it exists, return null otherwise. Only selects the environment if the name is an exact match (including case)- Parameters:
name
- The name of the Environment to find.- Returns:
- The Environment with that name.
- Throws:
java.lang.IllegalArgumentException
- when the web client receives a bad parameterjava.io.IOException
- When the AuthenticatedWebClient receives and error response code
-
getEnvironmentByName
public Environment getEnvironmentByName(java.lang.String name, boolean ignoreCase) throws java.lang.IllegalArgumentException, java.io.IOException
Get the Environment with the given name if it exists, return null otherwise.- Parameters:
name
- The name of the Environment to find.ignoreCase
- when true uses equalsIgnoreCase in the name check- Returns:
- The Environment with that name.
- Throws:
java.lang.IllegalArgumentException
- when the web client receives a bad parameterjava.io.IOException
- When the AuthenticatedWebClient receives and error response code
-
-