Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

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

seems like unintentionally added

}
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.

Why is this removed?

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:
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:
type: "object"
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ public class MtaArchiveHelper {

private Map<String, String> mtaArchiveResources;
private Map<String, String> mtaArchiveModules;

public String getCreatedBy() {
return this.manifest.getMainAttributes().getValue("Created-By");
Copy link
Contributor

Choose a reason for hiding this comment

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

Constant extraction

}
private Map<String, String> mtaArchiveRequiresDependencies;

public MtaArchiveHelper(Manifest manifest) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.cloudfoundry.multiapps.controller.process.dynatrace;

import org.cloudfoundry.multiapps.common.Nullable;
import org.immutables.value.Value;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
Expand All @@ -12,6 +13,9 @@ public abstract class DynatraceProcessEvent implements DyntraceProcessEntity {

public abstract EventType getEventType();

@Nullable
public abstract String getCreatedBy();

public enum EventType {

STARTED, FINISHED, FAILED;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import org.cloudfoundry.multiapps.controller.process.dynatrace.DynatracePublisher;
import org.cloudfoundry.multiapps.controller.process.dynatrace.ImmutableDynatraceProcessEvent;
import org.cloudfoundry.multiapps.controller.process.util.ProcessConflictPreventer;
import org.cloudfoundry.multiapps.controller.process.variables.VariableHandling;
import org.cloudfoundry.multiapps.controller.process.variables.Variables;
Comment on lines +25 to +26
Copy link
Contributor

Choose a reason for hiding this comment

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

Unused imports

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ private void publishDynatraceEvent(DelegateExecution execution, ProcessType proc
.processId(VariableHandling.get(execution,
Variables.CORRELATION_ID))
.mtaId(VariableHandling.get(execution, Variables.MTA_ID))
.createdBy(VariableHandling.get(execution, Variables.MTA_ARCHIVE_CREATED_BY))
.spaceId(VariableHandling.get(execution, Variables.SPACE_GUID))
.eventType(DynatraceProcessEvent.EventType.FINISHED)
.processType(processType)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ private void processApplicationArchive(ProcessContext context, String appArchive
context.getRequiredVariable(Variables.SPACE_GUID), appArchiveId);
context.setVariable(Variables.ARCHIVE_ENTRIES_POSITIONS, archiveEntriesWithStreamPositions);
MtaArchiveHelper helper = createMtaArchiveHelperFromManifest(context, appArchiveId, archiveEntriesWithStreamPositions);

context.setVariable(Variables.MTA_ARCHIVE_CREATED_BY, helper.getCreatedBy());
DeploymentDescriptor deploymentDescriptor = extractDeploymentDescriptor(context, appArchiveId, archiveEntriesWithStreamPositions);

if (context.getVariable(Variables.SHOULD_BACKUP_PREVIOUS_VERSION)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,10 @@ public interface Variables {
.type(Variable.typeReference(MtaArchiveElements.class))
.defaultValue(new MtaArchiveElements())
.build();
Variable<String> MTA_ARCHIVE_CREATED_BY = ImmutableJsonStringVariable.<String> builder()
.name("mtaArchiveCreatedBy")
.defaultValue(null)
.build();
Variable<CloudServiceInstanceExtended> SERVICE_TO_PROCESS = ImmutableJsonStringVariable.<CloudServiceInstanceExtended> builder()
.name("serviceToProcess")
.type(Variable.typeReference(
Expand Down
Loading