Skip to content

Commit

Permalink
Merge branch 'apache:main' into NIFI-11259-test-01-20240122
Browse files Browse the repository at this point in the history
  • Loading branch information
jrsteinebrey authored Jan 22, 2024
2 parents bcf4373 + 33c5f38 commit eeae1b1
Show file tree
Hide file tree
Showing 1,324 changed files with 38,140 additions and 22,368 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ jobs:
${{ env.MAVEN_VERIFY_COMMAND }}
${{ env.MAVEN_BUILD_PROFILES }}
-P report-code-coverage
-P python-unit-tests
${{ env.MAVEN_PROJECTS }}
- name: Codecov
uses: codecov/codecov-action@v3
Expand Down Expand Up @@ -238,6 +239,7 @@ jobs:
${{ env.MAVEN_COMMAND }}
${{ env.MAVEN_VERIFY_COMMAND }}
${{ env.MAVEN_BUILD_PROFILES }}
-P python-unit-tests
${{ env.MAVEN_PROJECTS }}
- name: Upload Test Reports
uses: actions/upload-artifact@v3
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ nb-configuration.xml
.vscode/
.java-version
/nifi-nar-bundles/nifi-py4j-bundle/nifi-python-extension-api/src/main/python/dist/
__pycache__
2 changes: 1 addition & 1 deletion .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@

package org.apache.nifi.c2.protocol.api;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import org.apache.nifi.c2.protocol.component.api.RuntimeManifest;

import java.io.Serializable;

