Skip to content

Commit

Permalink
Auto commit generated client changes - Wed May 29 11:03:36 UTC 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
equinix-labs@auto-commit-workflow committed May 29, 2024
1 parent 5aa0aaf commit 1f2e3cc
Show file tree
Hide file tree
Showing 13 changed files with 348 additions and 151 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import com.equinix.openapi.fabric.ApiException;
import com.equinix.openapi.fabric.Configuration;
import com.equinix.openapi.fabric.Pair;
import com.equinix.openapi.fabric.v4.api.dto.PortDto;
import com.equinix.openapi.fabric.v4.api.dto.TokenRequestDto;
import com.equinix.openapi.fabric.v4.api.dto.TokenResponseDto;
import com.equinix.openapi.fabric.v4.api.dto.port.PortDto;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
package com.equinix.openapi.fabric.v4.api;

import com.equinix.openapi.fabric.ApiException;
import com.equinix.openapi.fabric.v4.api.dto.PortDto;
import com.equinix.openapi.fabric.v4.api.dto.port.PortDto;
import com.equinix.openapi.fabric.v4.model.*;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Disabled;
Expand Down Expand Up @@ -108,9 +108,9 @@ public void getPortByUuidTest() throws ApiException {
@Test
public void getPortsTest() throws ApiException {
PortDto portDto = getPort(JsonFiles.PORT_2_PUBLIC_SERVICE_PROFILE_CONNECTION);
AllPortsResponse response = api.getPorts(portDto.getAsidePortName());
AllPortsResponse response = api.getPorts(portDto.getName());
assertEquals(200, api.getApiClient().getStatusCode());
assertEquals(portDto.getAsidePortName(), response.getData().get(0).getName());
assertEquals(portDto.getName(), response.getData().get(0).getName());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,47 +9,37 @@
* Do not edit the class manually.
*/


package com.equinix.openapi.fabric.v4.api;

import com.equinix.openapi.fabric.ApiException;
import com.equinix.openapi.fabric.v4.model.Duration;
import com.equinix.openapi.fabric.v4.model.Error;
import com.equinix.openapi.fabric.v4.model.MetricInterval;
import java.time.OffsetDateTime;
import com.equinix.openapi.fabric.v4.model.QueryDirection;
import com.equinix.openapi.fabric.v4.model.Sort;
import com.equinix.openapi.fabric.v4.model.Statistics;
import com.equinix.openapi.fabric.v4.model.TopUtilizedStatistics;
import java.util.UUID;
import com.equinix.openapi.fabric.v4.model.ViewPoint;
import org.junit.jupiter.api.Test;
import org.junit.Assert;
import com.equinix.openapi.fabric.v4.api.dto.port.PortDto;
import com.equinix.openapi.fabric.v4.model.*;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.time.ZoneOffset;
import java.time.temporal.ChronoUnit;
import java.util.Collections;
import java.util.UUID;

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

/**
* API tests for StatisticsApi
*/
@Disabled
public class StatisticsApiTest extends AbstractTest {

private final StatisticsApi api = new StatisticsApi(generateToken());

/**
* Get Stats by uuid
*
* <p>
* This API provides service-level metrics so that you can view access and gather key information required to manage service subscription sizing and capacity
*
* @throws ApiException
* if the Api call fails
* @throws ApiException if the Api call fails
*/
@Disabled
@Test
public void getConnectionStatsByPortUuidTest() throws ApiException {
//
Expand All @@ -65,54 +55,43 @@ public void getConnectionStatsByPortUuidTest() throws ApiException {

// TODO: test validations
}

/**
* Top Port Statistics
*
* <p>
* This API provides top utilized service-level traffic metrics so that you can view access and gather key information required to manage service subscription sizing and capacity.
*
* @throws ApiException
* if the Api call fails
* @throws ApiException if the Api call fails
*/
@Test
public void getPortStatsTest() throws ApiException {
//
//List<String> metros = null;
//
//Sort sort = null;
//
//Integer top = null;
//
//Duration duration = null;
//
//QueryDirection direction = null;
//
//MetricInterval metricInterval = null;
//
//String projectId = null;
//
//TopUtilizedStatistics response = api.getPortStats(metros, sort, top, duration, direction, metricInterval, projectId);

// TODO: test validations
String projectId = "291639000636552";
TopUtilizedStatistics response = api.getPortStats(
Collections.singletonList(""),
Sort._BANDWIDTHUTILIZATION,
5,
Duration.P7D,
QueryDirection.OUTBOUND,
MetricInterval.P7D,
projectId);
assertEquals(200, api.getApiClient().getStatusCode());
}

/**
* Get Stats by uuid
*
* <p>
* This API provides service-level traffic metrics so that you can view access and gather key information required to manage service subscription sizing and capacity.
*
* @throws ApiException
* if the Api call fails
* @throws ApiException if the Api call fails
*/
@Test
public void getPortStatsByPortUuidTest() throws ApiException {
//
//UUID portId = null;
//
//OffsetDateTime startDateTime = null;
//
//OffsetDateTime endDateTime = null;
//
//Statistics response = api.getPortStatsByPortUuid(portId, startDateTime, endDateTime);
PortDto portDto = getPort(JsonFiles.PORT_2_PUBLIC_SERVICE_PROFILE_CONNECTION);
OffsetDateTime startDate = OffsetDateTime.now().minusMonths(3).withOffsetSameLocal(ZoneOffset.UTC).truncatedTo(ChronoUnit.SECONDS);
OffsetDateTime endDate = OffsetDateTime.now().withOffsetSameLocal(ZoneOffset.UTC).truncatedTo(ChronoUnit.SECONDS);

// TODO: test validations
Statistics response = api.getPortStatsByPortUuid(UUID.fromString(portDto.getUuid()), startDate, endDate);
assertEquals(200, api.getApiClient().getStatusCode());
assertEquals(portDto.getName(), response.getAdditionalProperties().get("name"));
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.equinix.openapi.fabric.v4.api.dto.port;

import com.google.gson.annotations.SerializedName;

public class Device{

@SerializedName("name")
private String name;

@SerializedName("redundancy")
private Redundancy redundancy;

public String getName(){
return name;
}

public Redundancy getRedundancy(){
return redundancy;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.equinix.openapi.fabric.v4.api.dto.port;

import com.google.gson.annotations.SerializedName;

public class Encapsulation{

@SerializedName("tagProtocolId")
private String tagProtocolId;

@SerializedName("type")
private String type;

public String getTagProtocolId(){
return tagProtocolId;
}

public String getType(){
return type;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.equinix.openapi.fabric.v4.api.dto.port;

import com.google.gson.annotations.SerializedName;

public class Lag{

@SerializedName("name")
private String name;

@SerializedName("id")
private String id;

@SerializedName("enabled")
private boolean enabled;

public String getName(){
return name;
}

public String getId(){
return id;
}

public boolean isEnabled(){
return enabled;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package com.equinix.openapi.fabric.v4.api.dto.port;

import com.google.gson.annotations.SerializedName;

public class Location{

@SerializedName("metroName")
private String metroName;

@SerializedName("metroCode")
private String metroCode;

@SerializedName("href")
private String href;

@SerializedName("region")
private String region;

@SerializedName("ibx")
private String ibx;

public String getMetroName(){
return metroName;
}

public String getMetroCode(){
return metroCode;
}

public String getHref(){
return href;
}

public String getRegion(){
return region;
}

public String getIbx(){
return ibx;
}
}
Loading

0 comments on commit 1f2e3cc

Please sign in to comment.