Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
181 changes: 0 additions & 181 deletions multiapps-controller-api/src/main/resources/mtarest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,127 +37,6 @@ paths:
$ref: "#/definitions/Info"
security:
- oauth2: []
/api/v1/spaces/{spaceGuid}/files:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not delete this. Must be checked why always deleted after build

get:
summary: ""
description: "Retrieves all Multi-Target Application files "
operationId: "getMtaFiles"
produces:
- "application/json"
parameters:
- name: "spaceGuid"
in: "path"
description: "GUID of space with mtas"
required: true
type: "string"
- name: "namespace"
in: "query"
description: "Filter mtas by namespace"
required: false
type: "string"
responses:
200:
description: "OK"
schema:
type: "array"
items:
$ref: "#/definitions/FileMetadata"
security:
- oauth2: []
post:
summary: ""
description: "Uploads a Multi Target Application archive or an Extension Descriptor "
operationId: "uploadMtaFile"
consumes:
- "multipart/form-data"
produces:
- "application/json"
parameters:
- name: "spaceGuid"
in: "path"
description: "GUID of space you wish to deploy in"
required: true
type: "string"
- name: "namespace"
in: "query"
description: "file namespace"
required: false
type: "string"
responses:
200:
description: "successful operation"
schema:
$ref: "#/definitions/FileMetadata"
201:
description: "Created"
schema:
$ref: "#/definitions/FileMetadata"
security:
- oauth2: []
/api/v1/spaces/{spaceGuid}/files/async:
post:
summary: ""
description: "Uploads a Multi Target Application archive or an Extension Descriptor\
\ from a remote endpoint"
operationId: "startUploadFromUrl"
consumes:
- "application/json"
parameters:
- name: "spaceGuid"
in: "path"
description: "GUID of space you wish to deploy in"
required: true
type: "string"
- name: "namespace"
in: "query"
description: "file namespace"
required: false
type: "string"
- in: "body"
name: "body"
description: "URL reference to a remote file"
required: false
schema:
$ref: "#/definitions/FileUrl"
responses:
202:
description: "Accepted"
security:
- oauth2: []
/api/v1/spaces/{spaceGuid}/files/jobs/{jobId}:
get:
summary: ""
description: "Gets the status of an async upload job"
operationId: "getAsyncUploadJob"
produces:
- "application/json"
parameters:
- name: "spaceGuid"
in: "path"
description: "GUID of space you wish to deploy in"
required: true
type: "string"
- name: "namespace"
in: "query"
description: "file namespace"
required: false
type: "string"
- name: "jobId"
in: "path"
description: "ID of the upload job"
required: true
type: "string"
responses:
200:
description: "OK"
schema:
$ref: "#/definitions/AsyncUploadResult"
201:
description: "Created"
schema:
$ref: "#/definitions/AsyncUploadResult"
security:
- oauth2: []
/api/v1/spaces/{spaceGuid}/mtas:
get:
summary: ""
Expand Down Expand Up @@ -403,66 +282,6 @@ securityDefinitions:
flow: "password"
scopes: {}
definitions:
AsyncUploadResult:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

type: "object"
properties:
status:
type: "string"
readOnly: true
enum:
- "RUNNING"
- "FINISHED"
- "ERROR"
bytes_processed:
type: "integer"
format: "int64"
readOnly: true
error:
type: "string"
readOnly: true
file:
readOnly: true
$ref: "#/definitions/FileMetadata"
mta_id:
type: "string"
readOnly: true
client_actions:
type: "array"
readOnly: true
items:
type: "string"
enum:
- "RETRY_UPLOAD"
FileMetadata:
type: "object"
properties:
id:
type: "string"
readOnly: true
name:
type: "string"
readOnly: true
size:
type: "integer"
readOnly: true
digest:
type: "string"
readOnly: true
digestAlgorithm:
type: "string"
readOnly: true
space:
type: "string"
readOnly: true
namespace:
type: "string"
readOnly: true
FileUrl:
type: "object"
properties:
file_url:
type: "string"
readOnly: true
Info:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert the changes to this file.

