mesosphere.marathon.client.model.v2.Result Java Examples

The following examples show how to use mesosphere.marathon.client.model.v2.Result. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CommandUninstallTest.java    From minimesos with Apache License 2.0 5 votes vote down vote up
@Test
public void execute_group() throws UnsupportedEncodingException {
    // Given
    commandUninstall.setGroup("/group");
    when(marathon.deleteGroup("/group")).thenReturn(new Result());

    // When
    commandUninstall.execute();

    // Then
    String string = outputStream.toString("UTF-8");
    assertEquals("Deleted group '/group'\n", string);
}
 
Example #2
Source File: CommandUninstallTest.java    From minimesos with Apache License 2.0 5 votes vote down vote up
@Test
public void execute_app() throws UnsupportedEncodingException {
    // Given
    commandUninstall.setApp("/app");
    when(marathon.deleteApp("/app")).thenReturn(new Result());

    // When
    commandUninstall.execute();

    // Then
    String string = outputStream.toString("UTF-8");
    assertEquals("Deleted app '/app'\n", string);
}
 
Example #3
Source File: MarathonContainer.java    From minimesos with Apache License 2.0 5 votes vote down vote up
@Override
public Result deleteGroup(String groupId) {
    mesosphere.marathon.client.Marathon marathon = MarathonClient.getInstance(getMarathonEndpoint());
    try {
        Result result = marathon.deleteGroup(groupId);
        LOGGER.debug(format("Deleted app '%s' at '%s'", groupId, getMarathonEndpoint()));
        return result;
    } catch (MarathonException e) {
        throw new MinimesosException("Could not delete group '" + groupId  + "'. " + e.getMessage());
    }
}
 
Example #4
Source File: MarathonContainer.java    From minimesos with Apache License 2.0 5 votes vote down vote up
@Override
public Result deleteApp(String appId) {
    mesosphere.marathon.client.Marathon marathon = MarathonClient.getInstance(getMarathonEndpoint());
    try {
        Result result = marathon.deleteApp(appId);
        LOGGER.debug(format("Deleted app '%s' at '%s'", appId, getMarathonEndpoint()));
        return result;
    } catch (MarathonException e) {
        throw new MinimesosException("Could not delete app '" + appId  + "'. " + e.getMessage());
    }
}
 
Example #5
Source File: DCOS.java    From marathon-client with Apache License 2.0 4 votes vote down vote up
@RequestLine("POST /v2/groups?force={force}")
@Headers(HeaderUtils.MARATHON_API_SOURCE_HEADER)
Result createGroup(@Param("force") boolean force, Group group) throws DCOSException;
 
Example #6
Source File: Marathon.java    From marathon-client with Apache License 2.0 4 votes vote down vote up
@RequestLine("DELETE /v2/groups/{id}")
Result deleteGroup(@Named("id") String id) throws MarathonException;
 
Example #7
Source File: Marathon.java    From marathon-client with Apache License 2.0 4 votes vote down vote up
@RequestLine("POST /v2/groups")
Result createGroup(Group group) throws MarathonException;
 
Example #8
Source File: Marathon.java    From marathon-client with Apache License 2.0 4 votes vote down vote up
@RequestLine("DELETE /v2/apps/{id}")
Result deleteApp(@Named("id") String id) throws MarathonException;
 
Example #9
Source File: DCOS.java    From marathon-client with Apache License 2.0 4 votes vote down vote up
@RequestLine("GET /v2/groups/{id}/versions")
@Headers(HeaderUtils.MARATHON_API_SOURCE_HEADER)
Result getGroupVersion(@Param("id") String id) throws DCOSException;
 
Example #10
Source File: DCOS.java    From marathon-client with Apache License 2.0 4 votes vote down vote up
@RequestLine("DELETE /v2/groups/{id}?force={force}")
@Headers(HeaderUtils.MARATHON_API_SOURCE_HEADER)
Result deleteGroups(@Param("id") String id,
                    @Param("force") boolean force)
        throws DCOSException;
 
Example #11
Source File: DCOS.java    From marathon-client with Apache License 2.0 4 votes vote down vote up
@RequestLine("DELETE /v2/groups?force={force}")
@Headers(HeaderUtils.MARATHON_API_SOURCE_HEADER)
Result deleteGroup(@Param("force") boolean force) throws DCOSException;
 
Example #12
Source File: Marathon.java    From marathon-client with Apache License 2.0 4 votes vote down vote up
@RequestLine("PUT /v2/apps/{app_id}?force={force}")
@Headers(HeaderUtils.MARATHON_API_SOURCE_HEADER)
Result updateApp(@Param("app_id") String appId, App app,
		@Param("force") boolean force) throws MarathonException;
 
