Difference between revisions of "Information System Resource Registry"

From Gcube Wiki
Jump to: navigation, search
(consistsOf Type Creation)
(Resource Registry Query Template Client)
 
(246 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
[[Category: Developer's Guide]]
 
[[Category: Developer's Guide]]
 
[[Category: Information System]]
 
[[Category: Information System]]
 +
{| align="right"
 +
||__TOC__
 +
|}
  
Resource Registry is part of gCube [[Information System]].
+
The [[Information_System_Resource_Registry | Resource Registry]] is the core component of the gCube [[Information System]] designed to support the operation of a hybrid cloud-based infrastructure:
 +
* To capture, transmit, store, retrieve and manipulate data from any software system enabled on the infrastructure
 +
** Location and properties
 +
** Status, load, exploitation usage, and accounting data
  
Resource Registry is responsible for:
+
* To provide access to information, organized to enable
* Context Management : manage hierarchical Context.
+
** Monitoring, validation, and reporting
* Schema Management : register and define Entities and Relations schema
+
** Elasticity and pooling of resources
* Entity Management : manage Entities and Relations instances of registered schemas
+
* Query and Access : query instances and get the schema definition of registered types
+
  
Every Port type is exposed as [https://en.wikipedia.org/wiki/Representational_state_transfer REST] API.
+
* To support any software system to
 +
** Discover services and infrastructure resources
  
== Context Management ==
+
The Resource Registry - core of a SOA within the complexities of a hybrid cloud-based infrastructure – must enable
  
It is responsible for managing [[Facet_Based_Resource_Model#Context| Context]] belonging to the same Application Domain.
+
* '''a set of resource management functions'''
 +
** enabling functions
 +
*** publication, discovery
 +
*** monitoring, deployment
 +
*** contextualization, security, execution
 +
** data management functions
 +
*** access, store
 +
*** index, search
 +
*** transfer, transform
  
Security configuration based on [[Authorization Framework]] make this port type accessible only from [[Information System Resource Manager|Resource Manager]]. In other words no others client is allowed to manage [[Facet_Based_Resource_Model#Context| Context]] rather than [[Information System Resource Manager|Resource Manager]].
+
* '''plus, a set of applications'''
 +
** built against those functions
  
[[Facet_Based_Resource_Model#Context|Context]] requirements:
+
* '''Resource types: abstract view over functions'''
* No predefined number of levels.
+
** defined by specifications
* Possibility to change the name of the Context with no impact for any component.
+
** multiple implementations, over time / concurrently
* Possibility to move a [[Facet_Based_Resource_Model#Context| Context]] from a parent [[Facet_Based_Resource_Model#Context| Context]] to another.
+
  
Available Methods:
+
* different implementations, different information
 +
** system cannot globally define them
 +
** implementations produce/consume different facets, independently
  
* [[#Create|Create]]
+
* resource semantics dynamic
* [[#Rename|Rename]]
+
** no longer predefined in class hierarchies
* [[#Move|Move]]
+
** implicitly captured by current facets
* [[#Delete|Delete]]
+
** changes over time / across “similar” resources
  
=== Create ===
+
== Architecture ==
  
<pre>PUT /resource-registry/context</pre>
+
The constituent components are:
  
==== Description ====
+
* [[Information System Resource Registry#Resource_Registry Service | Resource Registry Service ]]
 +
* [[Information System Resource Registry#Resource_Registry_Context_Client | Resource Registry Context Client]]
 +
* [[Information System Resource Registry#Resource_Registry_Schema_Client | Resource Registry Schema Client]]
 +
* [[Information System Resource Registry#Resource_Registry_Publisher | Resource Registry Publisher]]
 +
* [[Information System Resource Registry#Resource_Registry_Client | Resource Registry Client]]
  
Create new Context
+
=== Resource Registry Service ===
  
==== Parameters ====
+
'''Resource Registry Service''' is the key component of the Information System.
 +
It is a web service running on [[SmartGears]] responsible for storing information regarding the Infrastructure, in particular, the global and partial view of:
 +
* the resources (e.g. computing, storage, services, software, datasets);
 +
* their current status (e.g. up and running, available);
 +
* their relationships with other resources.
 +
* the policies governing their exploitation.
  
{|class="wikitable"
+
Resource Registry is developed only by using the concepts defined in the [[Facet_Based_Resource_Model#IS_Model|IS Model]] and it provides the capabilities to enrich its knowledge by creating new types of [[Facet_Based_Resource_Model#Entity|entities]] and [[Facet_Based_Resource_Model#Relation|relations]] and their schemas.
! Name
+
! Type
+
! Required
+
! Description
+
|-
+
| name
+
| String
+
| true
+
| The name of the context.
+
|-
+
| parentContextId
+
| String (UUID)
+
| false
+
| The UUID of the parent Context if any
+
|}
+
  
==== Responses ====
+
Resource Registry is capable of serving different applications domains (i.e. Context). To achieve this goal, the Resource Registry provides capabilities to manage Contexts (the contexts are hierarchical) and associate the entities and relations to one or more of the Contexts as requested by the different clients.
  
{|class="wikitable"
+
The Resource registry is also responsible for notifying any update or creation of any entity or relation to [[Information System Subscription Notification Service]].
! Code
+
! Type
+
! Description
+
|-
+
| 200
+
| String (UUID)
+
| The String representation of the UUID assigned to the created Context
+
|}
+
  
==== Examples ====
+
Maven coordinates are:
  
{|class="wikitable"
+
<source lang="xml">
! URL
+
<dependency>
! Description
+
<groupId>org.gcube.information-system</groupId>
! Response Example
+
<artifactId>resource-registry</artifactId>
|-
+
<version>[4.0.0,5.0.0-SNAPSHOT)</version>
| /resource-registry/context?name=gCube
+
<dependency>
| Create a new Context with name gCube
+
</source>
| a2fe0030-7b3d-4617-ba37-532c0e4b778d
+
|}
+
  
  
<pre>PUT /resource-registry/context?name=devsec[&parentContextId=a2fe0030-7b3d-4617-ba37-532c0e4b778d] -> c0f314e7-2807-4241-a792-2a6c79ed4fd0</pre>
+
To reach its goals Resource Registry offers 5 port types:
 +
* [[Resource Registry_Service - Context Management|Context Management]] : it manages hierarchical contexts;
 +
* [[Resource Registry Service - Type Management|Type Management]] : it manages the definition of entities and relations types and their schema;
 +
* [[Resource Registry Service - Instances Management|Instances Management]] : it manages entities and relations instances;
 +
* [[Resource Registry Service - Instances Sharing Management|Instances Sharing Management]] : it manages instances sharing across different contexts;
 +
* [[Resource Registry Service - Query Templates Management|Query Templates Management]] : it manages query templates;
 +
* [[Resource Registry Service - Query & Access|Query & Access]] : it supports the discovery of instances through access patterns and queries.
  
<pre>PUT /resource-registry/context?name=devVRE[&parentContextId=c0f314e7-2807-4241-a792-2a6c79ed4fd0] -> d821bcc0-946b-11e6-bdf4-0800200c9a66</pre>
+
Every Port type is exposed as [https://en.wikipedia.org/wiki/Representational_state_transfer REST] API.
  
=== Rename ===
+
Every REST API is [https://en.wikipedia.org/wiki/JSON JSON] based. In other words, any content of an HTTP request is represented in JSON.
  
<pre>POST /resource-registry/context/rename/d821bcc0-946b-11e6-bdf4-0800200c9a66?name=devNext</pre>
+
=== Resource Registry Context Client ===
  
=== Move ===
+
Resource Registry Schema is a java library providing RPC facilities to interact with [[Resource Registry Service - Context Management|Context Management]].
 +
The library hides all the complexity of marshalling and unmarshalling of requests and results.
 +
By using this library any client is able to manage java classes instead of JSON objects.
  
<pre>POST /resource-registry/context/move/d821bcc0-946b-11e6-bdf4-800200c9a66[?parentContextId=a2fe0030-7b3d-4617-ba37-532c0e4b778d</pre>
+
To use the Java library to interact with Context Collection declare the following dependency in your pom.xml file.
  
=== Delete ===
+
<source lang="xml">
 +
<dependency>
 +
<groupId>org.gcube.information-system</groupId>
 +
<artifactId>resource-registry-context-client</artifactId>
 +
<version>[4.0.0,5.0.0-SNAPSHOT)</version>
 +
<dependency>
 +
</source>
  
<pre>DELETE /resource-registry/context/d821bcc0-946b-11e6-bdf4-0800200c9a66</pre>
+
=== Resource Registry Schema Client ===
  
== Schema Management ==
+
Resource Registry Schema is a java library providing RPC facilities to interact with [[Resource Registry Service - Type Management|Type Management]].
 
+
The library hides all the complexity of marshalling and unmarshalling of requests and results.  
[[Facet_Based_Resource_Model#Basic_Property_Type | Property Type]] are mapped to and integer to be used in property definition:
+
By using this library any client is able to manage java classes instead of JSON objects.
 
+
Type binder is defined here:
+
[http://svn.research-infrastructures.eu/d4science/gcube/trunk/information-system/information-system-model/src/main/java/org/gcube/informationsystem/types/Type.java]
+
 
+
{|class="wikitable"
+
! Type
+
! Integer Mapping
+
! Java type
+
! Description
+
|-
+
| Boolean
+
| 0
+
| <code>java.lang.Boolean</code> or <code>boolean</code>
+
| Handles only the values <em>True</em> or <em>False</em>.
+
|-
+
| Integer
+
| 1
+
| <code>java.lang.Integer</code> or <code>int</code> or  <code>java.math.BigInteger</code>
+
| 32-bit signed Integers.
+
|-
+
| Short
+
| 2
+
| <code>java.lang.Short</code> or <code>short</code>
+
| Small 16-bit signed integers.
+
|-
+
| Long
+
| 3
+
| <code>java.lang.Long</code> or <code>long</code>
+
| Big 64-bit signed integers.
+
|-
+
| Float
+
| 4
+
| <code>java.lang.Float</code> or <code>float</code>
+
| Decimal numbers
+
|-
+
| Double
+
| 5
+
| <code>java.lang.Double</code> or <code>double</code>
+
| Decimal numbers with high precision.
+
|-
+
| Date
+
| 6
+
| <code>java.util.Date</code>
+
| Any date with the precision up to milliseconds.
+
|-
+
| String
+
| 7
+
| <code>java.lang.String</code>
+
| Any string as alphanumeric sequence of chars.
+
|-
+
| Binary
+
| 8
+
| <code>java.lang.Byte[]</code> or <code>byte[]</code>
+
| Can contain any value as byte array.
+
|-
+
| Embedded
+
| 9
+
| <code>?  extends org.gcube.informationsystem.model.embedded.Embedded</code>
+
| This is an Object contained inside the owner Entity and has no [[#Header|Header]]. It is reachable only by navigating the owner Entity.
+
|-
+
| Embedded list
+
| 10
+
| <code>List&lt;?  extends org.gcube.informationsystem.model.embedded.Embedded&gt;</code>
+
| List of Objects contained inside the owner Entity and have no [[#Header|Header]]. They are reachable only by navigating the owner Entity.
+
|-
+
| Embedded set
+
| 11
+
| <code>Set&lt;? extends org.gcube.informationsystem.model.embedded.Embedded&gt;</code>
+
| Set (no duplicates) of Objects contained inside the owner Entity and have no [[#Header|Header]]. They are reachable only by navigating the owner Entity.
+
|-
+
| Embedded map
+
| 12
+
| <code>Map&lt;String, ? extends org.gcube.informationsystem.model.embedded.Embedded&gt;</code>
+
| Map of Objects contained inside the owner Entity and have no [[#Header|Header]]. They are reachable only by navigating the owner Entity.
+
|-
+
| Byte
+
| 17
+
| <code>java.lang.Byte</code> or <code>byte</code>
+
| Single byte. usesful to store small 8-bit signed integers.
+
|}
+
  
 +
To use the Java library to interact with Context Collection declare the following dependency in your pom.xml file.
  
 +
<source lang="xml">
 +
<dependency>
 +
<groupId>org.gcube.information-system</groupId>
 +
<artifactId>resource-registry-schema-client</artifactId>
 +
<version>[4.0.0,5.0.0-SNAPSHOT)</version>
 +
<dependency>
 +
</source>
  
=== Resource Type Creation ===
+
=== Resource Registry Publisher ===
  
<pre>
+
Resource Registry Publisher is a java library providing RPC facilities to interact with [[Resource Registry Service - Instances Management | Instances Management]] and [[Resource Registry Service - Instances Sharing Management | Instances Sharing Management]].
PUT /resource-registry/schema/resource?schema={
+
The library hides all the complexity of marshalling and unmarshalling of requests and results.
"name":"Actor",
+
By using this library any client is able to manage java classes instead of JSON objects.
"description":"Any entity (human or machine) playing an active role.",
+
"abstractType":true,
+
"superclasses":["Resource"],
+
"properties":null
+
}
+
</pre>
+
  
=== Facet Type Creation ===
+
To use the Java library to interact with Context Collection declare the following dependency in your pom.xml file.
  
<pre>
+
<source lang="xml">
PUT /resource-registry/schema/facet?schema={
+
<dependency>
"name":"ContactFacet",
+
<groupId>org.gcube.information-system</groupId>
"description":"This facet is expected to capture contact information",
+
<artifactId>resource-registry-publisher</artifactId>
"abstractType": false,
+
<version>[4.0.0,5.0.0-SNAPSHOT)</version>
"superclasses":["Facet"],
+
<dependency>
"properties":[{
+
</source>
"name":"name",
+
"description":“First Name",
+
"mandatory":true,
+
"readonly":false,
+
"notnull":true,
+
"max":null,
+
"min":null,
+
"regexpr":null,
+
"linkedType":null,
+
"linkedClass":null,
+
"type":7 /* String*/
+
},{
+
"name":"eMail",
+
"description": "A restricted range of RFC‑822 compliant email address. ... ",
+
"mandatory":true,
+
"readonly":false,
+
"notnull":true,
+
"max":null,
+
"min":null,
+
"regexpr":
+
"^[a-z0-9._%+-]{1,128}@[a-z0-9.-]{1,128}$",
+
"linkedType":null,
+
"linkedClass":null,
+
"type":7 /* String */
+
}]
+
}
+
</pre>
+
  
=== isRelatedTo Type Creation ===
 
<pre>
 
PUT /resource-registry/schema/isRelatedTo?schema={
 
"name":"Hosts",
 
"description": “…”,
 
"abstractType":false,
 
"superclasses":["IsRelatedTo"],
 
"properties":[]
 
}
 
</pre>
 
  
=== consistsOf Type Creation ===
+
=== Resource Registry Query Template Client ===
  
<pre>
+
Resource Registry Query Template Client is a java library providing RPC facilities to interact with [[Resource Registry Service - Query Templates Management | Query Templates Management]].
PUT /resource-registry/schema/consistsOf?schema={
+
"name":"HasContact",
+
"description":"",
+
"abstractType":true,
+
"superclasses":["ConsistsOf"],
+
"properties":[]
+
}
+
</pre>
+
  
=== Embedded Type Creation ===
+
To use the Java library to interact with Query Template collection declare the following dependency in your pom.xml file.
  
PUT /resource-registry/schema/embedded?schema={
+
<source lang="xml">
"name":“AccessPolicy",
+
<dependency>
"description":"",
+
<groupId>org.gcube.information-system</groupId>
"abstractType":false,
+
<artifactId>resource-registry-query-template-client</artifactId>
"superclasses":[],
+
<version>[1.0.0,2.0.0-SNAPSHOT)</version>
"properties":[{
+
<dependency>
"name":“policy",
+
</source>
"description":"",
+
"mandatory":false,
+
"readonly":false,
+
"notnull":false,
+
"max":null,
+
"min":null,
+
"regexpr":null,
+
"linkedType":null,
+
"linkedClass":”ValueSchema”,
+
"type": 9  /* Embedded */
+
},{
+
"name":“note",
+
"description":"",
+
"mandatory": false,
+
"readonly":false,
+
"notnull":false,
+
"max":null,
+
"min":null,
+
"regexpr":null,
+
"linkedType":null,
+
"linkedClass":null,
+
"type":7 /* String*/
+
}]
+
}
+
  
== Entity Management ==  
+
=== Resource Registry Client ===
  
...
+
Resource Registry Client is a java library providing RPC facilities to interact with [[Resource Registry Service - Query & Access|Query & Access]].
 +
The library hides all the complexity of marshalling and unmarshalling of requests and results.  
 +
By using this library any client is able to manage java classes instead of JSON objects.
  
== Query Management ==
+
To use the Java library to interact with Context Collection declare the following dependency in your pom.xml file.
  
...
+
<source lang="xml">
 +
<dependency>
 +
<groupId>org.gcube.information-system</groupId>
 +
<artifactId>resource-registry-client</artifactId>
 +
<version>[4.0.0,5.0.0-SNAPSHOT)</version>
 +
<dependency>
 +
</source>

Latest revision as of 18:16, 1 February 2022

The Resource Registry is the core component of the gCube Information System designed to support the operation of a hybrid cloud-based infrastructure:

  • To capture, transmit, store, retrieve and manipulate data from any software system enabled on the infrastructure
    • Location and properties
    • Status, load, exploitation usage, and accounting data
  • To provide access to information, organized to enable
    • Monitoring, validation, and reporting
    • Elasticity and pooling of resources
  • To support any software system to
    • Discover services and infrastructure resources

The Resource Registry - core of a SOA within the complexities of a hybrid cloud-based infrastructure – must enable

  • a set of resource management functions
    • enabling functions
      • publication, discovery
      • monitoring, deployment
      • contextualization, security, execution
    • data management functions
      • access, store
      • index, search
      • transfer, transform
  • plus, a set of applications
    • built against those functions
  • Resource types: abstract view over functions
    • defined by specifications
    • multiple implementations, over time / concurrently
  • different implementations, different information
    • system cannot globally define them
    • implementations produce/consume different facets, independently
  • resource semantics dynamic
    • no longer predefined in class hierarchies
    • implicitly captured by current facets
    • changes over time / across “similar” resources

Architecture

The constituent components are:

Resource Registry Service

Resource Registry Service is the key component of the Information System. It is a web service running on SmartGears responsible for storing information regarding the Infrastructure, in particular, the global and partial view of:

  • the resources (e.g. computing, storage, services, software, datasets);
  • their current status (e.g. up and running, available);
  • their relationships with other resources.
  • the policies governing their exploitation.

Resource Registry is developed only by using the concepts defined in the IS Model and it provides the capabilities to enrich its knowledge by creating new types of entities and relations and their schemas.

Resource Registry is capable of serving different applications domains (i.e. Context). To achieve this goal, the Resource Registry provides capabilities to manage Contexts (the contexts are hierarchical) and associate the entities and relations to one or more of the Contexts as requested by the different clients.

The Resource registry is also responsible for notifying any update or creation of any entity or relation to Information System Subscription Notification Service.

Maven coordinates are:

<dependency>
	<groupId>org.gcube.information-system</groupId>
	<artifactId>resource-registry</artifactId>
	<version>[4.0.0,5.0.0-SNAPSHOT)</version>
<dependency>


To reach its goals Resource Registry offers 5 port types:

Every Port type is exposed as REST API.

Every REST API is JSON based. In other words, any content of an HTTP request is represented in JSON.

Resource Registry Context Client

Resource Registry Schema is a java library providing RPC facilities to interact with Context Management. The library hides all the complexity of marshalling and unmarshalling of requests and results. By using this library any client is able to manage java classes instead of JSON objects.

To use the Java library to interact with Context Collection declare the following dependency in your pom.xml file.

<dependency>
	<groupId>org.gcube.information-system</groupId>
	<artifactId>resource-registry-context-client</artifactId>
	<version>[4.0.0,5.0.0-SNAPSHOT)</version>
<dependency>

Resource Registry Schema Client

Resource Registry Schema is a java library providing RPC facilities to interact with Type Management. The library hides all the complexity of marshalling and unmarshalling of requests and results. By using this library any client is able to manage java classes instead of JSON objects.

To use the Java library to interact with Context Collection declare the following dependency in your pom.xml file.

<dependency>
	<groupId>org.gcube.information-system</groupId>
	<artifactId>resource-registry-schema-client</artifactId>
	<version>[4.0.0,5.0.0-SNAPSHOT)</version>
<dependency>

Resource Registry Publisher

Resource Registry Publisher is a java library providing RPC facilities to interact with Instances Management and Instances Sharing Management. The library hides all the complexity of marshalling and unmarshalling of requests and results. By using this library any client is able to manage java classes instead of JSON objects.

To use the Java library to interact with Context Collection declare the following dependency in your pom.xml file.

<dependency>
	<groupId>org.gcube.information-system</groupId>
	<artifactId>resource-registry-publisher</artifactId>
	<version>[4.0.0,5.0.0-SNAPSHOT)</version>
<dependency>


Resource Registry Query Template Client

Resource Registry Query Template Client is a java library providing RPC facilities to interact with Query Templates Management.

To use the Java library to interact with Query Template collection declare the following dependency in your pom.xml file.

<dependency>
	<groupId>org.gcube.information-system</groupId>
	<artifactId>resource-registry-query-template-client</artifactId>
	<version>[1.0.0,2.0.0-SNAPSHOT)</version>
<dependency>

Resource Registry Client

Resource Registry Client is a java library providing RPC facilities to interact with Query & Access. The library hides all the complexity of marshalling and unmarshalling of requests and results. By using this library any client is able to manage java classes instead of JSON objects.

To use the Java library to interact with Context Collection declare the following dependency in your pom.xml file.

<dependency>
	<groupId>org.gcube.information-system</groupId>
	<artifactId>resource-registry-client</artifactId>
	<version>[4.0.0,5.0.0-SNAPSHOT)</version>
<dependency>