Skip to content

Commit

Permalink
enable price field for edge (#111)
Browse files Browse the repository at this point in the history
* enable price field for edge

* documenting price field for edge
  • Loading branch information
ankicabarisic authored Nov 21, 2024
1 parent e897f8d commit f096560
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions endpoints/4-edge-endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ This endpoint is used to register new Edge nodes, which are passed as an [EdgeDe
],
"nodeProperties": {
"providerId": "1",
"price": "{{price}}",
"numberOfCores": "{{cores}}",
"memory": "{{memory}}",
"disk": "{{disk}}",
Expand Down Expand Up @@ -69,6 +70,7 @@ The fields are defined as:
- `ipAddresses`: A list of IP addresses associated with the node, including both PUBLIC_IP and PRIVATE_IP with IP Version specified as V4.
- `nodeProperties`:
- `providerId`: The ID of the provider. Default is `"1"`.
- `price`: The price of the edge node source.
- `numberOfCores`: A string representing number of hardware cores (e.g., `"1"`).
- `memory`: The hardware memory in GB (e.g., `"1"`)
- `disk`: The hardware storage space in GB (e.g., `"1.0"`).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
@NoArgsConstructor
@Embeddable
public class NodeProperties implements Serializable {
@JsonProperty("price")
private Double price = null;

@JsonProperty("providerId")
private String providerId = null;

Expand Down Expand Up @@ -61,6 +64,14 @@ public void setProviderId(String providerId) {
this.providerId = providerId;
}

public Double getPrice() {
return price;
}

public void setPrice(Double price) {
this.price = price;
}

public NodeProperties numberOfCores(Integer numberOfCores) {
this.numberOfCores = numberOfCores;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static NodeCandidate createNodeCandidate(NodeProperties np, String jobId,
LOGGER.debug("Creating the {} node candidate ...", nodeType.toUpperCase());
//Start by setting the universal nodes properties
NodeCandidate nc = new NodeCandidate();
nc.setPrice(0.0);
nc.setPrice(np.getPrice());
nc.setMemoryPrice(0.0);
nc.setPricePerInvocation(0.0);
nc.setNodeId(nodeId);
Expand Down

0 comments on commit f096560

Please sign in to comment.