Example #13
Source File: DCOS.java    From marathon-client with Apache License 2.0 4 votes vote down vote up
@RequestLine("PUT /v2/groups?force={force}")
@Headers(HeaderUtils.MARATHON_API_SOURCE_HEADER)
Result modifyGroup(@Param("force") boolean force, Group group) throws DCOSException;
 
Example #14
Source File: DCOS.java    From marathon-client with Apache License 2.0 4 votes vote down vote up
@RequestLine("DELETE /v2/deployments/{deploymentId}?force={force}")
@Headers(HeaderUtils.MARATHON_API_SOURCE_HEADER)
Result deleteDeployment(@Param("deploymentId") String id) throws DCOSException;
 
Example #15
Source File: DCOS.java    From marathon-client with Apache License 2.0 4 votes vote down vote up
@RequestLine("DELETE /v2/apps/{appId}/tasks/{taskId}?force={force}&scale=true")
@Headers(HeaderUtils.MARATHON_API_SOURCE_HEADER)
Result deleteAppTasksAndScaleWithTaskId(@Param("appId") String appId,
                                        @Param("taskId") String taskId,
                                        @Param("force") boolean force)
        throws DCOSException;
 
Example #16
Source File: DCOS.java    From marathon-client with Apache License 2.0 4 votes vote down vote up
@RequestLine("DELETE /v2/apps/{appId}/tasks?host={host}&force={force}&scale=true")
@Headers(HeaderUtils.MARATHON_API_SOURCE_HEADER)
Result deleteAppTasksAndScaleWithHost(@Param("appId") String appId,
                                      @Param("host") String host,
                                      @Param("force") boolean force)
        throws DCOSException;
 
Example #17
Source File: DCOS.java    From marathon-client with Apache License 2.0 4 votes vote down vote up
@RequestLine("DELETE /v2/apps/{appId}?force={force}")
@Headers(HeaderUtils.MARATHON_API_SOURCE_HEADER)
Result deleteApp(@Param("appId") String appId,
                 @Param("force") boolean force)
        throws DCOSException;
 
Example #18
Source File: Marathon.java    From marathon-client with Apache License 2.0 4 votes vote down vote up
@RequestLine("DELETE /v2/deployments/{deploymentId}")
@Headers(HeaderUtils.MARATHON_API_SOURCE_HEADER)
Result cancelDeploymentAndRollback(@Param("deploymentId") String id) throws MarathonException;
 
Example #19
Source File: Marathon.java    From marathon-client with Apache License 2.0 4 votes vote down vote up
@RequestLine("PUT /v2/groups/{id}?force={force}")
@Headers(HeaderUtils.MARATHON_API_SOURCE_HEADER)
Result updateGroup(@Param("id") String id, @Param("force") boolean force, Group group) throws MarathonException;
 
Example #20
Source File: Marathon.java    From marathon-client with Apache License 2.0 4 votes vote down vote up
@RequestLine("DELETE /v2/groups/{id}?force={force}")
@Headers(HeaderUtils.MARATHON_API_SOURCE_HEADER)
Result deleteGroup(@Param("id") String id, @Param("force") boolean force) throws MarathonException;
 
Example #21
Source File: Marathon.java    From marathon-client with Apache License 2.0 4 votes vote down vote up
@RequestLine("POST /v2/groups")
@Headers(HeaderUtils.MARATHON_API_SOURCE_HEADER)
Result createGroup(Group group) throws MarathonException;
 
Example #22
Source File: Marathon.java    From marathon-client with Apache License 2.0 4 votes vote down vote up
@RequestLine("DELETE /v2/apps/{id}")
@Headers(HeaderUtils.MARATHON_API_SOURCE_HEADER)
Result deleteApp(@Param("id") String id) throws MarathonException;
 
Example #23
Source File: Marathon.java    From marathon-client with Apache License 2.0 4 votes vote down vote up
@RequestLine("POST /v2/apps/{id}/restart?force={force}")
@Headers(HeaderUtils.MARATHON_API_SOURCE_HEADER)
Result restartApp(@Param("id") String id, @Param("force") boolean force) throws MarathonException;
 
Example #24
Source File: Marathon.java    From minimesos with Apache License 2.0 2 votes vote down vote up
/**
 * Delete the given app
 *
 * @param app to be deleted
 */
Result deleteApp(String app);
 
Example #25
Source File: Marathon.java    From minimesos with Apache License 2.0 2 votes vote down vote up
/**
 * Deploy a Marathon application group.
 *
 * @param group group name
 */
Result deleteGroup(String group);