diff --git a/nf-samples/README.md b/netapp-samples/README.md similarity index 100% rename from nf-samples/README.md rename to netapp-samples/README.md diff --git a/netapp-samples/netapp-invoker-sample/capif-sdk-config-sample.json b/netapp-samples/netapp-invoker-sample/capif-sdk-config-sample.json new file mode 100644 index 0000000000000000000000000000000000000000..2db803f3719e59923606dad0c744475c1fa5fd4f --- /dev/null +++ b/netapp-samples/netapp-invoker-sample/capif-sdk-config-sample.json @@ -0,0 +1,21 @@ +{ +"invoker_folder": "/Users/dgs/Downloads/capif_sdk/invoker/", +"provider_folder": "/Users/dgs/Downloads/capif_sdk/provider/", +"capif_host": "capif-prev.mobilesandbox.cloud", +"register_host": "registercapif-prev.mobilesandbox.cloud", +"capif_https_port": "36212", +"capif_register_port": "36211", +"capif_callback_url": "capif-prev.mobilesandbox.cloud", +"csr_common_name": "myAppServer", +"csr_organizational_unit": "TID", +"csr_organization": "Telefonica", +"crs_locality": "Madrid", +"csr_state_or_province_name": "Spain", +"csr_country_name": "ES", +"csr_email_address": "daniel.garciasanchez@telefonica.com", +"capif_username": "Daniel_TEF", +"capif_password": "PISRsuTErTio", +"APFs":"2", +"AEFs":"2", +"debug_mode": "true" +} diff --git a/netapp-samples/netapp-invoker-sample/netapp-invoker.py b/netapp-samples/netapp-invoker-sample/netapp-invoker.py new file mode 100644 index 0000000000000000000000000000000000000000..b44d2569540552aece2ed8b8f0b45c4725733532 --- /dev/null +++ b/netapp-samples/netapp-invoker-sample/netapp-invoker.py @@ -0,0 +1,29 @@ +import sys +import os +import utilities + +# Añadir el directorio del SDK al PYTHONPATH usando una ruta relativa +script_dir = os.path.dirname(os.path.abspath(__file__)) # Directorio actual del script +sys.path.insert(0, script_dir) + +capif_sdk_config_path = "/Users/dgs/Downloads/capif_sdk/invoker/config.json" + +from sdk import CAPIFInvokerConnector + +if __name__ == "__main__": + + capif_connector = CAPIFInvokerConnector(config_file=utilities.get_config_file()) + + capif_connector.register_and_onboard_Invoker() + print("INVOKER ONBOARDING COMPLETED") + + # Aquà ya tengo certificados, ahora puedo hacer discover (get token para un api o varios, según elijas) + + # Como developer yo ya sé a qué APIs quiero acceder + # DISCOVER filter configureCmcAmfSet + # Without DISCOVER filter it is obtained the whole list of available APIs in CAPIF + + + + + diff --git a/netapp-samples/netapp-provider-sample/netapp-provider-api-spec.json b/netapp-samples/netapp-provider-sample/netapp-provider-api-spec.json new file mode 100755 index 0000000000000000000000000000000000000000..ee16d98add75bd2df729d7e9151f966599d7d7f9 --- /dev/null +++ b/netapp-samples/netapp-provider-sample/netapp-provider-api-spec.json @@ -0,0 +1,155 @@ +{ + "apiName": "Api-de-prueba-2", + "aefProfiles": [ + { + "aefId": "AEF0f66526ff2fd8a1be721ace3506adb", + "versions": [ + { + "apiVersion": "v1", + "expiry": "2100-11-30T10:32:02.004Z", + "resources": [ + { + "resourceName": "MONITORING_SUBSCRIPTIONS", + "commType": " SUBSCRIBE_NOTIFY", + "uri": "/{scsAsId}/subscriptions", + "custOpName": "http_post", + "operations": [ + "GET", + "POST" + ], + "description": "Endpoint to manage monitoring subscriptions" + }, + { + "resourceName": "MONITORING_SUBSCRIPTION_SINGLE", + "commType": " SUBSCRIBE_NOTIFY", + "uri": "/{scsAsId}/subscriptions/{subscriptionId}", + "custOpName": "http_get", + "operations": [ + "GET", + "PUT", + "DELETE" + ], + "description": "Endpoint to manage single subscription" + } + ], + "custOperations": [ + { + "commType": "REQUEST_RESPONSE", + "custOpName": "string", + "operations": [ + "POST" + ], + "description": "string" + } + ] + } + ], + "protocol": "HTTP_1_1", + "dataFormat": "JSON", + "securityMethods": [ + "Oauth", + "PSK" + ], + "interfaceDescriptions": [ + { + "ipv4Addr": "127.0.0.1", + "port": 8888, + "securityMethods": [ + "Oauth" + ] + } + ] + }, + { + "aefId": "AEF212b55c43b1b16116192043bab9e05", + "versions": [ + { + "apiVersion": "v1", + "expiry": "2100-11-30T10:32:02.004Z", + "resources": [ + { + "resourceName": "TSN_LIST_PROFILES", + "commType": " SUBSCRIBE_NOTIFY", + "uri": "/profile", + "custOpName": "http_get", + "operations": [ + "GET" + ], + "description": "Endpoint for retrieving the list of available TSN profiles" + }, + { + "resourceName": "TSN_DETAIL_PROFILE", + "commType": " SUBSCRIBE_NOTIFY", + "uri": "/profile?name={profileName}", + "custOpName": "http_get", + "operations": [ + "GET" + ], + "description": "Endpoint for retrieving information about a single TSN profile" + }, + { + "resourceName": "TSN_APPLY_CONFIGURATION", + "commType": " SUBSCRIBE_NOTIFY", + "uri": "/apply", + "custOpName": "http_post", + "operations": [ + "POST" + ], + "description": "Endpoint for configuring TSN connection parameters" + }, + { + "resourceName": "TSN_CLEAR_CONFIGURATION", + "commType": " SUBSCRIBE_NOTIFY", + "uri": "/clear", + "custOpName": "http_post", + "operations": [ + "POST" + ], + "description": "Endpoint for removing a previous TSN connection configuration" + } + ], + "custOperations": [ + { + "commType": "REQUEST_RESPONSE", + "custOpName": "string", + "operations": [ + "POST" + ], + "description": "string" + } + ] + } + ], + "protocol": "HTTP_1_1", + "dataFormat": "JSON", + "securityMethods": [ + "Oauth" + ], + "interfaceDescriptions": [ + { + "ipv4Addr": "127.0.0.1", + "port": 8899, + "securityMethods": [ + "Oauth" + ] + } + ] + } + ], + "description": "API of dummy netapp to test", + "supportedFeatures": "fffff", + "shareableInfo": { + "isShareable": true, + "capifProvDoms": [ + "string" + ] + }, + "serviceAPICategory": "string", + "apiSuppFeats": "fffff", + "pubApiPath": { + "ccfIds": [ + "string" + ] + }, + "ccfId": "string" +} \ No newline at end of file diff --git a/netapp-samples/netapp-provider-sample/netapp-provider.py b/netapp-samples/netapp-provider-sample/netapp-provider.py new file mode 100644 index 0000000000000000000000000000000000000000..b44d2569540552aece2ed8b8f0b45c4725733532 --- /dev/null +++ b/netapp-samples/netapp-provider-sample/netapp-provider.py @@ -0,0 +1,29 @@ +import sys +import os +import utilities + +# Añadir el directorio del SDK al PYTHONPATH usando una ruta relativa +script_dir = os.path.dirname(os.path.abspath(__file__)) # Directorio actual del script +sys.path.insert(0, script_dir) + +capif_sdk_config_path = "/Users/dgs/Downloads/capif_sdk/invoker/config.json" + +from sdk import CAPIFInvokerConnector + +if __name__ == "__main__": + + capif_connector = CAPIFInvokerConnector(config_file=utilities.get_config_file()) + + capif_connector.register_and_onboard_Invoker() + print("INVOKER ONBOARDING COMPLETED") + + # Aquà ya tengo certificados, ahora puedo hacer discover (get token para un api o varios, según elijas) + + # Como developer yo ya sé a qué APIs quiero acceder + # DISCOVER filter configureCmcAmfSet + # Without DISCOVER filter it is obtained the whole list of available APIs in CAPIF + + + + +