@ApiModel
public class AgentInfo implements Serializable {
private static final long serialVersionUID = 1L;

Expand All @@ -33,10 +31,7 @@ public class AgentInfo implements Serializable {
private RuntimeManifest agentManifest;
private AgentStatus status;

@ApiModelProperty(
value = "A unique identifier for the Agent",
notes = "Usually set when the agent is provisioned and deployed",
required = true)
@Schema(description = "A unique identifier for the Agent. Usually set when the agent is provisioned and deployed")
public String getIdentifier() {
return identifier;
}
Expand All @@ -45,9 +40,7 @@ public void setIdentifier(String identifier) {
this.identifier = identifier;
}

@ApiModelProperty(
value = "The class or category label of the agent, e.g., 'sensor-collector'",
notes = "Usually set when the agent is provisioned and deployed")
@Schema(description = "The class or category label of the agent, e.g., 'sensor-collector'. Usually set when the agent is provisioned and deployed")
public String getAgentClass() {
return agentClass;
}
Expand All @@ -56,7 +49,7 @@ public void setAgentClass(String agentClass) {
this.agentClass = agentClass;
}

@ApiModelProperty("The hash code of the manifest definition generated by the agent.")
@Schema(description = "The hash code of the manifest definition generated by the agent.")
public String getAgentManifestHash() {
return this.agentManifestHash;
}
Expand All @@ -65,7 +58,7 @@ public void setAgentManifestHash(String agentManifestHash) {
this.agentManifestHash = agentManifestHash;
}

@ApiModelProperty("The specification of the agent's capabilities")
@Schema(description = "The specification of the agent's capabilities")
public RuntimeManifest getAgentManifest() {
return agentManifest;
}
Expand All @@ -74,7 +67,7 @@ public void setAgentManifest(RuntimeManifest runtimeManifest) {
this.agentManifest = runtimeManifest;
}

@ApiModelProperty("A summary of the runtime status of the agent")
@Schema(description = "A summary of the runtime status of the agent")
public AgentStatus getStatus() {
return status;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,16 @@

package org.apache.nifi.c2.protocol.api;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Objects;
import java.util.Set;

import io.swagger.v3.oas.annotations.media.Schema;
import org.apache.nifi.c2.protocol.component.api.RuntimeManifest;

@ApiModel
public class AgentManifest extends RuntimeManifest {
private static final long serialVersionUID = 1L;

@ApiModelProperty("All supported operations by agent")
@Schema(description = "All supported operations by agent")
private Set<SupportedOperation> supportedOperations;

public AgentManifest() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,14 @@

package org.apache.nifi.c2.protocol.api;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;

@ApiModel
public class AgentRepositories implements Serializable {
private static final long serialVersionUID = 1L;

private AgentRepositoryStatus flowFile;
private AgentRepositoryStatus provenance;

@ApiModelProperty
public AgentRepositoryStatus getFlowFile() {
return flowFile;
}
Expand All @@ -37,7 +33,6 @@ public void setFlowFile(AgentRepositoryStatus flowFile) {
this.flowFile = flowFile;
}

@ApiModelProperty
public AgentRepositoryStatus getProvenance() {
return provenance;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@

package org.apache.nifi.c2.protocol.api;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;

import java.io.Serializable;

@ApiModel
public class AgentRepositoryStatus implements Serializable {
private static final long serialVersionUID = 1L;

Expand All @@ -31,7 +29,7 @@ public class AgentRepositoryStatus implements Serializable {
private Long dataSize;
private Long dataSizeMax;

@ApiModelProperty(value = "The number of items in the repository", allowableValues = "range[0, 9223372036854775807]")
@Schema(description = "The number of items in the repository", allowableValues = "range[0, 9223372036854775807]")
public Long getSize() {
return size;
}
Expand All @@ -40,7 +38,7 @@ public void setSize(Long size) {
this.size = size;
}

@ApiModelProperty(value = "The maximum number of items the repository is capable of storing", allowableValues = "range[0, 9223372036854775807]")
@Schema(description = "The maximum number of items the repository is capable of storing", allowableValues = "range[0, 9223372036854775807]")
public Long getSizeMax() {
return sizeMax;
}
Expand All @@ -49,7 +47,7 @@ public void setSizeMax(Long sizeMax) {
this.sizeMax = sizeMax;
}

@ApiModelProperty(value = "The data size (in Bytes) of all items in the repository", allowableValues = "range[0, 9223372036854775807]")
@Schema(description = "The data size (in Bytes) of all items in the repository", allowableValues = "range[0, 9223372036854775807]")
public Long getDataSize() {
return dataSize;
}
Expand All @@ -58,7 +56,7 @@ public void setDataSize(Long dataSize) {
this.dataSize = dataSize;
}

@ApiModelProperty(value = "The maximum data size (in Bytes) that the repository is capable of storing", allowableValues = "range[0, 9223372036854775807]")
@Schema(description = "The maximum data size (in Bytes) that the repository is capable of storing", allowableValues = "range[0, 9223372036854775807]")
public Long getDataSizeMax() {
return dataSizeMax;
}
Expand All @@ -75,7 +73,7 @@ public void setDataSizeMax(Long dataSizeMax) {
*
* @return a decimal between [0, 1] representing the sizeMax utilization percentage
*/
@ApiModelProperty(hidden = true)
@Schema(hidden = true)
public Double getSizeUtilization() {
return size != null && sizeMax != null && sizeMax > 0 ? (double) size / (double) sizeMax : null;
}
Expand All @@ -86,7 +84,7 @@ public Double getSizeUtilization() {
*
* @return a decimal between [0, 1] representing the dataSizeMax utilization percentage
*/
@ApiModelProperty(hidden = true)
@Schema(hidden = true)
public Double getDataSizeUtilization() {
return dataSize != null && dataSizeMax != null && dataSizeMax > 0 ? (double) dataSize / (double) dataSizeMax : null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,20 @@

package org.apache.nifi.c2.protocol.api;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;

import java.io.Serializable;

/**
* Resource consumption of the given agent
*/
@ApiModel
public class AgentResourceConsumption implements Serializable {
private static final long serialVersionUID = 1L;

private Long memoryUsage;
private Double cpuUtilization;

@ApiModelProperty("The memory footprint of the agent in bytes.")
@Schema(description = "The memory footprint of the agent in bytes.")
public Long getMemoryUsage() {
return memoryUsage;
}
Expand All @@ -40,7 +39,7 @@ public void setMemoryUsage(Long memoryUsage) {
this.memoryUsage = memoryUsage;
}

@ApiModelProperty("The CPU utilisation of the agent [0.0 - 1.0] and -1.0 in case of errors.")
@Schema(description = "The CPU utilisation of the agent [0.0 - 1.0] and -1.0 in case of errors.")
public Double getCpuUtilization() {
return cpuUtilization;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,15 @@

package org.apache.nifi.c2.protocol.api;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;

import java.io.Serializable;
import java.util.Map;

/**
* Status of the aspects of the agent, including any agent components that are controllable by the C2 server, ie:
* - Repositories that can be cleared and their current state
*/
@ApiModel
public class AgentStatus implements Serializable {
private static final long serialVersionUID = 1L;

Expand All @@ -35,7 +34,7 @@ public class AgentStatus implements Serializable {
private Map<String, ComponentStatus> components;
private AgentResourceConsumption resourceConsumption;

@ApiModelProperty("The number of milliseconds since the agent started.")
@Schema(description = "The number of milliseconds since the agent started.")
public Long getUptime() {
return uptime;
}
Expand All @@ -44,7 +43,7 @@ public void setUptime(Long uptime) {
this.uptime = uptime;
}

@ApiModelProperty("Status and metrics for the agent repositories")
@Schema(description = "Status and metrics for the agent repositories")
public AgentRepositories getRepositories() {
return repositories;
}
Expand All @@ -53,7 +52,7 @@ public void setRepositories(AgentRepositories repositories) {
this.repositories = repositories;
}

@ApiModelProperty("Status for shared agent components (that is, components that exist outside the context of a specific flow).")
@Schema(description = "Status for shared agent components (that is, components that exist outside the context of a specific flow).")
public Map<String, ComponentStatus> getComponents() {
return components;
}
Expand All @@ -62,7 +61,7 @@ public void setComponents(Map<String, ComponentStatus> components) {
this.components = components;
}

@ApiModelProperty("Resource consumption details of the agent.")
@Schema(description = "Resource consumption details of the agent.")
public AgentResourceConsumption getResourceConsumption() {
return resourceConsumption;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,14 @@

package org.apache.nifi.c2.protocol.api;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;

import java.io.Serializable;
import java.util.Objects;

/**
* An object representation of a Heartbeat in the C2 protocol
*/
@ApiModel
public class C2Heartbeat implements Serializable {
private static final long serialVersionUID = 1L;

Expand All @@ -37,7 +35,7 @@ public class C2Heartbeat implements Serializable {
private AgentInfo agentInfo;
private FlowInfo flowInfo;

@ApiModelProperty(hidden = true)
@Schema(hidden = true)
public String getIdentifier() {
return identifier;
}
Expand All @@ -46,7 +44,7 @@ public void setIdentifier(String identifier) {
this.identifier = identifier;
}

@ApiModelProperty(hidden = true)
@Schema(hidden = true)
public Long getCreated() {
return created;
}
Expand All @@ -55,7 +53,7 @@ public void setCreated(Long created) {
this.created = created;
}

@ApiModelProperty("Metadata for the device")
@Schema(description = "Metadata for the device")
public DeviceInfo getDeviceInfo() {
return deviceInfo;
}
Expand All @@ -64,7 +62,7 @@ public void setDeviceInfo(DeviceInfo deviceInfo) {
this.deviceInfo = deviceInfo;
}

@ApiModelProperty("Metadata for the agent installed on the device")
@Schema(description = "Metadata for the agent installed on the device")
public AgentInfo getAgentInfo() {
return agentInfo;
}
Expand All @@ -73,7 +71,7 @@ public void setAgentInfo(AgentInfo agentInfo) {
this.agentInfo = agentInfo;
}

@ApiModelProperty("Metadata for the flow currently deployed to the agent")
@Schema(description = "Metadata for the flow currently deployed to the agent")
public FlowInfo getFlowInfo() {
return flowInfo;
}
Expand All @@ -83,30 +81,30 @@ public void setFlowInfo(FlowInfo flowInfo) {
}

// Convenience getters
@ApiModelProperty(hidden = true)
@Schema(hidden = true)
public String getDeviceId() {
return deviceInfo != null ? deviceInfo.getIdentifier() : null;
}

@ApiModelProperty(hidden = true)
@Schema(hidden = true)
public String getAgentId() {
return agentInfo != null ? agentInfo.getIdentifier() : null;
}

@ApiModelProperty(hidden = true)
@Schema(hidden = true)
public String getAgentClass() {
return agentInfo != null ? agentInfo.getAgentClass() : null;
}

@ApiModelProperty(hidden = true)
@Schema(hidden = true)
public String getAgentManifestId() {
if (agentInfo != null && agentInfo.getAgentManifest() != null) {
return agentInfo.getAgentManifest().getIdentifier();
}
return null;
}

@ApiModelProperty(hidden = true)
@Schema(hidden = true)
public String getFlowId() {
return flowInfo != null ? flowInfo.getFlowId() : null;
}
Expand Down
Loading

0 comments on commit eeae1b1

Please sign in to comment.