type: "object"
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public final class Messages {
public static final String THREAD_MONITOR_CACHE_TIMEOUT = "Flowable thread monitor cache timeout: {0} seconds";
public static final String SPACE_DEVELOPERS_CACHE_TIME_IN_SECONDS = "Cache for list of space developers per SpaceGUID: {0} seconds";
public static final String APP_SHUTDOWN_REQUEST = "Application with id:\"{0}\", instance id:\"{1}\", instance index:\"{2}\", is requested to shutdown. Timeout to wait before shutdown of Flowable job executor:\"{3}\" seconds.";
public static final String APP_SHUTDOWNED = "Application with id:\"{0}\", instance id:\"{1}\", instance index:\"{2}\", is shutdowned. Timeout to wait before shutdown of Flowable job executor:\"{3}\" seconds.";
public static final String APP_SUCCESSFULLY_SHUTDOWN = "Application with id:\"{0}\", instance id:\"{1}\", instance index:\"{2}\", is shutdown. Timeout to wait before shutdown of Flowable job executor:\"{3}\" seconds.";
public static final String APP_SHUTDOWN_STATUS_MONITOR = "Monitor shutdown status of application with id:\"{0}\", instance id:\"{1}\", instance index:\"{2}\". Status:\"{3}\".";
public static final String CONTROLLER_CLIENT_SSL_HANDSHAKE_TIMEOUT_IN_SECONDS = "Controller client SSL handshake timeout in seconds: {0}";
public static final String CONTROLLER_CLIENT_CONNECT_TIMEOUT_IN_SECONDS = "Controller client connect timeout in seconds: {0}";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public AppSuffixDeterminer(boolean keepOriginalNamesAfterDeploy, boolean isAfter
this.isAfterResumePhase = isAfterResumePhase;
}

public boolean shouldAppendApplicationSuffix() {
public boolean shouldAppendIdleSuffix() {
return keepOriginalNamesAfterDeploy && isAfterResumePhase;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ private DeployedMtaApplication findDeployedApplication(String moduleName, Deploy

private String getApplicationName(Module module) {
String applicationName = NameUtil.getApplicationName(module);
if (appSuffixDeterminer.shouldAppendApplicationSuffix()) {
if (appSuffixDeterminer.shouldAppendIdleSuffix()) {
applicationName += BlueGreenApplicationNameSuffix.IDLE.asSuffix();
}
return applicationName;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package org.cloudfoundry.multiapps.controller.core.cf.detect;

import static org.junit.jupiter.api.Assertions.assertEquals;

import java.util.stream.Stream;

import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;

import static org.junit.jupiter.api.Assertions.assertEquals;

class AppSuffixDeterminerTest {

static Stream<Arguments> testAppSuffixDeterminer() {
return Stream.of(
//@formatter:off
//@formatter:off
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still necessary?

// (1) Keep original app names is not set and the process is not after resume phase
Arguments.of(false, false, false),
// (2) Keep original app names is set but the process is not after resume phase
Expand All @@ -29,6 +29,6 @@ static Stream<Arguments> testAppSuffixDeterminer() {
@MethodSource
void testAppSuffixDeterminer(boolean keepOriginalNamesAfterDeploy, boolean isAfterResumePhase, boolean shouldAppendApplicationSuffix) {
AppSuffixDeterminer appSuffixDeterminer = new AppSuffixDeterminer(keepOriginalNamesAfterDeploy, isAfterResumePhase);
assertEquals(shouldAppendApplicationSuffix, appSuffixDeterminer.shouldAppendApplicationSuffix());
assertEquals(shouldAppendApplicationSuffix, appSuffixDeterminer.shouldAppendIdleSuffix());
}
}
Loading
Loading