Implemented Details of Asset Administration Shell 2.0.1
Fixed AAS-XML schema validation
Refactored versioning of AAS schemas
Packages updated
diff --git a/sdks/dotnet/basyx-core/BaSyx.API.Http.Controllers/Infrastructure/Registry/AssetAdministrationShellRegistry.cs b/sdks/dotnet/basyx-core/BaSyx.API.Http.Controllers/Infrastructure/Registry/AssetAdministrationShellRegistry.cs
index 482f0ac..cf265df 100644
--- a/sdks/dotnet/basyx-core/BaSyx.API.Http.Controllers/Infrastructure/Registry/AssetAdministrationShellRegistry.cs
+++ b/sdks/dotnet/basyx-core/BaSyx.API.Http.Controllers/Infrastructure/Registry/AssetAdministrationShellRegistry.cs
@@ -31,12 +31,12 @@
/// Retrieves all registered Asset Administration Shells within a defined system (e.g. site, area, production line, station)
/// </summary>
/// <returns></returns>
- /// <response code="200">Returns a list of found Asset Administration Shells</response>
+ /// <response code="200">Returns a list of found Asset Administration Shell Descriptors</response>
/// <response code="400">Bad Request</response>
/// <response code="502">Bad Gateway</response>
- [HttpGet("api/v1/registry", Name = "GetAssetAdministrationShells")]
- [ProducesResponseType(typeof(IResult<List<IAssetAdministrationShellDescriptor>>), 200)]
- public IActionResult GetAssetAdministrationShells()
+ [HttpGet("api/v1/registry", Name = "GetAssetAdministrationShellDescriptors")]
+ [ProducesResponseType(typeof(List<AssetAdministrationShellDescriptor>), 200)]
+ public IActionResult GetAssetAdministrationShellDescriptors()
{
var result = RetrieveAssetAdministrationShells();
return result.CreateActionResult(CrudOperation.Retrieve);
@@ -50,14 +50,18 @@
/// <response code="400">Bad Request</response>
/// <response code="404">No Asset Administration Shell with passed id found</response>
/// <response code="502">Bad Gateway</response>
- [HttpGet("api/v1/registry/{*aasId}", Name = "GetAssetAdministrationShell")]
- [ProducesResponseType(typeof(IResult<IAssetAdministrationShellDescriptor>), 200)]
- public IActionResult GetAssetAdministrationShell(string aasId)
+ [HttpGet("api/v1/registry/{*aasId}", Name = "GetAssetAdministrationShellDescriptor")]
+ [ProducesResponseType(typeof(AssetAdministrationShellDescriptor), 200)]
+ public IActionResult GetAssetAdministrationShellDescriptor(string aasId)
{
+ if (string.IsNullOrEmpty(aasId))
+ return ResultHandling.NullResult(nameof(aasId));
+
aasId = HttpUtility.UrlDecode(aasId);
var result = RetrieveAssetAdministrationShell(aasId);
return result.CreateActionResult(CrudOperation.Retrieve);
}
+
/// <summary>
/// Renews a specific Asset Administration Shell's registration
/// </summary>
@@ -67,10 +71,13 @@
/// <response code="400">The syntax of the passed Asset Administration Shell is not valid or malformed request</response>
/// <response code="404">No Asset Administration Shell with passed id found</response>
/// <response code="502">Bad Gateway</response>
- [HttpPut("api/v1/registry/{*aasId}", Name = "PutAssetAdministrationShell")]
- [ProducesResponseType(typeof(IResult), 204)]
- public IActionResult PutAssetAdministrationShell(string aasId)
+ [HttpPut("api/v1/registry/{*aasId}", Name = "RenewAssetAdministrationShellRegistration")]
+ [ProducesResponseType(typeof(Result), 204)]
+ public IActionResult RenewAssetAdministrationShellRegistration(string aasId)
{
+ if (string.IsNullOrEmpty(aasId))
+ return ResultHandling.NullResult(nameof(aasId));
+
aasId = HttpUtility.UrlDecode(aasId);
Dictionary<string, string> keyValues = null;
if (Request.Query?.Count > 0)
@@ -85,20 +92,23 @@
return result.CreateActionResult(CrudOperation.Update);
}
/// <summary>
- /// Registers a new Asset Administration Shell
+ /// Registers a new Asset Administration Shell at the registry
/// </summary>
- /// <param name="aas">The Asset Administration Shell descriptor object</param>
+ /// <param name="aasDescriptor">The Asset Administration Shell descriptor object</param>
/// <returns></returns>
/// <response code="201">The Asset Administration Shell was created successfully</response>
/// <response code="400">The syntax of the passed Asset Administration Shell is not valid or malformed request</response>
/// <response code="422">The passed Asset Administration Shell conflicts with already registered Asset Administration Shells</response>
/// <response code="502">Bad Gateway</response>
- [HttpPost("api/v1/registry", Name = "PostAssetAdministrationShell")]
- [ProducesResponseType(typeof(IResult<IAssetAdministrationShellDescriptor>), 201)]
- public IActionResult PostAssetAdministrationShell([FromBody] IAssetAdministrationShellDescriptor aas)
+ [HttpPost("api/v1/registry", Name = "RegisterAssetAdministrationShell")]
+ [ProducesResponseType(typeof(AssetAdministrationShellDescriptor), 201)]
+ public IActionResult RegisterAssetAdministrationShell([FromBody] IAssetAdministrationShellDescriptor aasDescriptor)
{
- var result = CreateAssetAdministrationShell(aas);
- return result.CreateActionResult(CrudOperation.Create, "api/v1/registry/"+ HttpUtility.UrlEncode(aas.Identification.Id));
+ if (aasDescriptor == null)
+ return ResultHandling.NullResult(nameof(aasDescriptor));
+
+ var result = CreateAssetAdministrationShell(aasDescriptor);
+ return result.CreateActionResult(CrudOperation.Create, "api/v1/registry/"+ HttpUtility.UrlEncode(aasDescriptor.Identification.Id));
}
/// <summary>
/// Deletes a specific Asset Administration Shell
@@ -109,10 +119,13 @@
/// <response code="400">Bad Request</response>
/// <response code="404">No Asset Administration Shell with passed id found</response>
/// <response code="502">Bad Gateway</response>
- [HttpDelete("api/v1/registry/{*aasId}", Name = "DeleteAssetAdministrationShell_")]
- [ProducesResponseType(typeof(IResult), 204)]
- public IActionResult DeleteAssetAdministrationShell_(string aasId)
+ [HttpDelete("api/v1/registry/{*aasId}", Name = "DeleteAssetAdministrationShellRegistration")]
+ [ProducesResponseType(typeof(Result), 204)]
+ public IActionResult DeleteAssetAdministrationShellRegistration(string aasId)
{
+ if (string.IsNullOrEmpty(aasId))
+ return ResultHandling.NullResult(nameof(aasId));
+
aasId = HttpUtility.UrlDecode(aasId);
var result = DeleteAssetAdministrationShell(aasId);
return result.CreateActionResult(CrudOperation.Delete);
@@ -123,36 +136,46 @@
/// Adds a new Submodel to an existing resp. registered Asset Administration Shell
/// </summary>
/// <param name="aasId">The Asset Administration Shell's unique id</param>
- /// <param name="submodel">The Submodel descriptor object</param>
+ /// <param name="submodelDescriptor">The Submodel descriptor object</param>
/// <returns></returns>
/// <response code="201">The Submodel was created successfully</response>
/// <response code="400">The syntax of the passed Submodel is not valid or malformed request</response>
/// <response code="404">No Asset Administration Shell with passed id found</response>
/// <response code="422">The passed Submodel conflicts with already registered Submodels</response>
/// <response code="502">Bad Gateway</response>
- [HttpPost("api/v1/registry/{aasId}/submodels", Name = "PostSubmodelToRegistry")]
- [ProducesResponseType(typeof(IResult<ISubmodelDescriptor>), 201)]
- public IActionResult PostSubmodelToRegistry(string aasId, [FromBody] ISubmodelDescriptor submodel)
+ [HttpPost("api/v1/registry/{aasId}/submodels", Name = "RegisterSubmodelAtAssetAdministrationShell")]
+ [ProducesResponseType(typeof(SubmodelDescriptor), 201)]
+ public IActionResult RegisterSubmodelAtAssetAdministrationShell(string aasId, [FromBody] ISubmodelDescriptor submodelDescriptor)
{
+ if (string.IsNullOrEmpty(aasId))
+ return ResultHandling.NullResult(nameof(aasId));
+ if (submodelDescriptor == null)
+ return ResultHandling.NullResult(nameof(submodelDescriptor));
+
aasId = HttpUtility.UrlDecode(aasId);
- var result = CreateSubmodel(aasId, submodel);
- return result.CreateActionResult(CrudOperation.Create, "api/v1/registry/" + aasId + "/submodels/" + submodel.IdShort);
+ var result = CreateSubmodel(aasId, submodelDescriptor);
+ return result.CreateActionResult(CrudOperation.Create, "api/v1/registry/" + aasId + "/submodels/" + submodelDescriptor.IdShort);
}
/// <summary>
/// Retrieves a specific Submodel from a specific Asset Administration Shell
/// </summary>
/// <param name="aasId">The Asset Administration Shell's unique id</param>
- /// <param name="submodelIdShort">The Submodel's short id (idShort)</param>
+ /// <param name="submodelIdShort">The Submodel's short id</param>
/// <returns></returns>
/// <response code="200">Returns the requested Submodels</response>
/// <response code="400">Bad Request</response>
/// <response code="404">No Asset Administration Shell / Submodel with passed id found</response>
/// <response code="502">Bad Gateway</response>
- [HttpGet("api/v1/registry/{aasId}/submodels/{submodelIdShort}", Name = "GetSubmodelFromRegistry")]
- [ProducesResponseType(typeof(IResult<ISubmodelDescriptor>), 200)]
- public IActionResult GetSubmodelFromRegistry(string aasId, string submodelIdShort)
+ [HttpGet("api/v1/registry/{aasId}/submodels/{submodelIdShort}", Name = "GetSubmodelDescriptorFromAssetAdministrationShell")]
+ [ProducesResponseType(typeof(SubmodelDescriptor), 200)]
+ public IActionResult GetSubmodelDescriptorFromAssetAdministrationShell(string aasId, string submodelIdShort)
{
+ if (string.IsNullOrEmpty(aasId))
+ return ResultHandling.NullResult(nameof(aasId));
+ if (string.IsNullOrEmpty(submodelIdShort))
+ return ResultHandling.NullResult(nameof(submodelIdShort));
+
aasId = HttpUtility.UrlDecode(aasId);
var result = RetrieveSubmodel(aasId, submodelIdShort);
return result.CreateActionResult(CrudOperation.Retrieve);
@@ -167,10 +190,15 @@
/// <response code="400">Bad Request</response>
/// <response code="404">No Asset Administration Shell / Submodel with passed id found</response>
/// <response code="502">Bad Gateway</response>
- [HttpDelete("api/v1/registry/{aasId}/submodels/{submodelIdShort}", Name = "DeleteSubmodelFromRegistry")]
- [ProducesResponseType(typeof(IResult), 204)]
- public IActionResult DeleteSubmodelFromRegistry(string aasId, string submodelIdShort)
+ [HttpDelete("api/v1/registry/{aasId}/submodels/{submodelIdShort}", Name = "DeleteSubmodelFromAssetAdministrationShell")]
+ [ProducesResponseType(typeof(Result), 204)]
+ public IActionResult DeleteSubmodelFromAssetAdministrationShell(string aasId, string submodelIdShort)
{
+ if (string.IsNullOrEmpty(aasId))
+ return ResultHandling.NullResult(nameof(aasId));
+ if (string.IsNullOrEmpty(submodelIdShort))
+ return ResultHandling.NullResult(nameof(submodelIdShort));
+
aasId = HttpUtility.UrlDecode(aasId);
var result = DeleteSubmodel(aasId, submodelIdShort);
return result.CreateActionResult(CrudOperation.Delete);
@@ -184,10 +212,13 @@
/// <response code="400">Bad Request</response>
/// <response code="404">No Asset Administration Shell with passed id found</response>
/// <response code="502">Bad Gateway</response>
- [HttpGet("api/v1/registry/{aasId}/submodels", Name = "GetSubmodelsFromRegistry")]
- [ProducesResponseType(typeof(IResult<List<ISubmodelDescriptor>>), 200)]
- public IActionResult GetSubmodelsFromRegistry(string aasId)
+ [HttpGet("api/v1/registry/{aasId}/submodels", Name = "GetAllSubmodelDescriptorsFromAssetAdministrationShell")]
+ [ProducesResponseType(typeof(List<SubmodelDescriptor>), 200)]
+ public IActionResult GetAllSubmodelDescriptorsFromAssetAdministrationShell(string aasId)
{
+ if (string.IsNullOrEmpty(aasId))
+ return ResultHandling.NullResult(nameof(aasId));
+
aasId = HttpUtility.UrlDecode(aasId);
var result = RetrieveSubmodels(aasId);
return result.CreateActionResult(CrudOperation.Retrieve);