diff --git a/sdk/modelsrepository/azure-iot-modelsrepository/src/main/java/com/azure/iot/modelsrepository/DtmiConventions.java b/sdk/modelsrepository/azure-iot-modelsrepository/src/main/java/com/azure/iot/modelsrepository/DtmiConventions.java
index 5a49487c5b98c..06e62c6bb16e7 100644
--- a/sdk/modelsrepository/azure-iot-modelsrepository/src/main/java/com/azure/iot/modelsrepository/DtmiConventions.java
+++ b/sdk/modelsrepository/azure-iot-modelsrepository/src/main/java/com/azure/iot/modelsrepository/DtmiConventions.java
@@ -41,7 +41,6 @@ public static boolean isValidDtmi(String dtmi) {
if (dtmi == null || dtmi.isEmpty()) {
return false;
}
-
return VALID_DTMI_PATTERN.matcher(dtmi).matches();
}
@@ -74,6 +73,44 @@ public static URI getModelUri(String dtmi, URI repositoryUri, boolean expanded)
}
}
+ /**
+ * Generates the model path.
+ *
+ * @param dtmi DigitalTwin Model Id.
+ * @param expanded Is model from precomputed values
+ * @return The model path.
+ */
+ public static String getModelPath(String dtmi, boolean expanded) {
+ String dtmiPath = dtmiToPath(dtmi);
+
+ if (expanded) {
+ dtmiPath = dtmiPath.replace(ModelsRepositoryConstants.JSON_EXTENSION,
+ ModelsRepositoryConstants.JSON_EXPANDED_EXTENSION);
+ }
+
+ return dtmiPath;
+ }
+
+ /**
+ * Generates the model repository's metadata URI.
+ *
+ * @param repositoryUri The repository uri
+ * @return The repository metadata uri.
+ * @throws IllegalArgumentException if the provided repository URI is not valid
+ */
+ public static URI getMetadataUri(URI repositoryUri) {
+ try {
+ String stringUri = repositoryUri.toString();
+ if (stringUri.endsWith("/")) {
+ return new URI(stringUri + ModelsRepositoryConstants.MODELS_REPOSITORY_METADATA_FILE);
+ } else {
+ return new URI(stringUri + "/" + ModelsRepositoryConstants.MODELS_REPOSITORY_METADATA_FILE);
+ }
+ } catch (URISyntaxException e) {
+ throw new IllegalArgumentException("Invalid uri syntax");
+ }
+ }
+
static String dtmiToPath(String dtmi) {
if (!isValidDtmi(dtmi)) {
throw new IllegalArgumentException(String.format(StatusStrings.INVALID_DTMI_FORMAT_S, dtmi));
diff --git a/sdk/modelsrepository/azure-iot-modelsrepository/src/main/java/com/azure/iot/modelsrepository/ModelDependencyResolution.java b/sdk/modelsrepository/azure-iot-modelsrepository/src/main/java/com/azure/iot/modelsrepository/ModelDependencyResolution.java
index db28c05aa825d..af2b54c92113d 100644
--- a/sdk/modelsrepository/azure-iot-modelsrepository/src/main/java/com/azure/iot/modelsrepository/ModelDependencyResolution.java
+++ b/sdk/modelsrepository/azure-iot-modelsrepository/src/main/java/com/azure/iot/modelsrepository/ModelDependencyResolution.java
@@ -13,13 +13,7 @@ public enum ModelDependencyResolution {
DISABLED,
/**
- * Enable model dependency resolution. The client will parse models and calculate dependencies recursively.
+ * Enable model dependency resolution.
*/
ENABLED,
-
- /**
- * Try to get pre-computed model dependencies using .expanded.json.
- * If the model expanded form does not exist, it will fall back to {@link ModelDependencyResolution#ENABLED}.
- */
- TRY_FROM_EXPANDED,
}
diff --git a/sdk/modelsrepository/azure-iot-modelsrepository/src/main/java/com/azure/iot/modelsrepository/ModelsRepositoryClientBuilder.java b/sdk/modelsrepository/azure-iot-modelsrepository/src/main/java/com/azure/iot/modelsrepository/ModelsRepositoryClientBuilder.java
index e82b0e913e793..cb949207186c6 100644
--- a/sdk/modelsrepository/azure-iot-modelsrepository/src/main/java/com/azure/iot/modelsrepository/ModelsRepositoryClientBuilder.java
+++ b/sdk/modelsrepository/azure-iot-modelsrepository/src/main/java/com/azure/iot/modelsrepository/ModelsRepositoryClientBuilder.java
@@ -58,7 +58,7 @@ public final class ModelsRepositoryClientBuilder {
// Fields with default values.
private URI repositoryEndpoint;
- private ModelDependencyResolution modelDependencyResolution = ModelDependencyResolution.TRY_FROM_EXPANDED;
+ private ModelDependencyResolution modelDependencyResolution = ModelDependencyResolution.ENABLED;
// optional/have default values
private ModelsRepositoryServiceVersion serviceVersion;
@@ -152,7 +152,7 @@ private static HttpPipeline constructPipeline(
/**
* Create a {@link ModelsRepositoryClient} based on the builder settings.
*
- * @return the created synchronous ModelsRepotioryClient
+ * @return the created synchronous ModelsRepositoryClient
*/
public ModelsRepositoryClient buildClient() {
return new ModelsRepositoryClient(buildAsyncClient());
diff --git a/sdk/modelsrepository/azure-iot-modelsrepository/src/main/java/com/azure/iot/modelsrepository/implementation/FileModelFetcher.java b/sdk/modelsrepository/azure-iot-modelsrepository/src/main/java/com/azure/iot/modelsrepository/implementation/FileModelFetcher.java
index a8182568421d6..1361a0413eb43 100644
--- a/sdk/modelsrepository/azure-iot-modelsrepository/src/main/java/com/azure/iot/modelsrepository/implementation/FileModelFetcher.java
+++ b/sdk/modelsrepository/azure-iot-modelsrepository/src/main/java/com/azure/iot/modelsrepository/implementation/FileModelFetcher.java
@@ -7,8 +7,8 @@
import com.azure.core.util.Context;
import com.azure.core.util.logging.ClientLogger;
import com.azure.iot.modelsrepository.DtmiConventions;
-import com.azure.iot.modelsrepository.ModelDependencyResolution;
-import com.azure.iot.modelsrepository.implementation.models.FetchResult;
+import com.azure.iot.modelsrepository.implementation.models.FetchMetadataResult;
+import com.azure.iot.modelsrepository.implementation.models.FetchModelResult;
import reactor.core.publisher.Mono;
import java.io.File;
@@ -39,15 +39,15 @@ class FileModelFetcher implements ModelFetcher {
}
@Override
- public Mono fetchAsync(String dtmi, URI repositoryUri, ModelDependencyResolution resolutionOption, Context context) {
+ public Mono fetchModelAsync(String dtmi, URI repositoryUri, boolean tryFromExpanded, Context context) {
return Mono.defer(() -> {
Queue work = new LinkedList<>();
try {
- if (resolutionOption == ModelDependencyResolution.TRY_FROM_EXPANDED) {
- work.add(getPath(dtmi, repositoryUri, true));
+ if (tryFromExpanded) {
+ work.add(getModelPath(dtmi, repositoryUri, true));
}
- work.add(getPath(dtmi, repositoryUri, false));
+ work.add(getModelPath(dtmi, repositoryUri, false));
} catch (MalformedURLException | URISyntaxException e) {
return Mono.error(new AzureException(e));
}
@@ -63,7 +63,7 @@ public Mono fetchAsync(String dtmi, URI repositoryUri, ModelDepende
if (Files.exists(path)) {
try {
return Mono.just(
- new FetchResult()
+ new FetchModelResult()
.setDefinition(new String(Files.readAllBytes(path), StandardCharsets.UTF_8))
.setPath(tryContentPath));
} catch (IOException e) {
@@ -80,8 +80,41 @@ public Mono fetchAsync(String dtmi, URI repositoryUri, ModelDepende
});
}
- private String getPath(String dtmi, URI repositoryUri, boolean expanded) throws URISyntaxException, MalformedURLException {
+ @Override
+ public Mono fetchMetadataAsync(URI repositoryUri, Context context) {
+ try {
+ String tryContentPath = getMetadataPath(repositoryUri);
+ Path path = Paths.get(new File(tryContentPath).getPath());
+
+ logger.info(StatusStrings.FETCHING_METADATA_CONTENT, path);
+
+ if (Files.exists(path)) {
+ try {
+ return Mono.just(
+ new FetchMetadataResult()
+ .setDefinition(new String(Files.readAllBytes(path), StandardCharsets.UTF_8))
+ .setPath(tryContentPath));
+ } catch (IOException e) {
+ logger.error(String.format(StatusStrings.ERROR_FETCHING_METADATA_CONTENT + " Error: %s.",
+ path.toString(), e.getMessage()));
+ return Mono.error(new AzureException(e));
+ }
+ }
+
+ logger.error(String.format(StatusStrings.ERROR_FETCHING_METADATA_CONTENT, path.toString()));
+ return Mono.just(new FetchMetadataResult());
+ } catch (MalformedURLException | URISyntaxException e) {
+ return Mono.error(new AzureException(e));
+ }
+ }
+
+ private String getModelPath(String dtmi, URI repositoryUri, boolean expanded) throws URISyntaxException, MalformedURLException {
return DtmiConventions.getModelUri(dtmi, repositoryUri, expanded)
.getPath();
}
+
+ private String getMetadataPath(URI repositoryUri) throws URISyntaxException, MalformedURLException {
+ return DtmiConventions.getMetadataUri(repositoryUri)
+ .getPath();
+ }
}
diff --git a/sdk/modelsrepository/azure-iot-modelsrepository/src/main/java/com/azure/iot/modelsrepository/implementation/HttpModelFetcher.java b/sdk/modelsrepository/azure-iot-modelsrepository/src/main/java/com/azure/iot/modelsrepository/implementation/HttpModelFetcher.java
index 6a36fd9cacf84..f5773f3cef9c9 100644
--- a/sdk/modelsrepository/azure-iot-modelsrepository/src/main/java/com/azure/iot/modelsrepository/implementation/HttpModelFetcher.java
+++ b/sdk/modelsrepository/azure-iot-modelsrepository/src/main/java/com/azure/iot/modelsrepository/implementation/HttpModelFetcher.java
@@ -7,10 +7,12 @@
import com.azure.core.util.Context;
import com.azure.core.util.logging.ClientLogger;
import com.azure.iot.modelsrepository.DtmiConventions;
-import com.azure.iot.modelsrepository.ModelDependencyResolution;
-import com.azure.iot.modelsrepository.implementation.models.FetchResult;
+import com.azure.iot.modelsrepository.implementation.models.FetchMetadataResult;
+import com.azure.iot.modelsrepository.implementation.models.FetchModelResult;
+import com.fasterxml.jackson.core.JsonProcessingException;
import reactor.core.publisher.Mono;
+import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.charset.StandardCharsets;
@@ -31,14 +33,14 @@ class HttpModelFetcher implements ModelFetcher {
}
@Override
- public Mono fetchAsync(String dtmi, URI repositoryUri, ModelDependencyResolution resolutionOption, Context context) {
+ public Mono fetchModelAsync(String dtmi, URI repositoryUri, boolean tryFromExpanded, Context context) {
return Mono.defer(() -> {
Queue work = new LinkedList<>();
try {
- if (resolutionOption == ModelDependencyResolution.TRY_FROM_EXPANDED) {
- work.add(getPath(dtmi, repositoryUri, true));
+ if (tryFromExpanded) {
+ work.add(getModelPath(dtmi, repositoryUri, true));
}
- work.add(getPath(dtmi, repositoryUri, false));
+ work.add(getModelPath(dtmi, repositoryUri, false));
} catch (Exception e) {
return Mono.error(new AzureException(e));
}
@@ -52,13 +54,40 @@ public Mono fetchAsync(String dtmi, URI repositoryUri, ModelDepende
if (work.size() != 0) {
return evaluatePath(work.poll(), context);
} else {
+ logger.error(String.format(StatusStrings.ERROR_FETCHING_MODEL_CONTENT, tryContentPath));
return Mono.error(error);
}
})
- .map(s -> new FetchResult().setPath(tryContentPath).setDefinition(s));
+ .map(s -> new FetchModelResult().setPath(tryContentPath).setDefinition(s));
});
}
+ @Override
+ public Mono fetchMetadataAsync(URI repositoryUri, Context context) {
+ try {
+ String tryContentPath = getMetadataPath(repositoryUri);
+
+ logger.info(StatusStrings.FETCHING_METADATA_CONTENT, tryContentPath);
+
+ return evaluatePath(tryContentPath, context)
+ .onErrorResume(error -> {
+ logger.error(String.format(StatusStrings.ERROR_FETCHING_METADATA_CONTENT + " Error: %s",
+ tryContentPath, error.getMessage()));
+ return Mono.error(error);
+ })
+ .map(s -> {
+ try {
+ return new FetchMetadataResult().setPath(tryContentPath).setDefinition(s);
+ } catch (JsonProcessingException e) {
+ logger.error(String.format(StatusStrings.ERROR_FETCHING_METADATA_CONTENT, tryContentPath));
+ return null;
+ }
+ });
+ } catch (MalformedURLException | URISyntaxException e) {
+ return Mono.error(new AzureException(e));
+ }
+ }
+
private Mono evaluatePath(String tryContentPath, Context context) {
return protocolLayer
.getModelsRepository()
@@ -69,7 +98,11 @@ private Mono evaluatePath(String tryContentPath, Context context) {
});
}
- private String getPath(String dtmi, URI repositoryUri, boolean expanded) throws URISyntaxException {
- return DtmiConventions.getModelUri(dtmi, repositoryUri, expanded).getPath();
+ private String getModelPath(String dtmi, URI repositoryUri, boolean expanded) throws URISyntaxException {
+ return DtmiConventions.getModelPath(dtmi, expanded);
+ }
+
+ private String getMetadataPath(URI repositoryUri) throws URISyntaxException, MalformedURLException {
+ return DtmiConventions.getMetadataUri(repositoryUri).getPath();
}
}
diff --git a/sdk/modelsrepository/azure-iot-modelsrepository/src/main/java/com/azure/iot/modelsrepository/implementation/IntermediateFetchResult.java b/sdk/modelsrepository/azure-iot-modelsrepository/src/main/java/com/azure/iot/modelsrepository/implementation/IntermediateFetchModelResult.java
similarity index 62%
rename from sdk/modelsrepository/azure-iot-modelsrepository/src/main/java/com/azure/iot/modelsrepository/implementation/IntermediateFetchResult.java
rename to sdk/modelsrepository/azure-iot-modelsrepository/src/main/java/com/azure/iot/modelsrepository/implementation/IntermediateFetchModelResult.java
index 2b11e3193d977..579d059b7b4b2 100644
--- a/sdk/modelsrepository/azure-iot-modelsrepository/src/main/java/com/azure/iot/modelsrepository/implementation/IntermediateFetchResult.java
+++ b/sdk/modelsrepository/azure-iot-modelsrepository/src/main/java/com/azure/iot/modelsrepository/implementation/IntermediateFetchModelResult.java
@@ -3,7 +3,7 @@
package com.azure.iot.modelsrepository.implementation;
-import com.azure.iot.modelsrepository.implementation.models.FetchResult;
+import com.azure.iot.modelsrepository.implementation.models.FetchModelResult;
import java.util.Map;
@@ -11,17 +11,17 @@
* This type is used to unify the expand operation return types in the recursive function and has no other use cases.
* Do not take any dependencies on this type.
*/
-class IntermediateFetchResult {
- private final FetchResult fetchResult;
+class IntermediateFetchModelResult {
+ private final FetchModelResult fetchModelResult;
private final Map map;
- IntermediateFetchResult(FetchResult fetchResult, Map map) {
- this.fetchResult = fetchResult;
+ IntermediateFetchModelResult(FetchModelResult fetchModelResult, Map map) {
+ this.fetchModelResult = fetchModelResult;
this.map = map;
}
- public FetchResult getFetchResult() {
- return fetchResult;
+ public FetchModelResult getFetchModelResult() {
+ return fetchModelResult;
}
public Map getMap() {
diff --git a/sdk/modelsrepository/azure-iot-modelsrepository/src/main/java/com/azure/iot/modelsrepository/implementation/ModelFetcher.java b/sdk/modelsrepository/azure-iot-modelsrepository/src/main/java/com/azure/iot/modelsrepository/implementation/ModelFetcher.java
index 1de022101406f..2c9a49bbcee50 100644
--- a/sdk/modelsrepository/azure-iot-modelsrepository/src/main/java/com/azure/iot/modelsrepository/implementation/ModelFetcher.java
+++ b/sdk/modelsrepository/azure-iot-modelsrepository/src/main/java/com/azure/iot/modelsrepository/implementation/ModelFetcher.java
@@ -4,12 +4,13 @@
package com.azure.iot.modelsrepository.implementation;
import com.azure.core.util.Context;
-import com.azure.iot.modelsrepository.ModelDependencyResolution;
-import com.azure.iot.modelsrepository.implementation.models.FetchResult;
+import com.azure.iot.modelsrepository.implementation.models.FetchMetadataResult;
+import com.azure.iot.modelsrepository.implementation.models.FetchModelResult;
import reactor.core.publisher.Mono;
import java.net.URI;
interface ModelFetcher {
- Mono fetchAsync(String dtmi, URI repositoryUri, ModelDependencyResolution resolutionOption, Context context);
+ Mono fetchModelAsync(String dtmi, URI repositoryUri, boolean tryFromExpanded, Context context);
+ Mono fetchMetadataAsync(URI repositoryUri, Context context);
}
diff --git a/sdk/modelsrepository/azure-iot-modelsrepository/src/main/java/com/azure/iot/modelsrepository/implementation/ModelsRepositoryConstants.java b/sdk/modelsrepository/azure-iot-modelsrepository/src/main/java/com/azure/iot/modelsrepository/implementation/ModelsRepositoryConstants.java
index f02a265adfa4e..d1efc6044f432 100644
--- a/sdk/modelsrepository/azure-iot-modelsrepository/src/main/java/com/azure/iot/modelsrepository/implementation/ModelsRepositoryConstants.java
+++ b/sdk/modelsrepository/azure-iot-modelsrepository/src/main/java/com/azure/iot/modelsrepository/implementation/ModelsRepositoryConstants.java
@@ -9,6 +9,7 @@ public class ModelsRepositoryConstants {
public static final String JSON_EXTENSION = ".json";
public static final String JSON_EXPANDED_EXTENSION = ".expanded.json";
public static final String DEFAULT_MODELS_REPOSITORY_ENDPOINT = "https://devicemodels.azure.com";
+ public static final String MODELS_REPOSITORY_METADATA_FILE = "metadata.json";
// DTDL conventions
public static final String DTDL_TYPE = "@type";
diff --git a/sdk/modelsrepository/azure-iot-modelsrepository/src/main/java/com/azure/iot/modelsrepository/implementation/RepositoryHandler.java b/sdk/modelsrepository/azure-iot-modelsrepository/src/main/java/com/azure/iot/modelsrepository/implementation/RepositoryHandler.java
index 7eb2e6dabd618..b713b58afbc83 100644
--- a/sdk/modelsrepository/azure-iot-modelsrepository/src/main/java/com/azure/iot/modelsrepository/implementation/RepositoryHandler.java
+++ b/sdk/modelsrepository/azure-iot-modelsrepository/src/main/java/com/azure/iot/modelsrepository/implementation/RepositoryHandler.java
@@ -3,26 +3,31 @@
package com.azure.iot.modelsrepository.implementation;
-import com.azure.core.exception.AzureException;
import com.azure.core.util.Context;
+import com.azure.core.util.CoreUtils;
import com.azure.core.util.logging.ClientLogger;
+import com.azure.core.util.logging.LogLevel;
import com.azure.iot.modelsrepository.DtmiConventions;
import com.azure.iot.modelsrepository.ModelDependencyResolution;
-import com.azure.iot.modelsrepository.implementation.models.FetchResult;
+import com.azure.iot.modelsrepository.implementation.models.FetchModelResult;
import com.azure.iot.modelsrepository.implementation.models.ModelMetadata;
+import com.fasterxml.jackson.core.JsonProcessingException;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import java.net.URI;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
-import java.util.Map;
-import java.util.Queue;
import java.util.List;
-import java.util.LinkedList;
import java.util.Locale;
+import java.util.Map;
+import java.util.stream.Collectors;
-
+/**
+ * The {@link RepositoryHandler} is responsible for processing fetched models
+ * and generates processed results which are sent back to the client.
+ */
public final class RepositoryHandler {
private final URI repositoryUri;
@@ -35,8 +40,8 @@ public RepositoryHandler(URI repositoryUri, ModelsRepositoryAPIImpl protocolLaye
if (this.repositoryUri.getScheme() != null
&& this.repositoryUri.getScheme()
- .toLowerCase(Locale.getDefault())
- .startsWith(ModelsRepositoryConstants.HTTP)) {
+ .toLowerCase(Locale.getDefault())
+ .startsWith(ModelsRepositoryConstants.HTTP)) {
this.modelFetcher = new HttpModelFetcher(protocolLayer);
} else {
this.modelFetcher = new FileModelFetcher();
@@ -47,87 +52,75 @@ public Mono
",
+ "x-ms-request-id" : "c9d3efa3-e01e-00b8-2fef-bab6de000000",
+ "Body" : "WebContentNotFoundThe requested content does not exist.
- HttpStatusCode: 404
- ErrorCode: WebContentNotFound
- RequestId : c9d3efa3-e01e-00b8-2fef-bab6de000000
- TimeStamp : 2021-10-06T20:20:38.0079901Z
",
"Content-Type" : "text/html"
},
"Exception" : null
}, {
"Method" : "GET",
- "Uri" : "https://REDACTED.azure.com/%2Fdtmi%2Fcom%2Fexample%2Fthermostatddd-1.json",
+ "Uri" : "https://REDACTED.azure.com/dtmi%2Fcom%2Fexample%2Fthermostatddd-1.json",
"Headers" : {
- "User-Agent" : "azsdk-java-azure-iot-modelsrepository/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)",
- "x-ms-client-request-id" : "e833bda3-456a-470f-862b-b11625f09186"
+ "User-Agent" : "azsdk-java-azure-iot-modelsrepository/1.0.0-beta.2 (11.0.7; Windows 10; 10.0)",
+ "x-ms-client-request-id" : "6a9fbf15-79fe-4873-9013-d457ed632988"
},
"Response" : {
+ "content-length" : "321",
"x-ms-version" : "2018-03-28",
"Server" : "Windows-Azure-Web/1.0 Microsoft-HTTPAPI/2.0",
"Access-Control-Allow-Methods" : "GET, HEAD, OPTIONS",
"retry-after" : "0",
"StatusCode" : "404",
"Access-Control-Allow-Headers" : "*",
- "Date" : "Tue, 23 Mar 2021 22:20:06 GMT",
+ "Date" : "Wed, 06 Oct 2021 20:20:37 GMT",
"Access-Control-Expose-Headers" : "*",
+ "Vary" : "Origin",
"x-ms-error-code" : "WebContentNotFound",
- "Content-Length" : "321",
- "x-ms-request-id" : "5b308299-601e-0051-0632-207f42000000",
- "Body" : "WebContentNotFoundThe requested content does not exist.
- HttpStatusCode: 404
- ErrorCode: WebContentNotFound
- RequestId : 5b308299-601e-0051-0632-207f42000000
- TimeStamp : 2021-03-23T22:20:07.3151755Z
",
+ "x-ms-request-id" : "93e6433d-b01e-000d-42ef-ba4790000000",
+ "Body" : "WebContentNotFoundThe requested content does not exist.
- HttpStatusCode: 404
- ErrorCode: WebContentNotFound
- RequestId : 93e6433d-b01e-000d-42ef-ba4790000000
- TimeStamp : 2021-10-06T20:20:38.0458965Z
",
"Content-Type" : "text/html"
},
"Exception" : null
diff --git a/sdk/modelsrepository/azure-iot-modelsrepository/src/test/resources/session-records/ModelRepositoryIntegrationTests.getModelsSingleDtmiDoesNotExist[3].json b/sdk/modelsrepository/azure-iot-modelsrepository/src/test/resources/session-records/ModelRepositoryIntegrationTests.getModelsSingleDtmiDoesNotExist[3].json
new file mode 100644
index 0000000000000..4971f92c95294
--- /dev/null
+++ b/sdk/modelsrepository/azure-iot-modelsrepository/src/test/resources/session-records/ModelRepositoryIntegrationTests.getModelsSingleDtmiDoesNotExist[3].json
@@ -0,0 +1,68 @@
+{
+ "networkCallRecords" : [ {
+ "Method" : "GET",
+ "Uri" : "https://REDACTED.githubusercontent.com/Azure/iot-plugandplay-models/main/%2FAzure%2Fiot-plugandplay-models%2Fmain%2Fmetadata.json",
+ "Headers" : {
+ "User-Agent" : "azsdk-java-azure-iot-modelsrepository/1.0.0-beta.2 (11.0.7; Windows 10; 10.0)",
+ "x-ms-client-request-id" : "c1df76ad-7678-4dfb-8ff5-37d956634207"
+ },
+ "Response" : {
+ "X-Cache" : "HIT",
+ "content-length" : "117",
+ "Access-Control-Allow-Origin" : "*",
+ "Connection" : "keep-alive",
+ "retry-after" : "0",
+ "StatusCode" : "301",
+ "Source-Age" : "3151",
+ "Date" : "Wed, 06 Oct 2021 20:20:37 GMT",
+ "Via" : "1.1 varnish",
+ "X-Timer" : "S1633551638.736753,VS0,VE1",
+ "Accept-Ranges" : "bytes",
+ "X-Served-By" : "cache-sea4481-SEA",
+ "Vary" : "Authorization,Accept-Encoding",
+ "Expires" : "Wed, 06 Oct 2021 20:25:37 GMT",
+ "X-Cache-Hits" : "1",
+ "Body" : "Moved Permanently.\n\n",
+ "X-Fastly-Request-ID" : "8e1f2b87ec661ad60631285a5fe0d96514e365d2",
+ "Content-Type" : "text/html; charset=utf-8",
+ "Location" : "/Azure/iot-plugandplay-models/main/Azure/iot-plugandplay-models/main/metadata.json",
+ "X-GitHub-Request-Id" : "3658:1B57:376C8:48218:615DF8C6"
+ },
+ "Exception" : null
+ }, {
+ "Method" : "GET",
+ "Uri" : "https://REDACTED.githubusercontent.com/Azure/iot-plugandplay-models/main/dtmi%2Fcom%2Fexample%2Fthermostatddd-1.json",
+ "Headers" : {
+ "User-Agent" : "azsdk-java-azure-iot-modelsrepository/1.0.0-beta.2 (11.0.7; Windows 10; 10.0)",
+ "x-ms-client-request-id" : "fdd06ab2-74ce-4ffd-a880-919642f59d4d"
+ },
+ "Response" : {
+ "X-Cache" : "HIT",
+ "content-length" : "14",
+ "Access-Control-Allow-Origin" : "*",
+ "X-Content-Type-Options" : "nosniff",
+ "Connection" : "keep-alive",
+ "retry-after" : "0",
+ "StatusCode" : "404",
+ "Source-Age" : "15",
+ "Date" : "Wed, 06 Oct 2021 20:20:37 GMT",
+ "Via" : "1.1 varnish",
+ "X-Timer" : "S1633551638.793259,VS0,VE1",
+ "X-Frame-Options" : "deny",
+ "Accept-Ranges" : "bytes",
+ "Strict-Transport-Security" : "max-age=31536000",
+ "X-Served-By" : "cache-sea4481-SEA",
+ "Content-Security-Policy" : "default-src 'none'; style-src 'unsafe-inline'; sandbox",
+ "Vary" : "Authorization,Accept-Encoding,Origin",
+ "Expires" : "Wed, 06 Oct 2021 20:25:37 GMT",
+ "X-XSS-Protection" : "1; mode=block",
+ "X-Cache-Hits" : "1",
+ "Body" : "404: Not Found",
+ "X-Fastly-Request-ID" : "4b3fa9f84ad37624375c7db2b6d442ad910de934",
+ "Content-Type" : "text/plain; charset=utf-8",
+ "X-GitHub-Request-Id" : "7C18:1911:33727:48D74:615E0506"
+ },
+ "Exception" : null
+ } ],
+ "variables" : [ ]
+}
\ No newline at end of file
diff --git a/sdk/modelsrepository/azure-iot-modelsrepository/src/test/resources/session-records/ModelRepositoryIntegrationTests.getModelsSingleDtmiDoesNotExist[4].json b/sdk/modelsrepository/azure-iot-modelsrepository/src/test/resources/session-records/ModelRepositoryIntegrationTests.getModelsSingleDtmiDoesNotExist[4].json
new file mode 100644
index 0000000000000..ba5f37f8f8555
--- /dev/null
+++ b/sdk/modelsrepository/azure-iot-modelsrepository/src/test/resources/session-records/ModelRepositoryIntegrationTests.getModelsSingleDtmiDoesNotExist[4].json
@@ -0,0 +1,4 @@
+{
+ "networkCallRecords" : [ ],
+ "variables" : [ ]
+}
\ No newline at end of file
diff --git a/sdk/modelsrepository/azure-iot-modelsrepository/src/test/resources/session-records/ModelRepositoryIntegrationTests.getModelsSingleDtmiNoDependencies[1].json b/sdk/modelsrepository/azure-iot-modelsrepository/src/test/resources/session-records/ModelRepositoryIntegrationTests.getModelsSingleDtmiNoDependencies[1].json
index 1c9f133670f38..1dcb383a60c15 100644
--- a/sdk/modelsrepository/azure-iot-modelsrepository/src/test/resources/session-records/ModelRepositoryIntegrationTests.getModelsSingleDtmiNoDependencies[1].json
+++ b/sdk/modelsrepository/azure-iot-modelsrepository/src/test/resources/session-records/ModelRepositoryIntegrationTests.getModelsSingleDtmiNoDependencies[1].json
@@ -1,30 +1,60 @@
{
"networkCallRecords" : [ {
"Method" : "GET",
- "Uri" : "https://REDACTED.azure.com/%2Fdtmi%2Fcom%2Fexample%2Fthermostat-1.expanded.json",
+ "Uri" : "https://REDACTED.azure.com/%2Fmetadata.json",
"Headers" : {
- "User-Agent" : "azsdk-java-azure-iot-modelsrepository/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)",
- "x-ms-client-request-id" : "ce4f8dc5-3ea1-40b6-b04a-acdf4c035775"
+ "User-Agent" : "azsdk-java-azure-iot-modelsrepository/1.0.0-beta.2 (11.0.7; Windows 10; 10.0)",
+ "x-ms-client-request-id" : "00415d68-70ee-473f-b39d-ee1f248ed207"
},
"Response" : {
"X-Cache" : "HIT",
+ "content-length" : "253",
"x-ms-version" : "2018-03-28",
- "Server" : "ECAcc (sed/E120)",
+ "Server" : "ECAcc (sed/E179)",
"Access-Control-Allow-Methods" : "GET, HEAD, OPTIONS",
- "Last-Modified" : "Tue, 15 Dec 2020 21:10:57 GMT",
+ "Last-Modified" : "Wed, 06 Oct 2021 18:28:07 GMT",
"retry-after" : "0",
"StatusCode" : "200",
"Access-Control-Allow-Headers" : "*",
- "Date" : "Tue, 23 Mar 2021 22:20:07 GMT",
- "Content-MD5" : "pH51cS5+u5tWh2Krmys7qA==",
+ "Date" : "Wed, 06 Oct 2021 20:20:37 GMT",
+ "Content-MD5" : "x6Px49JuRM9EVDNUDRj0qA==",
"Accept-Ranges" : "bytes",
"Access-Control-Expose-Headers" : "*",
- "Etag" : "\"0x8D8A13DEAC57DB3\"",
+ "Cache-Control" : "max-age=600",
+ "Etag" : "\"0x8D988F70ADF0EEF\"",
"x-ms-error-code" : "ConditionNotMet",
- "Content-Length" : "2651",
- "x-ms-request-id" : "0552d4aa-d01e-006e-4479-1fd74c000000",
+ "Expires" : "Wed, 06 Oct 2021 20:30:37 GMT",
+ "x-ms-request-id" : "4da670eb-801e-003a-50ef-bab78f000000",
+ "Body" : "{\n \"commitId\": \"16b04c45d99deb5438de3c5247a966e7596eaa44\",\n \"features\": {\n \"expanded\": true,\n \"index\": true\n },\n \"publishDateUtc\": \"2021-10-06T18:01:30.072670+00:00\",\n \"sourceRepo\": \"Azure/iot-plugandplay-models\",\n \"totalModelCount\": 19032\n}",
+ "Age" : "15",
+ "Content-Type" : "application/json"
+ },
+ "Exception" : null
+ }, {
+ "Method" : "GET",
+ "Uri" : "https://REDACTED.azure.com/dtmi%2Fcom%2Fexample%2Fthermostat-1.expanded.json",
+ "Headers" : {
+ "User-Agent" : "azsdk-java-azure-iot-modelsrepository/1.0.0-beta.2 (11.0.7; Windows 10; 10.0)",
+ "x-ms-client-request-id" : "60edc1e3-fa3e-4f82-a6e6-36844278b264"
+ },
+ "Response" : {
+ "X-Cache" : "HIT",
+ "content-length" : "2651",
+ "x-ms-version" : "2018-03-28",
+ "Server" : "ECAcc (sed/E132)",
+ "Access-Control-Allow-Methods" : "GET, HEAD, OPTIONS",
+ "Last-Modified" : "Wed, 14 Apr 2021 00:07:35 GMT",
+ "retry-after" : "0",
+ "StatusCode" : "200",
+ "Access-Control-Allow-Headers" : "*",
+ "Date" : "Wed, 06 Oct 2021 20:20:37 GMT",
+ "Content-MD5" : "pH51cS5+u5tWh2Krmys7qA==",
+ "Accept-Ranges" : "bytes",
+ "Access-Control-Expose-Headers" : "*",
+ "Etag" : "\"0x8D8FED94ECA13B6\"",
+ "x-ms-request-id" : "2e9bccae-e01e-0000-5a52-ba988b000000",
"Body" : "[\n {\n \"@context\": \"dtmi:dtdl:context;2\",\n \"@id\": \"dtmi:com:example:Thermostat;1\",\n \"@type\": \"Interface\",\n \"displayName\": \"Thermostat\",\n \"description\": \"Reports current temperature and provides desired temperature control.\",\n \"contents\": [\n {\n \"@type\": [\n \"Telemetry\",\n \"Temperature\"\n ],\n \"name\": \"temperature\",\n \"displayName\": \"Temperature\",\n \"description\": \"Temperature in degrees Celsius.\",\n \"schema\": \"double\",\n \"unit\": \"degreeCelsius\"\n },\n {\n \"@type\": [\n \"Property\",\n \"Temperature\"\n ],\n \"name\": \"targetTemperature\",\n \"schema\": \"double\",\n \"displayName\": \"Target Temperature\",\n \"description\": \"Allows to remotely specify the desired target temperature.\",\n \"unit\": \"degreeCelsius\",\n \"writable\": true\n },\n {\n \"@type\": [\n \"Property\",\n \"Temperature\"\n ],\n \"name\": \"maxTempSinceLastReboot\",\n \"schema\": \"double\",\n \"unit\": \"degreeCelsius\",\n \"displayName\": \"Max temperature since last reboot.\",\n \"description\": \"Returns the max temperature since last device reboot.\"\n },\n {\n \"@type\": \"Command\",\n \"name\": \"getMaxMinReport\",\n \"displayName\": \"Get Max-Min report.\",\n \"description\": \"This command returns the max, min and average temperature from the specified time to the current time.\",\n \"request\": {\n \"name\": \"since\",\n \"displayName\": \"Since\",\n \"description\": \"Period to return the max-min report.\",\n \"schema\": \"dateTime\"\n },\n \"response\": {\n \"name\": \"tempReport\",\n \"displayName\": \"Temperature Report\",\n \"schema\": {\n \"@type\": \"Object\",\n \"fields\": [\n {\n \"name\": \"maxTemp\",\n \"displayName\": \"Max temperature\",\n \"schema\": \"double\"\n },\n {\n \"name\": \"minTemp\",\n \"displayName\": \"Min temperature\",\n \"schema\": \"double\"\n },\n {\n \"name\": \"avgTemp\",\n \"displayName\": \"Average Temperature\",\n \"schema\": \"double\"\n },\n {\n \"name\": \"startTime\",\n \"displayName\": \"Start Time\",\n \"schema\": \"dateTime\"\n },\n {\n \"name\": \"endTime\",\n \"displayName\": \"End Time\",\n \"schema\": \"dateTime\"\n }\n ]\n }\n }\n }\n ]\n }\n]",
- "Age" : "79705",
+ "Age" : "67407",
"Content-Type" : "application/json"
},
"Exception" : null
diff --git a/sdk/modelsrepository/azure-iot-modelsrepository/src/test/resources/session-records/ModelRepositoryIntegrationTests.getModelsSingleDtmiNoDependencies[3].json b/sdk/modelsrepository/azure-iot-modelsrepository/src/test/resources/session-records/ModelRepositoryIntegrationTests.getModelsSingleDtmiNoDependencies[3].json
new file mode 100644
index 0000000000000..3855d02c7d648
--- /dev/null
+++ b/sdk/modelsrepository/azure-iot-modelsrepository/src/test/resources/session-records/ModelRepositoryIntegrationTests.getModelsSingleDtmiNoDependencies[3].json
@@ -0,0 +1,70 @@
+{
+ "networkCallRecords" : [ {
+ "Method" : "GET",
+ "Uri" : "https://REDACTED.githubusercontent.com/Azure/iot-plugandplay-models/main/%2FAzure%2Fiot-plugandplay-models%2Fmain%2Fmetadata.json",
+ "Headers" : {
+ "User-Agent" : "azsdk-java-azure-iot-modelsrepository/1.0.0-beta.2 (11.0.7; Windows 10; 10.0)",
+ "x-ms-client-request-id" : "4cf03b8b-a770-42bc-a551-fc3158b12654"
+ },
+ "Response" : {
+ "X-Cache" : "HIT",
+ "content-length" : "117",
+ "Access-Control-Allow-Origin" : "*",
+ "Connection" : "keep-alive",
+ "retry-after" : "0",
+ "StatusCode" : "301",
+ "Source-Age" : "3151",
+ "Date" : "Wed, 06 Oct 2021 20:20:37 GMT",
+ "Via" : "1.1 varnish",
+ "X-Timer" : "S1633551638.737897,VS0,VE1",
+ "Accept-Ranges" : "bytes",
+ "X-Served-By" : "cache-sea4476-SEA",
+ "Vary" : "Authorization,Accept-Encoding",
+ "Expires" : "Wed, 06 Oct 2021 20:25:37 GMT",
+ "X-Cache-Hits" : "1",
+ "Body" : "Moved Permanently.\n\n",
+ "X-Fastly-Request-ID" : "2d22f0a88716101930a7091385594781d8e367b3",
+ "Content-Type" : "text/html; charset=utf-8",
+ "Location" : "/Azure/iot-plugandplay-models/main/Azure/iot-plugandplay-models/main/metadata.json",
+ "X-GitHub-Request-Id" : "3658:1B57:376C8:48218:615DF8C6"
+ },
+ "Exception" : null
+ }, {
+ "Method" : "GET",
+ "Uri" : "https://REDACTED.githubusercontent.com/Azure/iot-plugandplay-models/main/dtmi%2Fcom%2Fexample%2Fthermostat-1.json",
+ "Headers" : {
+ "User-Agent" : "azsdk-java-azure-iot-modelsrepository/1.0.0-beta.2 (11.0.7; Windows 10; 10.0)",
+ "x-ms-client-request-id" : "10ec23fa-79b5-4622-9fd0-552844bc945f"
+ },
+ "Response" : {
+ "content-length" : "2469",
+ "Access-Control-Allow-Origin" : "*",
+ "retry-after" : "0",
+ "StatusCode" : "200",
+ "Source-Age" : "15",
+ "X-Timer" : "S1633551638.814445,VS0,VE1",
+ "X-Frame-Options" : "deny",
+ "Strict-Transport-Security" : "max-age=31536000",
+ "X-Served-By" : "cache-sea4479-SEA",
+ "Content-Security-Policy" : "default-src 'none'; style-src 'unsafe-inline'; sandbox",
+ "X-XSS-Protection" : "1; mode=block",
+ "Body" : "{\n \"@context\": \"dtmi:dtdl:context;2\",\n \"@id\": \"dtmi:com:example:Thermostat;1\",\n \"@type\": \"Interface\",\n \"displayName\": \"Thermostat\",\n \"description\": \"Reports current temperature and provides desired temperature control.\",\n \"contents\": [\n {\n \"@type\": [\n \"Telemetry\",\n \"Temperature\"\n ],\n \"name\": \"temperature\",\n \"displayName\": \"Temperature\",\n \"description\": \"Temperature in degrees Celsius.\",\n \"schema\": \"double\",\n \"unit\": \"degreeCelsius\"\n },\n {\n \"@type\": [\n \"Property\",\n \"Temperature\"\n ],\n \"name\": \"targetTemperature\",\n \"schema\": \"double\",\n \"displayName\": \"Target Temperature\",\n \"description\": \"Allows to remotely specify the desired target temperature.\",\n \"unit\": \"degreeCelsius\",\n \"writable\": true\n },\n {\n \"@type\": [\n \"Property\",\n \"Temperature\"\n ],\n \"name\": \"maxTempSinceLastReboot\",\n \"schema\": \"double\",\n \"unit\": \"degreeCelsius\",\n \"displayName\": \"Max temperature since last reboot.\",\n \"description\": \"Returns the max temperature since last device reboot.\"\n },\n {\n \"@type\": \"Command\",\n \"name\": \"getMaxMinReport\",\n \"displayName\": \"Get Max-Min report.\",\n \"description\": \"This command returns the max, min and average temperature from the specified time to the current time.\",\n \"request\": {\n \"name\": \"since\",\n \"displayName\": \"Since\",\n \"description\": \"Period to return the max-min report.\",\n \"schema\": \"dateTime\"\n },\n \"response\": {\n \"name\": \"tempReport\",\n \"displayName\": \"Temperature Report\",\n \"schema\": {\n \"@type\": \"Object\",\n \"fields\": [\n {\n \"name\": \"maxTemp\",\n \"displayName\": \"Max temperature\",\n \"schema\": \"double\"\n },\n {\n \"name\": \"minTemp\",\n \"displayName\": \"Min temperature\",\n \"schema\": \"double\"\n },\n {\n \"name\": \"avgTemp\",\n \"displayName\": \"Average Temperature\",\n \"schema\": \"double\"\n },\n {\n \"name\": \"startTime\",\n \"displayName\": \"Start Time\",\n \"schema\": \"dateTime\"\n },\n {\n \"name\": \"endTime\",\n \"displayName\": \"End Time\",\n \"schema\": \"dateTime\"\n }\n ]\n }\n }\n }\n ]\n}",
+ "Content-Type" : "text/plain; charset=utf-8",
+ "X-GitHub-Request-Id" : "7A10:320C:3A12D:4AC16:615DF8C6",
+ "X-Cache" : "HIT",
+ "X-Content-Type-Options" : "nosniff",
+ "Connection" : "keep-alive",
+ "Date" : "Wed, 06 Oct 2021 20:20:37 GMT",
+ "Via" : "1.1 varnish",
+ "Accept-Ranges" : "bytes",
+ "Cache-Control" : "max-age=300",
+ "ETag" : "\"0d2c122754b690ebb4106d28683b3bc7be1dced98582291e46df6433d31e464d\"",
+ "Vary" : "Authorization,Accept-Encoding,Origin",
+ "Expires" : "Wed, 06 Oct 2021 20:25:37 GMT",
+ "X-Cache-Hits" : "1",
+ "X-Fastly-Request-ID" : "2c5f259ced15caef70ac53d71618fdfe8db3a8b3"
+ },
+ "Exception" : null
+ } ],
+ "variables" : [ ]
+}
\ No newline at end of file
diff --git a/sdk/modelsrepository/azure-iot-modelsrepository/src/test/resources/session-records/ModelRepositoryIntegrationTests.getModelsSingleDtmiNoDependencies[4].json b/sdk/modelsrepository/azure-iot-modelsrepository/src/test/resources/session-records/ModelRepositoryIntegrationTests.getModelsSingleDtmiNoDependencies[4].json
new file mode 100644
index 0000000000000..ba5f37f8f8555
--- /dev/null
+++ b/sdk/modelsrepository/azure-iot-modelsrepository/src/test/resources/session-records/ModelRepositoryIntegrationTests.getModelsSingleDtmiNoDependencies[4].json
@@ -0,0 +1,4 @@
+{
+ "networkCallRecords" : [ ],
+ "variables" : [ ]
+}
\ No newline at end of file
diff --git a/sdk/modelsrepository/azure-iot-modelsrepository/src/test/resources/session-records/ModelRepositoryIntegrationTests.getModelsSingleDtmiWithDependencies[1].json b/sdk/modelsrepository/azure-iot-modelsrepository/src/test/resources/session-records/ModelRepositoryIntegrationTests.getModelsSingleDtmiWithDependencies[1].json
index 90fb9b50ca99f..1b6744067777d 100644
--- a/sdk/modelsrepository/azure-iot-modelsrepository/src/test/resources/session-records/ModelRepositoryIntegrationTests.getModelsSingleDtmiWithDependencies[1].json
+++ b/sdk/modelsrepository/azure-iot-modelsrepository/src/test/resources/session-records/ModelRepositoryIntegrationTests.getModelsSingleDtmiWithDependencies[1].json
@@ -1,30 +1,60 @@
{
"networkCallRecords" : [ {
"Method" : "GET",
- "Uri" : "https://REDACTED.azure.com/%2Fdtmi%2Fcom%2Fexample%2Ftemperaturecontroller-1.expanded.json",
+ "Uri" : "https://REDACTED.azure.com/%2Fmetadata.json",
"Headers" : {
- "User-Agent" : "azsdk-java-azure-iot-modelsrepository/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)",
- "x-ms-client-request-id" : "7b3aa5e5-c95b-46cd-b56a-52ba98c32fac"
+ "User-Agent" : "azsdk-java-azure-iot-modelsrepository/1.0.0-beta.2 (11.0.7; Windows 10; 10.0)",
+ "x-ms-client-request-id" : "572a992d-15f7-4a0c-920c-0775171cff1b"
},
"Response" : {
"X-Cache" : "HIT",
+ "content-length" : "253",
"x-ms-version" : "2018-03-28",
- "Server" : "ECAcc (sed/E17F)",
+ "Server" : "ECAcc (sed/E179)",
"Access-Control-Allow-Methods" : "GET, HEAD, OPTIONS",
- "Last-Modified" : "Tue, 15 Dec 2020 21:10:57 GMT",
+ "Last-Modified" : "Wed, 06 Oct 2021 18:28:07 GMT",
"retry-after" : "0",
"StatusCode" : "200",
"Access-Control-Allow-Headers" : "*",
- "Date" : "Tue, 23 Mar 2021 22:20:07 GMT",
- "Content-MD5" : "BnZpV2+7Z2t0sxAxOhmBdw==",
+ "Date" : "Wed, 06 Oct 2021 20:20:37 GMT",
+ "Content-MD5" : "x6Px49JuRM9EVDNUDRj0qA==",
"Accept-Ranges" : "bytes",
"Access-Control-Expose-Headers" : "*",
- "Etag" : "\"0x8D8A13DEAC10FCC\"",
+ "Cache-Control" : "max-age=600",
+ "Etag" : "\"0x8D988F70ADF0EEF\"",
"x-ms-error-code" : "ConditionNotMet",
- "Content-Length" : "6751",
- "x-ms-request-id" : "1b12122f-b01e-0044-7f29-1c486a000000",
+ "Expires" : "Wed, 06 Oct 2021 20:30:37 GMT",
+ "x-ms-request-id" : "4da670eb-801e-003a-50ef-bab78f000000",
+ "Body" : "{\n \"commitId\": \"16b04c45d99deb5438de3c5247a966e7596eaa44\",\n \"features\": {\n \"expanded\": true,\n \"index\": true\n },\n \"publishDateUtc\": \"2021-10-06T18:01:30.072670+00:00\",\n \"sourceRepo\": \"Azure/iot-plugandplay-models\",\n \"totalModelCount\": 19032\n}",
+ "Age" : "15",
+ "Content-Type" : "application/json"
+ },
+ "Exception" : null
+ }, {
+ "Method" : "GET",
+ "Uri" : "https://REDACTED.azure.com/dtmi%2Fcom%2Fexample%2Ftemperaturecontroller-1.expanded.json",
+ "Headers" : {
+ "User-Agent" : "azsdk-java-azure-iot-modelsrepository/1.0.0-beta.2 (11.0.7; Windows 10; 10.0)",
+ "x-ms-client-request-id" : "761203d7-f656-4862-a5d5-160ef466ea91"
+ },
+ "Response" : {
+ "X-Cache" : "HIT",
+ "content-length" : "6751",
+ "x-ms-version" : "2018-03-28",
+ "Server" : "ECAcc (sed/E17B)",
+ "Access-Control-Allow-Methods" : "GET, HEAD, OPTIONS",
+ "Last-Modified" : "Wed, 14 Apr 2021 00:07:35 GMT",
+ "retry-after" : "0",
+ "StatusCode" : "200",
+ "Access-Control-Allow-Headers" : "*",
+ "Date" : "Wed, 06 Oct 2021 20:20:37 GMT",
+ "Content-MD5" : "BnZpV2+7Z2t0sxAxOhmBdw==",
+ "Accept-Ranges" : "bytes",
+ "Access-Control-Expose-Headers" : "*",
+ "Etag" : "\"0x8D8FED94EBE03D1\"",
+ "x-ms-request-id" : "08c2b7cc-301e-0015-4552-baafa3000000",
"Body" : "[\n {\n \"@context\": \"dtmi:dtdl:context;2\",\n \"@id\": \"dtmi:com:example:TemperatureController;1\",\n \"@type\": \"Interface\",\n \"displayName\": \"Temperature Controller\",\n \"description\": \"Device with two thermostats and remote reboot.\",\n \"contents\": [\n {\n \"@type\": [\n \"Telemetry\",\n \"DataSize\"\n ],\n \"name\": \"workingSet\",\n \"displayName\": \"Working Set\",\n \"description\": \"Current working set of the device memory in KiB.\",\n \"schema\": \"double\",\n \"unit\": \"kibibyte\"\n },\n {\n \"@type\": \"Property\",\n \"name\": \"serialNumber\",\n \"displayName\": \"Serial Number\",\n \"description\": \"Serial number of the device.\",\n \"schema\": \"string\"\n },\n {\n \"@type\": \"Command\",\n \"name\": \"reboot\",\n \"displayName\": \"Reboot\",\n \"description\": \"Reboots the device after waiting the number of seconds specified.\",\n \"request\": {\n \"name\": \"delay\",\n \"displayName\": \"Delay\",\n \"description\": \"Number of seconds to wait before rebooting the device.\",\n \"schema\": \"integer\"\n }\n },\n {\n \"@type\": \"Component\",\n \"schema\": \"dtmi:com:example:Thermostat;1\",\n \"name\": \"thermostat1\",\n \"displayName\": \"Thermostat One\",\n \"description\": \"Thermostat One of Two.\"\n },\n {\n \"@type\": \"Component\",\n \"schema\": \"dtmi:com:example:Thermostat;1\",\n \"name\": \"thermostat2\",\n \"displayName\": \"Thermostat Two\",\n \"description\": \"Thermostat Two of Two.\"\n },\n {\n \"@type\": \"Component\",\n \"schema\": \"dtmi:azure:DeviceManagement:DeviceInformation;1\",\n \"name\": \"deviceInformation\",\n \"displayName\": \"Device Information interface\",\n \"description\": \"Optional interface with basic device hardware information.\"\n }\n ]\n },\n {\n \"@context\": \"dtmi:dtdl:context;2\",\n \"@id\": \"dtmi:com:example:Thermostat;1\",\n \"@type\": \"Interface\",\n \"displayName\": \"Thermostat\",\n \"description\": \"Reports current temperature and provides desired temperature control.\",\n \"contents\": [\n {\n \"@type\": [\n \"Telemetry\",\n \"Temperature\"\n ],\n \"name\": \"temperature\",\n \"displayName\": \"Temperature\",\n \"description\": \"Temperature in degrees Celsius.\",\n \"schema\": \"double\",\n \"unit\": \"degreeCelsius\"\n },\n {\n \"@type\": [\n \"Property\",\n \"Temperature\"\n ],\n \"name\": \"targetTemperature\",\n \"schema\": \"double\",\n \"displayName\": \"Target Temperature\",\n \"description\": \"Allows to remotely specify the desired target temperature.\",\n \"unit\": \"degreeCelsius\",\n \"writable\": true\n },\n {\n \"@type\": [\n \"Property\",\n \"Temperature\"\n ],\n \"name\": \"maxTempSinceLastReboot\",\n \"schema\": \"double\",\n \"unit\": \"degreeCelsius\",\n \"displayName\": \"Max temperature since last reboot.\",\n \"description\": \"Returns the max temperature since last device reboot.\"\n },\n {\n \"@type\": \"Command\",\n \"name\": \"getMaxMinReport\",\n \"displayName\": \"Get Max-Min report.\",\n \"description\": \"This command returns the max, min and average temperature from the specified time to the current time.\",\n \"request\": {\n \"name\": \"since\",\n \"displayName\": \"Since\",\n \"description\": \"Period to return the max-min report.\",\n \"schema\": \"dateTime\"\n },\n \"response\": {\n \"name\": \"tempReport\",\n \"displayName\": \"Temperature Report\",\n \"schema\": {\n \"@type\": \"Object\",\n \"fields\": [\n {\n \"name\": \"maxTemp\",\n \"displayName\": \"Max temperature\",\n \"schema\": \"double\"\n },\n {\n \"name\": \"minTemp\",\n \"displayName\": \"Min temperature\",\n \"schema\": \"double\"\n },\n {\n \"name\": \"avgTemp\",\n \"displayName\": \"Average Temperature\",\n \"schema\": \"double\"\n },\n {\n \"name\": \"startTime\",\n \"displayName\": \"Start Time\",\n \"schema\": \"dateTime\"\n },\n {\n \"name\": \"endTime\",\n \"displayName\": \"End Time\",\n \"schema\": \"dateTime\"\n }\n ]\n }\n }\n }\n ]\n },\n {\n \"@context\": \"dtmi:dtdl:context;2\",\n \"@id\": \"dtmi:azure:DeviceManagement:DeviceInformation;1\",\n \"@type\": \"Interface\",\n \"displayName\": \"Device Information\",\n \"contents\": [\n {\n \"@type\": \"Property\",\n \"name\": \"manufacturer\",\n \"displayName\": \"Manufacturer\",\n \"schema\": \"string\",\n \"description\": \"Company name of the device manufacturer. This could be the same as the name of the original equipment manufacturer (OEM). Ex. Contoso.\"\n },\n {\n \"@type\": \"Property\",\n \"name\": \"model\",\n \"displayName\": \"Device model\",\n \"schema\": \"string\",\n \"description\": \"Device model name or ID. Ex. Surface Book 2.\"\n },\n {\n \"@type\": \"Property\",\n \"name\": \"swVersion\",\n \"displayName\": \"Software version\",\n \"schema\": \"string\",\n \"description\": \"Version of the software on your device. This could be the version of your firmware. Ex. 1.3.45\"\n },\n {\n \"@type\": \"Property\",\n \"name\": \"osName\",\n \"displayName\": \"Operating system name\",\n \"schema\": \"string\",\n \"description\": \"Name of the operating system on the device. Ex. Windows 10 IoT Core.\"\n },\n {\n \"@type\": \"Property\",\n \"name\": \"processorArchitecture\",\n \"displayName\": \"Processor architecture\",\n \"schema\": \"string\",\n \"description\": \"Architecture of the processor on the device. Ex. x64 or ARM.\"\n },\n {\n \"@type\": \"Property\",\n \"name\": \"processorManufacturer\",\n \"displayName\": \"Processor manufacturer\",\n \"schema\": \"string\",\n \"description\": \"Name of the manufacturer of the processor on the device. Ex. Intel.\"\n },\n {\n \"@type\": \"Property\",\n \"name\": \"totalStorage\",\n \"displayName\": \"Total storage\",\n \"schema\": \"double\",\n \"description\": \"Total available storage on the device in kilobytes. Ex. 2048000 kilobytes.\"\n },\n {\n \"@type\": \"Property\",\n \"name\": \"totalMemory\",\n \"displayName\": \"Total memory\",\n \"schema\": \"double\",\n \"description\": \"Total available memory on the device in kilobytes. Ex. 256000 kilobytes.\"\n }\n ]\n }\n]",
- "Age" : "443781",
+ "Age" : "67407",
"Content-Type" : "application/json"
},
"Exception" : null
diff --git a/sdk/modelsrepository/azure-iot-modelsrepository/src/test/resources/session-records/ModelRepositoryIntegrationTests.getModelsSingleDtmiWithDependencies[3].json b/sdk/modelsrepository/azure-iot-modelsrepository/src/test/resources/session-records/ModelRepositoryIntegrationTests.getModelsSingleDtmiWithDependencies[3].json
new file mode 100644
index 0000000000000..74573950aa227
--- /dev/null
+++ b/sdk/modelsrepository/azure-iot-modelsrepository/src/test/resources/session-records/ModelRepositoryIntegrationTests.getModelsSingleDtmiWithDependencies[3].json
@@ -0,0 +1,202 @@
+{
+ "networkCallRecords" : [ {
+ "Method" : "GET",
+ "Uri" : "https://REDACTED.githubusercontent.com/Azure/iot-plugandplay-models/main/%2FAzure%2Fiot-plugandplay-models%2Fmain%2Fmetadata.json",
+ "Headers" : {
+ "User-Agent" : "azsdk-java-azure-iot-modelsrepository/1.0.0-beta.2 (11.0.7; Windows 10; 10.0)",
+ "x-ms-client-request-id" : "944945f9-28df-45ce-95d9-b9a4e0bb757a"
+ },
+ "Response" : {
+ "X-Cache" : "HIT",
+ "content-length" : "117",
+ "Access-Control-Allow-Origin" : "*",
+ "Connection" : "keep-alive",
+ "retry-after" : "0",
+ "StatusCode" : "301",
+ "Source-Age" : "3151",
+ "Date" : "Wed, 06 Oct 2021 20:20:37 GMT",
+ "Via" : "1.1 varnish",
+ "X-Timer" : "S1633551638.738065,VS0,VE1",
+ "Accept-Ranges" : "bytes",
+ "X-Served-By" : "cache-sea4425-SEA",
+ "Vary" : "Authorization,Accept-Encoding",
+ "Expires" : "Wed, 06 Oct 2021 20:25:37 GMT",
+ "X-Cache-Hits" : "1",
+ "Body" : "Moved Permanently.\n\n",
+ "X-Fastly-Request-ID" : "753a5ba57fcb35261a05e41c5c3c56376b90d51a",
+ "Content-Type" : "text/html; charset=utf-8",
+ "Location" : "/Azure/iot-plugandplay-models/main/Azure/iot-plugandplay-models/main/metadata.json",
+ "X-GitHub-Request-Id" : "3658:1B57:376C8:48218:615DF8C6"
+ },
+ "Exception" : null
+ }, {
+ "Method" : "GET",
+ "Uri" : "https://REDACTED.githubusercontent.com/Azure/iot-plugandplay-models/main/dtmi%2Fcom%2Fexample%2Ftemperaturecontroller-1.json",
+ "Headers" : {
+ "User-Agent" : "azsdk-java-azure-iot-modelsrepository/1.0.0-beta.2 (11.0.7; Windows 10; 10.0)",
+ "x-ms-client-request-id" : "afd14528-37d5-43f5-b17e-bb71455ec7a1"
+ },
+ "Response" : {
+ "content-length" : "1762",
+ "Access-Control-Allow-Origin" : "*",
+ "retry-after" : "0",
+ "StatusCode" : "200",
+ "Source-Age" : "15",
+ "X-Timer" : "S1633551638.790204,VS0,VE1",
+ "X-Frame-Options" : "deny",
+ "Strict-Transport-Security" : "max-age=31536000",
+ "X-Served-By" : "cache-sea4430-SEA",
+ "Content-Security-Policy" : "default-src 'none'; style-src 'unsafe-inline'; sandbox",
+ "X-XSS-Protection" : "1; mode=block",
+ "Body" : "{\n \"@context\": \"dtmi:dtdl:context;2\",\n \"@id\": \"dtmi:com:example:TemperatureController;1\",\n \"@type\": \"Interface\",\n \"displayName\": \"Temperature Controller\",\n \"description\": \"Device with two thermostats and remote reboot.\",\n \"contents\": [\n {\n \"@type\": [\n \"Telemetry\",\n \"DataSize\"\n ],\n \"name\": \"workingSet\",\n \"displayName\": \"Working Set\",\n \"description\": \"Current working set of the device memory in KiB.\",\n \"schema\": \"double\",\n \"unit\": \"kibibyte\"\n },\n {\n \"@type\": \"Property\",\n \"name\": \"serialNumber\",\n \"displayName\": \"Serial Number\",\n \"description\": \"Serial number of the device.\",\n \"schema\": \"string\"\n },\n {\n \"@type\": \"Command\",\n \"name\": \"reboot\",\n \"displayName\": \"Reboot\",\n \"description\": \"Reboots the device after waiting the number of seconds specified.\",\n \"request\": {\n \"name\": \"delay\",\n \"displayName\": \"Delay\",\n \"description\": \"Number of seconds to wait before rebooting the device.\",\n \"schema\": \"integer\"\n }\n },\n {\n \"@type\": \"Component\",\n \"schema\": \"dtmi:com:example:Thermostat;1\",\n \"name\": \"thermostat1\",\n \"displayName\": \"Thermostat One\",\n \"description\": \"Thermostat One of Two.\"\n },\n {\n \"@type\": \"Component\",\n \"schema\": \"dtmi:com:example:Thermostat;1\",\n \"name\": \"thermostat2\",\n \"displayName\": \"Thermostat Two\",\n \"description\": \"Thermostat Two of Two.\"\n },\n {\n \"@type\": \"Component\",\n \"schema\": \"dtmi:azure:DeviceManagement:DeviceInformation;1\",\n \"name\": \"deviceInformation\",\n \"displayName\": \"Device Information interface\",\n \"description\": \"Optional interface with basic device hardware information.\"\n }\n ]\n}",
+ "Content-Type" : "text/plain; charset=utf-8",
+ "X-GitHub-Request-Id" : "3088:6400:89E1:16994:615DF8C6",
+ "X-Cache" : "HIT",
+ "X-Content-Type-Options" : "nosniff",
+ "Connection" : "keep-alive",
+ "Date" : "Wed, 06 Oct 2021 20:20:37 GMT",
+ "Via" : "1.1 varnish",
+ "Accept-Ranges" : "bytes",
+ "Cache-Control" : "max-age=300",
+ "ETag" : "\"276d790fcfc6c0c7637965a33d2bf9cea2a8583f385ee2d1c5d16823814b3094\"",
+ "Vary" : "Authorization,Accept-Encoding,Origin",
+ "Expires" : "Wed, 06 Oct 2021 20:25:37 GMT",
+ "X-Cache-Hits" : "1",
+ "X-Fastly-Request-ID" : "fbebc8be9c92c71f316deaf54b7377c57ffa3158"
+ },
+ "Exception" : null
+ }, {
+ "Method" : "GET",
+ "Uri" : "https://REDACTED.githubusercontent.com/Azure/iot-plugandplay-models/main/%2FAzure%2Fiot-plugandplay-models%2Fmain%2Fmetadata.json",
+ "Headers" : {
+ "User-Agent" : "azsdk-java-azure-iot-modelsrepository/1.0.0-beta.2 (11.0.7; Windows 10; 10.0)",
+ "x-ms-client-request-id" : "63cb65f7-5200-4e35-9a7e-427d41c863dd"
+ },
+ "Response" : {
+ "X-Cache" : "HIT",
+ "content-length" : "117",
+ "Access-Control-Allow-Origin" : "*",
+ "Connection" : "keep-alive",
+ "retry-after" : "0",
+ "StatusCode" : "301",
+ "Source-Age" : "3151",
+ "Date" : "Wed, 06 Oct 2021 20:20:37 GMT",
+ "Via" : "1.1 varnish",
+ "X-Timer" : "S1633551638.806824,VS0,VE0",
+ "Accept-Ranges" : "bytes",
+ "X-Served-By" : "cache-sea4476-SEA",
+ "Vary" : "Authorization,Accept-Encoding",
+ "Expires" : "Wed, 06 Oct 2021 20:25:37 GMT",
+ "X-Cache-Hits" : "2",
+ "Body" : "Moved Permanently.\n\n",
+ "X-Fastly-Request-ID" : "5493b55c016061f5c2732324e8a654246408f1e3",
+ "Content-Type" : "text/html; charset=utf-8",
+ "Location" : "/Azure/iot-plugandplay-models/main/Azure/iot-plugandplay-models/main/metadata.json",
+ "X-GitHub-Request-Id" : "3658:1B57:376C8:48218:615DF8C6"
+ },
+ "Exception" : null
+ }, {
+ "Method" : "GET",
+ "Uri" : "https://REDACTED.githubusercontent.com/Azure/iot-plugandplay-models/main/dtmi%2Fcom%2Fexample%2Fthermostat-1.json",
+ "Headers" : {
+ "User-Agent" : "azsdk-java-azure-iot-modelsrepository/1.0.0-beta.2 (11.0.7; Windows 10; 10.0)",
+ "x-ms-client-request-id" : "572b80d5-cff5-49c6-bfb7-7432b1155f1c"
+ },
+ "Response" : {
+ "content-length" : "2469",
+ "Access-Control-Allow-Origin" : "*",
+ "retry-after" : "0",
+ "StatusCode" : "200",
+ "Source-Age" : "15",
+ "X-Timer" : "S1633551638.827640,VS0,VE1",
+ "X-Frame-Options" : "deny",
+ "Strict-Transport-Security" : "max-age=31536000",
+ "X-Served-By" : "cache-sea4425-SEA",
+ "Content-Security-Policy" : "default-src 'none'; style-src 'unsafe-inline'; sandbox",
+ "X-XSS-Protection" : "1; mode=block",
+ "Body" : "{\n \"@context\": \"dtmi:dtdl:context;2\",\n \"@id\": \"dtmi:com:example:Thermostat;1\",\n \"@type\": \"Interface\",\n \"displayName\": \"Thermostat\",\n \"description\": \"Reports current temperature and provides desired temperature control.\",\n \"contents\": [\n {\n \"@type\": [\n \"Telemetry\",\n \"Temperature\"\n ],\n \"name\": \"temperature\",\n \"displayName\": \"Temperature\",\n \"description\": \"Temperature in degrees Celsius.\",\n \"schema\": \"double\",\n \"unit\": \"degreeCelsius\"\n },\n {\n \"@type\": [\n \"Property\",\n \"Temperature\"\n ],\n \"name\": \"targetTemperature\",\n \"schema\": \"double\",\n \"displayName\": \"Target Temperature\",\n \"description\": \"Allows to remotely specify the desired target temperature.\",\n \"unit\": \"degreeCelsius\",\n \"writable\": true\n },\n {\n \"@type\": [\n \"Property\",\n \"Temperature\"\n ],\n \"name\": \"maxTempSinceLastReboot\",\n \"schema\": \"double\",\n \"unit\": \"degreeCelsius\",\n \"displayName\": \"Max temperature since last reboot.\",\n \"description\": \"Returns the max temperature since last device reboot.\"\n },\n {\n \"@type\": \"Command\",\n \"name\": \"getMaxMinReport\",\n \"displayName\": \"Get Max-Min report.\",\n \"description\": \"This command returns the max, min and average temperature from the specified time to the current time.\",\n \"request\": {\n \"name\": \"since\",\n \"displayName\": \"Since\",\n \"description\": \"Period to return the max-min report.\",\n \"schema\": \"dateTime\"\n },\n \"response\": {\n \"name\": \"tempReport\",\n \"displayName\": \"Temperature Report\",\n \"schema\": {\n \"@type\": \"Object\",\n \"fields\": [\n {\n \"name\": \"maxTemp\",\n \"displayName\": \"Max temperature\",\n \"schema\": \"double\"\n },\n {\n \"name\": \"minTemp\",\n \"displayName\": \"Min temperature\",\n \"schema\": \"double\"\n },\n {\n \"name\": \"avgTemp\",\n \"displayName\": \"Average Temperature\",\n \"schema\": \"double\"\n },\n {\n \"name\": \"startTime\",\n \"displayName\": \"Start Time\",\n \"schema\": \"dateTime\"\n },\n {\n \"name\": \"endTime\",\n \"displayName\": \"End Time\",\n \"schema\": \"dateTime\"\n }\n ]\n }\n }\n }\n ]\n}",
+ "Content-Type" : "text/plain; charset=utf-8",
+ "X-GitHub-Request-Id" : "7A10:320C:3A12D:4AC16:615DF8C6",
+ "X-Cache" : "HIT",
+ "X-Content-Type-Options" : "nosniff",
+ "Connection" : "keep-alive",
+ "Date" : "Wed, 06 Oct 2021 20:20:37 GMT",
+ "Via" : "1.1 varnish",
+ "Accept-Ranges" : "bytes",
+ "Cache-Control" : "max-age=300",
+ "ETag" : "\"0d2c122754b690ebb4106d28683b3bc7be1dced98582291e46df6433d31e464d\"",
+ "Vary" : "Authorization,Accept-Encoding,Origin",
+ "Expires" : "Wed, 06 Oct 2021 20:25:37 GMT",
+ "X-Cache-Hits" : "1",
+ "X-Fastly-Request-ID" : "c293bc980713d9739478bdfc73afb537758f0ba5"
+ },
+ "Exception" : null
+ }, {
+ "Method" : "GET",
+ "Uri" : "https://REDACTED.githubusercontent.com/Azure/iot-plugandplay-models/main/%2FAzure%2Fiot-plugandplay-models%2Fmain%2Fmetadata.json",
+ "Headers" : {
+ "User-Agent" : "azsdk-java-azure-iot-modelsrepository/1.0.0-beta.2 (11.0.7; Windows 10; 10.0)",
+ "x-ms-client-request-id" : "73b90be1-2ca8-4552-ba51-b5a0ed23d254"
+ },
+ "Response" : {
+ "X-Cache" : "HIT",
+ "content-length" : "117",
+ "Access-Control-Allow-Origin" : "*",
+ "Connection" : "keep-alive",
+ "retry-after" : "0",
+ "StatusCode" : "301",
+ "Source-Age" : "3151",
+ "Date" : "Wed, 06 Oct 2021 20:20:37 GMT",
+ "Via" : "1.1 varnish",
+ "X-Timer" : "S1633551638.839463,VS0,VE0",
+ "Accept-Ranges" : "bytes",
+ "X-Served-By" : "cache-sea4430-SEA",
+ "Vary" : "Authorization,Accept-Encoding",
+ "Expires" : "Wed, 06 Oct 2021 20:25:37 GMT",
+ "X-Cache-Hits" : "1",
+ "Body" : "Moved Permanently.\n\n",
+ "X-Fastly-Request-ID" : "c70431723262afd1fdf226a53fe090cb47db2fa8",
+ "Content-Type" : "text/html; charset=utf-8",
+ "Location" : "/Azure/iot-plugandplay-models/main/Azure/iot-plugandplay-models/main/metadata.json",
+ "X-GitHub-Request-Id" : "3658:1B57:376C8:48218:615DF8C6"
+ },
+ "Exception" : null
+ }, {
+ "Method" : "GET",
+ "Uri" : "https://REDACTED.githubusercontent.com/Azure/iot-plugandplay-models/main/dtmi%2Fazure%2Fdevicemanagement%2Fdeviceinformation-1.json",
+ "Headers" : {
+ "User-Agent" : "azsdk-java-azure-iot-modelsrepository/1.0.0-beta.2 (11.0.7; Windows 10; 10.0)",
+ "x-ms-client-request-id" : "0d61b93e-98bd-4a7a-9091-d05701c8a0f8"
+ },
+ "Response" : {
+ "content-length" : "2212",
+ "Access-Control-Allow-Origin" : "*",
+ "retry-after" : "0",
+ "StatusCode" : "200",
+ "Source-Age" : "16",
+ "X-Timer" : "S1633551639.692640,VS0,VE1",
+ "X-Frame-Options" : "deny",
+ "Strict-Transport-Security" : "max-age=31536000",
+ "X-Served-By" : "cache-sea4479-SEA",
+ "Content-Security-Policy" : "default-src 'none'; style-src 'unsafe-inline'; sandbox",
+ "X-XSS-Protection" : "1; mode=block",
+ "Body" : "{\n \"@context\": \"dtmi:dtdl:context;2\",\n \"@id\": \"dtmi:azure:DeviceManagement:DeviceInformation;1\",\n \"@type\": \"Interface\",\n \"displayName\": \"Device Information\",\n \"contents\": [\n {\n \"@type\": \"Property\",\n \"name\": \"manufacturer\",\n \"displayName\": \"Manufacturer\",\n \"schema\": \"string\",\n \"description\": \"Company name of the device manufacturer. This could be the same as the name of the original equipment manufacturer (OEM). Ex. Contoso.\"\n },\n {\n \"@type\": \"Property\",\n \"name\": \"model\",\n \"displayName\": \"Device model\",\n \"schema\": \"string\",\n \"description\": \"Device model name or ID. Ex. Surface Book 2.\"\n },\n {\n \"@type\": \"Property\",\n \"name\": \"swVersion\",\n \"displayName\": \"Software version\",\n \"schema\": \"string\",\n \"description\": \"Version of the software on your device. This could be the version of your firmware. Ex. 1.3.45\"\n },\n {\n \"@type\": \"Property\",\n \"name\": \"osName\",\n \"displayName\": \"Operating system name\",\n \"schema\": \"string\",\n \"description\": \"Name of the operating system on the device. Ex. Windows 10 IoT Core.\"\n },\n {\n \"@type\": \"Property\",\n \"name\": \"processorArchitecture\",\n \"displayName\": \"Processor architecture\",\n \"schema\": \"string\",\n \"description\": \"Architecture of the processor on the device. Ex. x64 or ARM.\"\n },\n {\n \"@type\": \"Property\",\n \"name\": \"processorManufacturer\",\n \"displayName\": \"Processor manufacturer\",\n \"schema\": \"string\",\n \"description\": \"Name of the manufacturer of the processor on the device. Ex. Intel.\"\n },\n {\n \"@type\": \"Property\",\n \"name\": \"totalStorage\",\n \"displayName\": \"Total storage\",\n \"schema\": \"double\",\n \"description\": \"Total available storage on the device in kilobytes. Ex. 2048000 kilobytes.\"\n },\n {\n \"@type\": \"Property\",\n \"name\": \"totalMemory\",\n \"displayName\": \"Total memory\",\n \"schema\": \"double\",\n \"description\": \"Total available memory on the device in kilobytes. Ex. 256000 kilobytes.\"\n }\n ]\n }",
+ "Content-Type" : "text/plain; charset=utf-8",
+ "X-GitHub-Request-Id" : "956E:278C:249C9:34469:615DF8C6",
+ "X-Cache" : "HIT",
+ "X-Content-Type-Options" : "nosniff",
+ "Connection" : "keep-alive",
+ "Date" : "Wed, 06 Oct 2021 20:20:38 GMT",
+ "Via" : "1.1 varnish",
+ "Accept-Ranges" : "bytes",
+ "Cache-Control" : "max-age=300",
+ "ETag" : "\"7952e5f1274fe59fa4aa27c6ba55a1aebec0d5b2ac12f5c8124bbfb08eae4eee\"",
+ "Vary" : "Authorization,Accept-Encoding,Origin",
+ "Expires" : "Wed, 06 Oct 2021 20:25:38 GMT",
+ "X-Cache-Hits" : "1",
+ "X-Fastly-Request-ID" : "fab5c72ec9b38e981c9a9405ccd9db4ef5f0b69e"
+ },
+ "Exception" : null
+ } ],
+ "variables" : [ ]
+}
diff --git a/sdk/modelsrepository/azure-iot-modelsrepository/src/test/resources/session-records/ModelRepositoryIntegrationTests.getModelsSingleDtmiWithDependencies[4].json b/sdk/modelsrepository/azure-iot-modelsrepository/src/test/resources/session-records/ModelRepositoryIntegrationTests.getModelsSingleDtmiWithDependencies[4].json
new file mode 100644
index 0000000000000..ba5f37f8f8555
--- /dev/null
+++ b/sdk/modelsrepository/azure-iot-modelsrepository/src/test/resources/session-records/ModelRepositoryIntegrationTests.getModelsSingleDtmiWithDependencies[4].json
@@ -0,0 +1,4 @@
+{
+ "networkCallRecords" : [ ],
+ "variables" : [ ]
+}
\ No newline at end of file
diff --git a/sdk/modelsrepository/azure-iot-modelsrepository/src/test/resources/session-records/ModelRepositoryIntegrationTests.getModelsSingleDtmiWithDepsDisableDependencyResolution[1].json b/sdk/modelsrepository/azure-iot-modelsrepository/src/test/resources/session-records/ModelRepositoryIntegrationTests.getModelsSingleDtmiWithDepsDisableDependencyResolution[1].json
index 54051cf4b7951..1f05d86e39471 100644
--- a/sdk/modelsrepository/azure-iot-modelsrepository/src/test/resources/session-records/ModelRepositoryIntegrationTests.getModelsSingleDtmiWithDepsDisableDependencyResolution[1].json
+++ b/sdk/modelsrepository/azure-iot-modelsrepository/src/test/resources/session-records/ModelRepositoryIntegrationTests.getModelsSingleDtmiWithDepsDisableDependencyResolution[1].json
@@ -1,30 +1,30 @@
{
"networkCallRecords" : [ {
"Method" : "GET",
- "Uri" : "https://REDACTED.azure.com/%2Fdtmi%2Fcom%2Fexample%2Fthermostat-1.json",
+ "Uri" : "https://REDACTED.azure.com/dtmi%2Fcom%2Fexample%2Fthermostat-1.json",
"Headers" : {
- "User-Agent" : "azsdk-java-azure-iot-modelsrepository/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)",
- "x-ms-client-request-id" : "537a41a9-a508-4e4a-8390-6399bb3ffb01"
+ "User-Agent" : "azsdk-java-azure-iot-modelsrepository/1.0.0-beta.2 (11.0.7; Windows 10; 10.0)",
+ "x-ms-client-request-id" : "1430d25e-3dd9-430d-b1b7-7ea24f5fd6a5"
},
"Response" : {
"X-Cache" : "HIT",
+ "content-length" : "2469",
"x-ms-version" : "2018-03-28",
- "Server" : "ECAcc (sed/E107)",
+ "Server" : "ECAcc (sed/E154)",
"Access-Control-Allow-Methods" : "GET, HEAD, OPTIONS",
- "Last-Modified" : "Tue, 15 Dec 2020 21:10:57 GMT",
+ "Last-Modified" : "Wed, 14 Apr 2021 00:07:35 GMT",
"retry-after" : "0",
"StatusCode" : "200",
"Access-Control-Allow-Headers" : "*",
- "Date" : "Tue, 23 Mar 2021 22:20:07 GMT",
+ "Date" : "Wed, 06 Oct 2021 20:20:37 GMT",
"Content-MD5" : "U0VZgOgpfb6bwvG5UDVZuw==",
"Accept-Ranges" : "bytes",
"Access-Control-Expose-Headers" : "*",
- "Etag" : "\"0x8D8A13DEABC53BA\"",
+ "Etag" : "\"0x8D8FED94ED5FC94\"",
"x-ms-error-code" : "ConditionNotMet",
- "Content-Length" : "2469",
- "x-ms-request-id" : "3e2ce5fe-301e-0060-0838-1c7551000000",
+ "x-ms-request-id" : "8b667ceb-b01e-00a5-2757-b6d9e7000000",
"Body" : "{\n \"@context\": \"dtmi:dtdl:context;2\",\n \"@id\": \"dtmi:com:example:Thermostat;1\",\n \"@type\": \"Interface\",\n \"displayName\": \"Thermostat\",\n \"description\": \"Reports current temperature and provides desired temperature control.\",\n \"contents\": [\n {\n \"@type\": [\n \"Telemetry\",\n \"Temperature\"\n ],\n \"name\": \"temperature\",\n \"displayName\": \"Temperature\",\n \"description\": \"Temperature in degrees Celsius.\",\n \"schema\": \"double\",\n \"unit\": \"degreeCelsius\"\n },\n {\n \"@type\": [\n \"Property\",\n \"Temperature\"\n ],\n \"name\": \"targetTemperature\",\n \"schema\": \"double\",\n \"displayName\": \"Target Temperature\",\n \"description\": \"Allows to remotely specify the desired target temperature.\",\n \"unit\": \"degreeCelsius\",\n \"writable\": true\n },\n {\n \"@type\": [\n \"Property\",\n \"Temperature\"\n ],\n \"name\": \"maxTempSinceLastReboot\",\n \"schema\": \"double\",\n \"unit\": \"degreeCelsius\",\n \"displayName\": \"Max temperature since last reboot.\",\n \"description\": \"Returns the max temperature since last device reboot.\"\n },\n {\n \"@type\": \"Command\",\n \"name\": \"getMaxMinReport\",\n \"displayName\": \"Get Max-Min report.\",\n \"description\": \"This command returns the max, min and average temperature from the specified time to the current time.\",\n \"request\": {\n \"name\": \"since\",\n \"displayName\": \"Since\",\n \"description\": \"Period to return the max-min report.\",\n \"schema\": \"dateTime\"\n },\n \"response\": {\n \"name\": \"tempReport\",\n \"displayName\": \"Temperature Report\",\n \"schema\": {\n \"@type\": \"Object\",\n \"fields\": [\n {\n \"name\": \"maxTemp\",\n \"displayName\": \"Max temperature\",\n \"schema\": \"double\"\n },\n {\n \"name\": \"minTemp\",\n \"displayName\": \"Min temperature\",\n \"schema\": \"double\"\n },\n {\n \"name\": \"avgTemp\",\n \"displayName\": \"Average Temperature\",\n \"schema\": \"double\"\n },\n {\n \"name\": \"startTime\",\n \"displayName\": \"Start Time\",\n \"schema\": \"dateTime\"\n },\n {\n \"name\": \"endTime\",\n \"displayName\": \"End Time\",\n \"schema\": \"dateTime\"\n }\n ]\n }\n }\n }\n ]\n}",
- "Age" : "437504",
+ "Age" : "505072",
"Content-Type" : "application/json"
},
"Exception" : null
diff --git a/sdk/modelsrepository/azure-iot-modelsrepository/src/test/resources/session-records/ModelRepositoryIntegrationTests.getModelsSingleDtmiWithDepsDisableDependencyResolution[3].json b/sdk/modelsrepository/azure-iot-modelsrepository/src/test/resources/session-records/ModelRepositoryIntegrationTests.getModelsSingleDtmiWithDepsDisableDependencyResolution[3].json
new file mode 100644
index 0000000000000..011ac367502b4
--- /dev/null
+++ b/sdk/modelsrepository/azure-iot-modelsrepository/src/test/resources/session-records/ModelRepositoryIntegrationTests.getModelsSingleDtmiWithDepsDisableDependencyResolution[3].json
@@ -0,0 +1,40 @@
+{
+ "networkCallRecords" : [ {
+ "Method" : "GET",
+ "Uri" : "https://REDACTED.githubusercontent.com/Azure/iot-plugandplay-models/main/dtmi%2Fcom%2Fexample%2Fthermostat-1.json",
+ "Headers" : {
+ "User-Agent" : "azsdk-java-azure-iot-modelsrepository/1.0.0-beta.2 (11.0.7; Windows 10; 10.0)",
+ "x-ms-client-request-id" : "9e54d0ce-4794-472b-bcb3-6f776c62d69c"
+ },
+ "Response" : {
+ "content-length" : "2469",
+ "Access-Control-Allow-Origin" : "*",
+ "retry-after" : "0",
+ "StatusCode" : "200",
+ "Source-Age" : "15",
+ "X-Timer" : "S1633551638.735210,VS0,VE1",
+ "X-Frame-Options" : "deny",
+ "Strict-Transport-Security" : "max-age=31536000",
+ "X-Served-By" : "cache-sea4430-SEA",
+ "Content-Security-Policy" : "default-src 'none'; style-src 'unsafe-inline'; sandbox",
+ "X-XSS-Protection" : "1; mode=block",
+ "Body" : "{\n \"@context\": \"dtmi:dtdl:context;2\",\n \"@id\": \"dtmi:com:example:Thermostat;1\",\n \"@type\": \"Interface\",\n \"displayName\": \"Thermostat\",\n \"description\": \"Reports current temperature and provides desired temperature control.\",\n \"contents\": [\n {\n \"@type\": [\n \"Telemetry\",\n \"Temperature\"\n ],\n \"name\": \"temperature\",\n \"displayName\": \"Temperature\",\n \"description\": \"Temperature in degrees Celsius.\",\n \"schema\": \"double\",\n \"unit\": \"degreeCelsius\"\n },\n {\n \"@type\": [\n \"Property\",\n \"Temperature\"\n ],\n \"name\": \"targetTemperature\",\n \"schema\": \"double\",\n \"displayName\": \"Target Temperature\",\n \"description\": \"Allows to remotely specify the desired target temperature.\",\n \"unit\": \"degreeCelsius\",\n \"writable\": true\n },\n {\n \"@type\": [\n \"Property\",\n \"Temperature\"\n ],\n \"name\": \"maxTempSinceLastReboot\",\n \"schema\": \"double\",\n \"unit\": \"degreeCelsius\",\n \"displayName\": \"Max temperature since last reboot.\",\n \"description\": \"Returns the max temperature since last device reboot.\"\n },\n {\n \"@type\": \"Command\",\n \"name\": \"getMaxMinReport\",\n \"displayName\": \"Get Max-Min report.\",\n \"description\": \"This command returns the max, min and average temperature from the specified time to the current time.\",\n \"request\": {\n \"name\": \"since\",\n \"displayName\": \"Since\",\n \"description\": \"Period to return the max-min report.\",\n \"schema\": \"dateTime\"\n },\n \"response\": {\n \"name\": \"tempReport\",\n \"displayName\": \"Temperature Report\",\n \"schema\": {\n \"@type\": \"Object\",\n \"fields\": [\n {\n \"name\": \"maxTemp\",\n \"displayName\": \"Max temperature\",\n \"schema\": \"double\"\n },\n {\n \"name\": \"minTemp\",\n \"displayName\": \"Min temperature\",\n \"schema\": \"double\"\n },\n {\n \"name\": \"avgTemp\",\n \"displayName\": \"Average Temperature\",\n \"schema\": \"double\"\n },\n {\n \"name\": \"startTime\",\n \"displayName\": \"Start Time\",\n \"schema\": \"dateTime\"\n },\n {\n \"name\": \"endTime\",\n \"displayName\": \"End Time\",\n \"schema\": \"dateTime\"\n }\n ]\n }\n }\n }\n ]\n}",
+ "Content-Type" : "text/plain; charset=utf-8",
+ "X-GitHub-Request-Id" : "7A10:320C:3A12D:4AC16:615DF8C6",
+ "X-Cache" : "HIT",
+ "X-Content-Type-Options" : "nosniff",
+ "Connection" : "keep-alive",
+ "Date" : "Wed, 06 Oct 2021 20:20:37 GMT",
+ "Via" : "1.1 varnish",
+ "Accept-Ranges" : "bytes",
+ "Cache-Control" : "max-age=300",
+ "ETag" : "\"0d2c122754b690ebb4106d28683b3bc7be1dced98582291e46df6433d31e464d\"",
+ "Vary" : "Authorization,Accept-Encoding,Origin",
+ "Expires" : "Wed, 06 Oct 2021 20:25:37 GMT",
+ "X-Cache-Hits" : "1",
+ "X-Fastly-Request-ID" : "7343f212515edee8dfd161a8a65c274ab6988010"
+ },
+ "Exception" : null
+ } ],
+ "variables" : [ ]
+}
\ No newline at end of file
diff --git a/sdk/modelsrepository/azure-iot-modelsrepository/src/test/resources/session-records/ModelRepositoryIntegrationTests.getModelsSingleDtmiWithDepsDisableDependencyResolution[4].json b/sdk/modelsrepository/azure-iot-modelsrepository/src/test/resources/session-records/ModelRepositoryIntegrationTests.getModelsSingleDtmiWithDepsDisableDependencyResolution[4].json
new file mode 100644
index 0000000000000..ba5f37f8f8555
--- /dev/null
+++ b/sdk/modelsrepository/azure-iot-modelsrepository/src/test/resources/session-records/ModelRepositoryIntegrationTests.getModelsSingleDtmiWithDepsDisableDependencyResolution[4].json
@@ -0,0 +1,4 @@
+{
+ "networkCallRecords" : [ ],
+ "variables" : [ ]
+}
\ No newline at end of file