Asset dati REST generico
Al momento, devi caricare un file manifest quando crei un asset dati REST. Un file manifesto descrive l'intera API dell'URL di base, inclusi percorsi, operazioni, parametri, corpo della richiesta e strutture di risposta e proprietà dell'oggetto. Il file non deve superare i 3 MB.
Prima di creare un asset dati REST, assicurati di comprendere cosa è supportato ed eventuali limitazioni correnti.
Informazioni preliminari
Data Integration supporta OpenAPI 3.0.0 (e versioni successive) e solo i file manifest JSON o YML/YAML per l'origine dati REST.
Per creare un asset dati REST, è necessario fornire l'URL di base degli endpoint API e caricare il file manifest.
Un endpoint API completo è costituito da un URL di base, un percorso di risorsa e un URL del server definito nel file manifest. Considerare l'endpoint con il percorso /users/findByStatus
:
https://myapi.example.com/v1/users/findByStatus
Se l'URL del server del file manifesto è /v1
, l'URL di base è:
https://myapi.example.com
Se l'URL del server non è definito nel file manifest o il file manifest ha l'URL del server /
, l'URL di base è:
https://myapi.example.com/v1
Quando si crea e utilizza un asset dati REST come origine in Data Integration, tenere presenti le funzionalità supportate e le limitazioni correnti riportate di seguito.
- Il file manifesto per il caricamento non deve superare i 3 MB.
- I file manifesto JSON e YML/YAML basati su una versione precedente alla 3.0.0 non sono supportati.
- OAuth 2.0, Basic e nessuna autenticazione sono supportati.
- Sono supportate solo le chiamate
GET
. - L'intestazione e i cookie nel corpo o nella risposta di una richiesta non sono supportati.
- Una risposta JSON come file non è supportata.
- È supportato solo il file JSON
content-type
. - Le parole chiave
OneOf
,AnyOf
,AllOf
eAdditionalProperties
non sono supportate in un file manifesto. - Il contenuto del parametro deve essere descritto utilizzando la parola chiave
schema
; la parola chiave content non è supportata. - Un valore predefinito per un parametro non è supportato. Nel caso di un parametro facoltativo con impostazione predefinita, è necessario fornire esplicitamente un valore predefinito.
- Sono supportati solo i tipi di dati Integer, Long, Float, Double, Number e String.
- I formati dati Data, Password, E-mail e Binario vengono ignorati e trattati come solo stringa.
- Sono supportati solo i tipi primitivi per i parametri di percorso.
- Primitivo e Array di primitive sono supportati per i parametri di query.
- L'array di array in una risposta JSON non è supportato.
- Gli attributi di stile ed esplosione vengono ignorati e un parametro di query viene trattato come style=form, esplode=true mentre un parametro di percorso viene trattato come style=simple, esplode=false.
- Il riferimento (
#ref
) deve essere solo locale e non può puntare a un URL o a un altro file. #ref
perschema
è supportato.responses
,headers
eparameters
non devono utilizzare#ref
.- Al momento, l'opzione Test connessione per un asset dati REST non è implementata; restituisce sempre true (riuscito).
- Quando si visualizzano i dettagli dell'asset dati, il profiling o l'anteprima dei dati gerarchici non è supportato.
- In una risposta, solo gli attributi di livello radice vengono mappati ai nomi di colonna.
- Se un endpoint restituisce un array di origini predefinite, esiste una sola colonna, ad esempio "
<name>_index
", doveindex
è>= 0
Proprietà asset dati REST
Prima di creare l'asset dati REST, assicurarsi di disporre dell'URL di base e del file manifest.
Per utilizzare un segreto per la password con autenticazione di base, vedere Segreti di OCI Vault e wallet Oracle.
Per creare un asset dati che si connette a un'origine REST, completare le proprietà e i dettagli di connessione riportati di seguito. Vedere Sample Manifest File.
Campo | descrizione; |
---|---|
Proprietà | |
Nome | Immettere un nome per l'asset dati. |
Identificativo | L'identificativo è un valore generato dal sistema in base al nome. È possibile modificare il valore dell'identificativo, ma dopo aver creato e salvato non è possibile aggiornare l'identificativo. |
descrizione; | (Facoltativo) Aggiungere una descrizione. |
Digita | Il campo mostra il tipo di origine dati selezionato nel pannello Seleziona tipo di asset dati (come descritto nella sezione Creazione di un asset dati). In Data Integration vengono visualizzati i campi delle proprietà dell'asset dati e i campi di connessione predefiniti in base a questo tipo. |
URL di base |
Immettere l'URL di base degli endpoint API. Ad esempio: oppure
|
Carica file manifest |
Rilasciare il file YML/YAML o JSON per caricare il file manifest che può passare attraverso l'URL di base. In alternativa, è possibile fare clic sul collegamento Seleziona file per individuare la posizione che contiene il file. Se non si fornisce un file manifesto e viene visualizzato il messaggio |
Informazioni di connessione predefinite | |
Nome | Immettere un nome per la connessione predefinita. |
Identificativo | L'identificativo è un valore generato dal sistema in base al nome. È possibile modificare il valore dell'identificativo, ma dopo aver creato e salvato non è possibile aggiornare l'identificativo. |
descrizione; | (Facoltativo) Aggiungere una descrizione. |
Autenticazione |
Selezionare uno dei metodi di autenticazione descritti di seguito.
Impossibile modificare il tipo di autenticazione per una connessione dopo che è stata creata. |
(Facoltativo) Eseguire il test della connessione | |
Verifica connessione | Dopo aver completato tutti i campi obbligatori, selezionare Test della connessione per assicurarsi che i dettagli dell'asset dati siano stati immessi correttamente e che la connessione possa essere stabilita. Se il test riesce, viene visualizzato un messaggio di operazione riuscita. Se il test non riesce con un messaggio di errore, rivedere le impostazioni di connessione e riprovare. |
File manifesto di esempio
{
"openapi": "3.0.1",
"servers": [
{
"url": "/v1",
"description": "Generated server url"
}
],
"paths": {
"/orders": {
"get": {
"tags": [
"rest-connector-controller"
],
"operationId": "getOrders",
"responses": {
"200": {
"$ref": "#/components/responses/orderSuccess"
}
}
}
},
"/paginatedOrders": {
"get": {
"tags": [
"rest-connector-controller"
],
"operationId": "getPaginatedOrdersRowOffset",
"parameters": [
{
"name": "maximumPageSize",
"in": "query",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "firstRowNumber",
"in": "query",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "rowOffsetParameter",
"in": "query",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "pageSizeParameter",
"in": "query",
"required": false,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PaginatedOrders"
}
}
}
}
}
}
},
"/paginatedOrdersPageNum": {
"get": {
"tags": [
"rest-connector-controller"
],
"operationId": "getPaginatedOrdersPageNumberBased",
"parameters": [
{
"name": "maximumPageSize",
"in": "query",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "firstPageNumber",
"in": "query",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "pageSizeParameter",
"in": "query",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "pageNumberParameter",
"in": "query",
"required": false,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PaginatedOrders"
}
}
}
}
}
}
},
"/orders/{orderNo}": {
"get": {
"tags": [
"rest-connector-controller"
],
"operationId": "getOrdersByOrderID",
"parameters": [
{
"$ref": "#/components/parameters/orderNum"
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Order"
}
}
}
}
}
},
"delete": {
"tags": [
"rest-connector-controller"
],
"operationId": "deleteOrder",
"parameters": [
{
"name": "orderNo",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/orders/noAuth/{orderNo}": {
"get": {
"tags": [
"rest-connector-controller"
],
"operationId": "getOrdersByOrderIDNoAuth",
"parameters": [
{
"name": "orderNo",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Order"
}
}
}
}
}
}
},
"/orders/headers/validation": {
"get": {
"tags": [
"rest-connector-controller"
],
"operationId": "getOrdersAfterHeadersValidation",
"parameters": [
{
"name": "UserId",
"in": "header",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "Password",
"in": "header",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "Email",
"in": "header",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SalesOrders"
}
}
}
}
}
}
},
"/orders/filterbystore": {
"get": {
"tags": [
"rest-connector-controller"
],
"operationId": "getOrdersByStore",
"parameters": [
{
"$ref": "#/components/parameters/storeId"
},
{
"name": "customerName",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Order"
}
}
}
}
}
}
}
},
"/orders/byName": {
"get": {
"tags": [
"rest-connector-controller"
],
"operationId": "getOrdersByCustomerName",
"parameters": [
{
"name": "customerName",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Order"
}
}
}
}
}
}
}
},
"/orders/byEmail": {
"get": {
"tags": [
"rest-connector-controller"
],
"operationId": "getOrdersByCustomerEmail",
"parameters": [
{
"name": "customerEmail",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Order"
}
}
}
}
}
}
}
},
"/customers/getCustomersName": {
"get": {
"tags": [
"rest-connector-controller"
],
"operationId": "getCustomersName",
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
}
},
"/customers/getCustomer": {
"get": {
"tags": [
"rest-connector-controller"
],
"operationId": "getCustomer",
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Customer"
}
}
}
}
}
}
},
"/customers/getCustomerList": {
"get": {
"tags": [
"rest-connector-controller"
],
"operationId": "getCustomersList",
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Customer"
}
}
}
}
}
}
}
},
"/customers/getCustomerEmail": {
"get": {
"tags": [
"rest-connector-controller"
],
"operationId": "getCustomerInfoSingleField",
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"customerEmail": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/headOffice": {
"get": {
"tags": [
"rest-connector-controller"
],
"operationId": "getHeadOffice",
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HeadOffice"
}
}
}
}
}
}
},
"/namedPrimitiveArray": {
"get": {
"tags": [
"rest-connector-controller"
],
"operationId": "getNamedPrimitiveArray",
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
}
}
}
},
"/primitive": {
"get": {
"tags": [
"rest-connector-controller"
],
"operationId": "getSinglePrimitive",
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "string"
}
}
}
}
}
}
},
"/reservedColumns": {
"get": {
"tags": [
"rest-connector-controller"
],
"operationId": "getReservedColumns",
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Positions"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"Address": {
"type": "object",
"properties": {
"street": {
"type": "string"
},
"city": {
"type": "string"
},
"country": {
"type": "string"
},
"zipcode": {
"type": "string"
}
}
},
"Fullfilment": {
"type": "object",
"properties": {
"storeNo": {
"type": "string"
},
"lineItems": {
"type": "array",
"items": {
"$ref": "#/components/schemas/LineItems"
}
}
}
},
"LineItems": {
"type": "object",
"properties": {
"itemName": {
"type": "string"
},
"itemId": {
"type": "string"
},
"qty": {
"type": "string"
}
}
},
"Order": {
"type": "object",
"properties": {
"customerName": {
"type": "string"
},
"orderNo": {
"type": "string"
},
"phoneNo": {
"type": "string"
},
"email": {
"type": "string"
},
"address": {
"$ref": "#/components/schemas/Address"
},
"fullfilments": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Fullfilment"
}
}
}
},
"PaginatedOrders": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Order"
}
}
}
},
"SalesOrders": {
"type": "object",
"properties": {
"orders": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Order"
}
}
}
},
"Customer": {
"type": "object",
"properties": {
"customerEmail": {
"type": "string"
},
"type": {
"type": "string"
},
"customerName": {
"type": "string"
},
"phoneno": {
"type": "string"
},
"address": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
},
"HeadOffice": {
"type": "object",
"properties": {
"longitude": {
"type": "number"
},
"latitude": {
"type": "number",
"format": "double"
},
"turnover": {
"type": "number",
"format": "float"
},
"milliSeconds": {
"type": "integer",
"format": "int64"
},
"storeNo": {
"type": "integer",
"format": "int32"
},
"noOfEmployees": {
"type": "integer"
}
}
},
"Positions": {
"type": "object",
"properties": {
"position": {
"type": "array",
"items": {
"type": "object",
"properties": {
"Position_1": {
"type": "integer"
},
"Position": {
"type": "string"
},
"Position_3": {
"type": "number",
"format": "float"
},
"Position_4": {
"type": "number",
"format": "double"
},
"Position_2": {
"type": "integer",
"format": "int64"
},
"Position_11": {
"type": "string"
}
}
}
}
}
}
},
"parameters": {
"orderNum": {
"name": "orderNo",
"in": "path",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "string"
}
}
}
},
"storeId": {
"name": "storeId",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
}
},
"responses": {
"orderSuccess": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SalesOrders"
}
}
}
}
}
}
}