diff --git a/.gitignore b/.gitignore index ddc84e3dff4947d38b2c83bc330fb72c21e4cb53..63fa7fc75b262e60fbd173fc17b96b4a6544abf9 100644 --- a/.gitignore +++ b/.gitignore @@ -37,4 +37,5 @@ results helm/capif/*.lock helm/capif/charts/tempo* -*.bak \ No newline at end of file +*.bakresults/ +*.bak diff --git a/helm/capif/Chart.yaml b/helm/capif/Chart.yaml index 89785865369522b11e226ced4ae87db254e898a8..07697e0fb576e90c419ffe420e0d6f4466bc0445 100644 --- a/helm/capif/Chart.yaml +++ b/helm/capif/Chart.yaml @@ -22,57 +22,85 @@ appVersion: "v3.1.6" dependencies: - name: ocf-access-control-policy version: "*" + tags: ["core"] - name: ocf-api-invoker-management version: "*" + tags: ["core"] - name: ocf-api-provider-management version: "*" + tags: ["core"] - name: ocf-api-invocation-logs version: "*" + tags: ["core"] - name: ocf-events version: "*" + tags: ["core"] - name: ocf-helper version: "*" + tags: ["core"] - name: ocf-routing-info version: "*" + tags: ["core"] - name: ocf-security version: "*" - - name: ocf-register - version: "*" - - name: mongo-register - version: "*" + tags: ["core"] - name: ocf-auditing-api-logs version: "*" + tags: ["core"] - name: ocf-publish-service-api version: "*" + tags: ["core"] - name: ocf-discover-service-api version: "*" - - name: mongo - version: "*" - - name: mongo-express - version: "*" - - name: mongo-register-express - version: "*" + tags: ["core"] - name: nginx version: "*" + tags: ["core"] - name: mock-server version: "*" + tags: ["core"] - name: redis version: "*" + tags: ["core"] - name: fluentbit version: "*" + tags: ["core"] - name: grafana version: "*" + tags: ["core"] - name: loki version: "*" + tags: ["core"] - name: otelcollector version: "*" + tags: ["core"] - name: renderer version: "*" + tags: ["core"] - name: celery-beat version: "*" + tags: ["core"] - name: celery-worker version: "*" + tags: ["core"] - name: "tempo" condition: tempo.enabled repository: "https://grafana.github.io/helm-charts" version: "^1.3.1" + tags: ["core"] + - name: ocf-register + version: "*" + tags: ["register"] + - name: mongo-register + version: "*" + tags: ["register-db"] + - name: mongo-register-express + version: "*" + tags: ["register-db"] + - name: mongo + version: "*" + tags: ["core-db"] + - name: mongo-express + version: "*" + tags: ["core-db"] + diff --git a/helm/capif/charts/mongo/templates/deployment.yaml b/helm/capif/charts/mongo/templates/deployment.yaml index 80cedad5207f48141191f03ba58e0ec9bdf09646..244693ccdf2e7a8bf896476f46f70d8189a155c8 100644 --- a/helm/capif/charts/mongo/templates/deployment.yaml +++ b/helm/capif/charts/mongo/templates/deployment.yaml @@ -56,7 +56,7 @@ spec: {{- toYaml . | nindent 12 }} {{- end }} - name: mongo-helper - image: busybox + image: "{{ .Values.busybox.repository }}:{{ .Values.busybox.tag | default .Chart.AppVersion }}" command: - sh - -c diff --git a/helm/capif/charts/mongo/values.yaml b/helm/capif/charts/mongo/values.yaml index 6e15c566a7b192b7aae0841b09aca850bef09027..0ba34e90634edc813b503e67e4570d900e0fac64 100644 --- a/helm/capif/charts/mongo/values.yaml +++ b/helm/capif/charts/mongo/values.yaml @@ -10,6 +10,12 @@ image: # Overrides the image tag whose default is the chart appVersion. tag: "6.0.2" +busybox: + repository: busybox + pullPolicy: Always + # Overrides the image tag whose default is the chart appVersion. + tag: "1.37.0" + imagePullSecrets: [] nameOverride: "" fullnameOverride: "" diff --git a/helm/capif/charts/ocf-helper/templates/ocf-helper-configmap.yaml b/helm/capif/charts/ocf-helper/templates/ocf-helper-configmap.yaml index fe3e1c170fce991454b0442d0613ad3247c067a4..f422d446bc1c4d03bf93fdf682206ac48eb238b3 100644 --- a/helm/capif/charts/ocf-helper/templates/ocf-helper-configmap.yaml +++ b/helm/capif/charts/ocf-helper/templates/ocf-helper-configmap.yaml @@ -26,4 +26,19 @@ data: {{- if .Values.capifConfiguration }} capif_configuration: {{ .Values.capifConfiguration | toYaml | nindent 6 }} - {{- end }} \ No newline at end of file + {{- end }} + + package_paths: { + "helper_api": { + "path": "/api", + "openapi_file": "api/openapi/openapi.yaml" + }, + "configuration_api": { + "path": "/configuration", + "openapi_file": "configuration/openapi/openapi.yaml" + }, + "visibility_control": { + "path": "/visibility-control", + "openapi_file": "visibility_control/openapi/openapi.yaml" + } + } \ No newline at end of file diff --git a/helm/capif/charts/ocf-register/templates/deployment.yaml b/helm/capif/charts/ocf-register/templates/deployment.yaml index 23ef72cadd37d0b44c60c5b23627186683a74053..31afe6924d7ffd65f12406080212f6a067339a9d 100644 --- a/helm/capif/charts/ocf-register/templates/deployment.yaml +++ b/helm/capif/charts/ocf-register/templates/deployment.yaml @@ -53,6 +53,8 @@ spec: value: {{ quote .Values.env.logLevel }} - name: TIMEOUT value: {{ quote .Values.env.timeout }} + - name: REGISTER_HOSTNAME + value: {{ quote .Values.env.registerHostname }} livenessProbe: {{- toYaml .Values.livenessProbe | nindent 12 }} readinessProbe: diff --git a/helm/capif/charts/ocf-register/values.yaml b/helm/capif/charts/ocf-register/values.yaml index bf12e498a876405261c5214c3ebc7354e00cd399..af2ca9f16e08054dc3c1ad636c52f620cd1a2570 100644 --- a/helm/capif/charts/ocf-register/values.yaml +++ b/helm/capif/charts/ocf-register/values.yaml @@ -21,6 +21,7 @@ env: vaultPort: 8200 vaultAccessToken: dev-only-token capifHostname: capif-test.example.int + registerHostname: register logLevel: "INFO" timeout: "30" diff --git a/helm/capif/values.yaml b/helm/capif/values.yaml index 9ecc11e00f197520bc04814c61a4381c66b4992f..dfd4a6bd0733ed50a8a5a85676dd2b2e399fc8ba 100644 --- a/helm/capif/values.yaml +++ b/helm/capif/values.yaml @@ -3,6 +3,12 @@ # -- tempo, fluentbit, grafana, loki, otelcollector and renderer. # -- prometheus service must be previously installed in kubernetes +tags: + core: true + core-db: true + register: true + register-db: true + # -- With tempo.enabled: false. It won't be deployed tempo: enabled: true diff --git a/helm/scripts/create_remote_users.sh b/helm/scripts/create_remote_users.sh index a0209b31da4538e17dcb49b4c1343e903a029726..d7b4ce5833df1e0cd0fc40bc04350a8a96e95000 100755 --- a/helm/scripts/create_remote_users.sh +++ b/helm/scripts/create_remote_users.sh @@ -1,5 +1,14 @@ #!/bin/bash -source $(dirname "$(readlink -f "$0")")/variables.sh + +# Capture the first parameter as a possible environment +ENVIRONMENT="dev" +if [[ "$1" != -* && -n "$1" ]]; then + ENVIRONMENT="$1" + shift +fi + +# Load variables for the selected environment +source "$(dirname "$0")/variables.sh" "$ENVIRONMENT" # User to create TOTAL_USERS=1 @@ -7,11 +16,20 @@ USERNAME_PREFIX= USER_PASSWORD= help() { - echo "Usage: $1 " - echo " -u : User prefix to use" - echo " -p : Password to set for user" - echo " -t : Total user to create (default 1)" - echo " -h : show this help" + echo "Usage: $0 [environment] [options]" + echo "" + echo " environment Optional. Environment name to use (e.g. dev, prod)." + echo " If not specified, 'dev' will be used by default." + echo "" + echo "Options:" + echo " -u User prefix to use (required)" + echo " -p Password to set for user (required)" + echo " -t Total users to create (default: 1)" + echo " -h Show this help message" + echo "" + echo "Examples:" + echo " $0 prod -u testuser -p pass123 -t 5" + echo " $0 -u testuser -p pass123" exit 1 } @@ -142,4 +160,6 @@ docker run -ti --rm --network="host" \ --variable TOTAL_USERS:$TOTAL_USERS \ --variable USERNAME_PREFIX:$USERNAME_PREFIX \ --variable USER_PASSWORD:$USER_PASSWORD \ + --variable REGISTER_ADMIN_USER:$REGISTER_ADMIN_USER \ + --variable REGISTER_ADMIN_PASSWORD:$REGISTER_ADMIN_PASSWORD \ --include create-users diff --git a/services/helper/helper_service/certs/.gitkeep b/helm/scripts/envs/.gitkeep similarity index 100% rename from services/helper/helper_service/certs/.gitkeep rename to helm/scripts/envs/.gitkeep diff --git a/helm/scripts/envs/example.env b/helm/scripts/envs/example.env new file mode 100644 index 0000000000000000000000000000000000000000..0d976b1b5acd269f6e3bd45530f25104d9acf966 --- /dev/null +++ b/helm/scripts/envs/example.env @@ -0,0 +1,19 @@ +# Setup kubeconfig to be used +export CUSTOM_KUBECONFIG="cluster-example.kubeconfig" + +# Setup Vault parameters to deploy on this environment +export VAULT_HOSTNAME=vault.example.production +export DOMAIN1=*.example.production +export DOMAIN2=*.example.staging +export DOMAIN3=*.example.dev + +# Setup Monitoring parameters +export PROMETHEUS_HOSTNAME=prometheus.example.production + +# Setup OpenCAPIF parameters +export CAPIF_HOSTNAME="capif.example.staging" +export REGISTER_HOSTNAME="register.example.staging" +export CAPIF_NAMESPACE=ocf-capif +export CAPIF_CI_ENV_ENDPOINT=staging +export CAPIF_DOMAIN=example.staging +export CAPIF_IMAGE_TAG="v3.0.0-release" diff --git a/helm/scripts/get_ingress.sh b/helm/scripts/get_ingress.sh index 53b79c31c8e4de8db3c318809549330492d1b058..b801071591e5769d9b9fe6683e8ae033bb259d45 100755 --- a/helm/scripts/get_ingress.sh +++ b/helm/scripts/get_ingress.sh @@ -1,17 +1,35 @@ #!/bin/bash IP="" NAMESPACE="" -source $(dirname "$(readlink -f "$0")")/variables.sh + +# Capture the first parameter as a possible environment +ENVIRONMENT="dev" +if [[ "$1" != -* && -n "$1" ]]; then + ENVIRONMENT="$1" + shift +fi + +# Load variables for the selected environment +source "$(dirname "$0")/variables.sh" "$ENVIRONMENT" help() { - echo "Usage: $1 " - echo " -i : IP to use" - echo " -n : Namespace to get ingress information" - echo " -k : Kubeconfig to be used" - echo " -h : show this help" + echo "Usage: $0 [environment] [options]" + echo "" + echo " environment Optional. Environment name to use (e.g. dev, prod)." + echo " If not specified, 'dev' will be used by default." + echo "" + echo "Options:" + echo " -i IP to use" + echo " -n Namespace to get ingress information" + echo " -k Kubeconfig to be used" + echo " -h Show this help message" + echo "" + echo "Examples:" + echo " $0 prod -i 10.0.0.1 -n mynamespace" + echo " $0 -n mynamespace" exit 1 } -# Read params +# Process flags with getopts while getopts ":i:n:k:h" opt; do case $opt in i) diff --git a/helm/scripts/install_capif.sh b/helm/scripts/install_capif.sh index 74b1146a28ff321a0b7fb20ee6c4843a8b841e1c..48cdb156bbd919747c01a5a45e4330d1e01319d9 100755 --- a/helm/scripts/install_capif.sh +++ b/helm/scripts/install_capif.sh @@ -1,5 +1,14 @@ #!/bin/bash -source $(dirname "$(readlink -f "$0")")/variables.sh + +# Capture the first parameter as a possible environment +ENVIRONMENT="dev" +if [[ "$1" != -* && -n "$1" ]]; then + ENVIRONMENT="$1" + shift +fi + +# Load variables for the selected environment +source "$(dirname "$0")/variables.sh" "$ENVIRONMENT" helm repo add grafana https://grafana.github.io/helm-charts @@ -9,140 +18,166 @@ helm $KUBECONFIG dependency build $HELM_DIR/capif/ ### check ingress_ip.oneke and get ip from ingress-nginx-controller kubectl $KUBECONFIG get svc -A | grep ingress-nginx-controller -helm $KUBECONFIG upgrade --install -n $CAPIF_NAMESPACE $CAPIF_NAME_VERSION_CHART $HELM_DIR/capif/ \ ---set grafana.enabled=true \ ---set grafana.ingress.enabled=true \ ---set grafana.ingress.hosts[0].host=ocf-mon-$CAPIF_CI_ENV_ENDPOINT.$CAPIF_DOMAIN \ ---set grafana.ingress.hosts[0].paths[0].path="/" \ ---set grafana.ingress.hosts[0].paths[0].pathType="Prefix" \ ---set grafana.env.prometheusUrl=$PROMETHEUS_URL \ ---set grafana.env.tempoUrl="http://$CAPIF_NAME_VERSION_CHART-tempo:3100" \ ---set grafana.persistence.storageClass=$CAPIF_STORAGE_CLASS \ ---set grafana.persistence.storage=$CAPIF_GRAFANA_STORAGE_SIZE \ ---set fluentbit.enabled=true \ ---set loki.enabled=true \ ---set loki.persistence.storageClass=$CAPIF_STORAGE_CLASS \ ---set loki.persistence.storage=$CAPIF_LOKI_STORAGE_SIZE \ ---set tempo.tempo.metricsGenerator.remoteWriteUrl=$PROMETHEUS_URL/api/v1/write \ ---set tempo.persistence.size=$CAPIF_TEMPO_STORAGE_SIZE \ ---set otelcollector.enabled=true \ ---set otelcollector.configMap.tempoEndpoint=$CAPIF_NAME_VERSION_CHART-tempo:4317 \ ---set ocf-access-control-policy.image.repository=$CAPIF_DOCKER_REGISTRY/ocf-access-control-policy-api \ ---set ocf-access-control-policy.image.tag=$CAPIF_IMAGE_TAG \ ---set ocf-access-control-policy.image.env.capifHostname=$CAPIF_HOSTNAME \ ---set ocf-access-control-policy.monitoring="true" \ ---set ocf-access-control-policy.env.logLevel="DEBUG" \ ---set ocf-api-invocation-logs.image.repository=$CAPIF_DOCKER_REGISTRY/ocf-logging-api-invocation-api \ ---set ocf-api-invocation-logs.image.tag=$CAPIF_IMAGE_TAG \ ---set ocf-api-invocation-logs.env.monitoring="true" \ ---set ocf-api-invocation-logs.env.capifHostname=$CAPIF_HOSTNAME \ ---set ocf-api-invocation-logs.env.vaultHostname=$VAULT_INTERNAL_HOSTNAME \ ---set ocf-api-invocation-logs.env.vaultPort=$VAULT_PORT \ ---set ocf-api-invocation-logs.env.vaultAccessToken=$VAULT_ACCESS_TOKEN \ ---set ocf-api-invocation-logs.env.logLevel="DEBUG" \ ---set ocf-api-invoker-management.image.repository=$CAPIF_DOCKER_REGISTRY/ocf-api-invoker-management-api \ ---set ocf-api-invoker-management.image.tag=$CAPIF_IMAGE_TAG \ ---set ocf-api-invoker-management.env.monitoring="true" \ ---set ocf-api-invoker-management.env.capifHostname=$CAPIF_HOSTNAME \ ---set ocf-api-invoker-management.env.vaultHostname=$VAULT_INTERNAL_HOSTNAME \ ---set ocf-api-invoker-management.env.vaultPort=$VAULT_PORT \ ---set ocf-api-invoker-management.env.vaultAccessToken=$VAULT_ACCESS_TOKEN \ ---set ocf-api-invoker-management.env.logLevel="DEBUG" \ ---set ocf-api-provider-management.image.repository=$CAPIF_DOCKER_REGISTRY/ocf-api-provider-management-api \ ---set ocf-api-provider-management.image.tag=$CAPIF_IMAGE_TAG \ ---set ocf-api-provider-management.env.monitoring="true" \ ---set ocf-api-provider-management.env.capifHostname=$CAPIF_HOSTNAME \ ---set ocf-api-provider-management.env.vaultHostname=$VAULT_INTERNAL_HOSTNAME \ ---set ocf-api-provider-management.env.logLevel="DEBUG" \ ---set ocf-api-provider-management.env.vaultPort=$VAULT_PORT \ ---set ocf-api-provider-management.env.vaultAccessToken=$VAULT_ACCESS_TOKEN \ ---set ocf-events.image.repository=$CAPIF_DOCKER_REGISTRY/ocf-events-api \ ---set ocf-events.image.tag=$CAPIF_IMAGE_TAG \ ---set ocf-events.env.monitoring="true" \ ---set ocf-events.env.capifHostname=$CAPIF_HOSTNAME \ ---set ocf-events.env.logLevel="DEBUG" \ ---set ocf-routing-info.image.repository=$CAPIF_DOCKER_REGISTRY/ocf-routing-info-api \ ---set ocf-routing-info.image.tag=$CAPIF_IMAGE_TAG \ ---set ocf-routing-info.env.monitoring="true" \ ---set ocf-routing-info.env.logLevel="DEBUG" \ ---set ocf-security.image.repository=$CAPIF_DOCKER_REGISTRY/ocf-security-api \ ---set ocf-security.image.tag=$CAPIF_IMAGE_TAG \ ---set ocf-security.env.monitoring="true" \ ---set ocf-security.env.capifHostname=$CAPIF_HOSTNAME \ ---set ocf-security.env.vaultHostname=$VAULT_INTERNAL_HOSTNAME \ ---set ocf-security.env.vaultPort=$VAULT_PORT \ ---set ocf-security.env.vaultAccessToken=$VAULT_ACCESS_TOKEN \ ---set ocf-security.env.logLevel="DEBUG" \ ---set ocf-register.image.repository=$CAPIF_DOCKER_REGISTRY/register \ ---set ocf-register.image.tag=$CAPIF_IMAGE_TAG \ ---set ocf-register.env.vaultHostname=$VAULT_INTERNAL_HOSTNAME \ ---set ocf-register.env.vaultAccessToken=$VAULT_ACCESS_TOKEN \ ---set ocf-register.env.vaultPort=$VAULT_PORT \ ---set ocf-register.env.mongoHost=mongo-register \ ---set ocf-register.env.mongoPort=27017 \ ---set ocf-register.env.capifHostname=$CAPIF_HOSTNAME \ ---set ocf-register.ingress.enabled=true \ ---set ocf-register.ingress.hosts[0].host=$REGISTER_HOSTNAME \ ---set ocf-register.ingress.hosts[0].paths[0].path="/" \ ---set ocf-register.ingress.hosts[0].paths[0].pathType="Prefix" \ ---set ocf-register.env.logLevel="DEBUG" \ ---set ocf-register.extraConfigPod.hostAliases[0].hostnames[0]=$CAPIF_HOSTNAME \ ---set ocf-register.extraConfigPod.hostAliases[0].ip=$K8S_IP \ ---set ocf-auditing-api-logs.image.repository=$CAPIF_DOCKER_REGISTRY/ocf-auditing-api \ ---set ocf-auditing-api-logs.image.tag=$CAPIF_IMAGE_TAG \ ---set ocf-auditing-api-logs.env.monitoring="true" \ ---set ocf-auditing-api-logs.env.logLevel="DEBUG" \ ---set ocf-publish-service-api.image.repository=$CAPIF_DOCKER_REGISTRY/ocf-publish-service-api \ ---set ocf-publish-service-api.image.tag=$CAPIF_IMAGE_TAG \ ---set ocf-publish-service-api.env.monitoring="true" \ ---set ocf-publish-service-api.env.capifHostname=$CAPIF_HOSTNAME \ ---set ocf-publish-service-api.env.logLevel="DEBUG" \ ---set ocf-discover-service-api.image.repository=$CAPIF_DOCKER_REGISTRY/ocf-discover-service-api \ ---set ocf-discover-service-api.image.tag=$CAPIF_IMAGE_TAG \ ---set ocf-discover-service-api.env.monitoring="true" \ ---set ocf-discover-service-api.env.logLevel="DEBUG" \ ---set nginx.image.repository=$CAPIF_DOCKER_REGISTRY/nginx \ ---set nginx.image.tag=$CAPIF_IMAGE_TAG \ ---set nginx.env.capifHostname=$CAPIF_HOSTNAME \ ---set nginx.env.vaultHostname=$VAULT_INTERNAL_HOSTNAME \ ---set nginx.env.vaultPort=$VAULT_PORT \ ---set nginx.env.vaultAccessToken=$VAULT_ACCESS_TOKEN \ ---set nginx.ingress.enabled=true \ ---set nginx.ingress.hosts[0].host=$CAPIF_HOSTNAME \ ---set nginx.ingress.hosts[0].paths[0].path="/" \ ---set nginx.ingress.hosts[0].paths[0].pathType="Prefix" \ ---set nginx.env.logLevel="debug" \ ---set ocf-helper.image.repository=$CAPIF_DOCKER_REGISTRY/helper \ ---set ocf-helper.image.tag=$CAPIF_IMAGE_TAG \ ---set ocf-helper.env.vaultHostname=$VAULT_INTERNAL_HOSTNAME \ ---set ocf-helper.env.vaultPort=$VAULT_PORT \ ---set ocf-helper.env.vaultAccessToken=$VAULT_ACCESS_TOKEN \ ---set ocf-helper.env.capifHostname=$CAPIF_HOSTNAME \ ---set ocf-helper.env.logLevel="DEBUG" \ ---set mock-server.enabled=true \ ---set mock-server.image.repository=$CAPIF_DOCKER_REGISTRY/mock-server \ ---set mock-server.image.tag=$CAPIF_IMAGE_TAG \ ---set mock-server.ingress.enabled=true \ ---set mock-server.ingress.hosts[0].host=mock-server-$CAPIF_CI_ENV_ENDPOINT.$CAPIF_DOMAIN \ ---set mock-server.ingress.hosts[0].paths[0].path="/" \ ---set mock-server.ingress.hosts[0].paths[0].pathType="Prefix" \ ---set mock-server.env.logLevel="DEBUG" \ ---set mock-server.service.port=$MOCK_SERVER_PORT \ ---set mock-server.livenessProbe.tcpSocket.port=$MOCK_SERVER_PORT \ ---set mongo-register.persistence.storageClass=$CAPIF_STORAGE_CLASS \ ---set mongo-register.persistence.storage=$CAPIF_MONGO_REGISTER_STORAGE_SIZE \ ---set mongo-register.extraFlags[0]="--repair" \ ---set mongo-register-express.enabled=true \ ---set mongo-register-express.ingress.enabled=true \ ---set mongo-register-express.ingress.hosts[0].host="mongo-express-register-$CAPIF_CI_ENV_ENDPOINT.$CAPIF_DOMAIN" \ ---set mongo-register-express.ingress.hosts[0].paths[0].path="/" \ ---set mongo-register-express.ingress.hosts[0].paths[0].pathType="Prefix" \ ---set mongo.persistence.storageClass=$CAPIF_STORAGE_CLASS \ ---set mongo.persistence.storage=$CAPIF_MONGO_STORAGE_SIZE \ ---set mongo.extraFlags[0]="--repair" \ ---set mongo-express.enabled=true \ ---set mongo-express.ingress.enabled=true \ ---set mongo-express.ingress.hosts[0].host="mongo-express-$CAPIF_CI_ENV_ENDPOINT.$CAPIF_DOMAIN" \ ---set mongo-express.ingress.hosts[0].paths[0].path="/" \ ---set mongo-express.ingress.hosts[0].paths[0].pathType="Prefix" \ ---wait --timeout=10m --create-namespace --atomic $CAPIF_RESOURCES_RESERVE $CAPIF_STORAGE_ACCESS_MODE $CAPIF_RUN_AS_USER_CONFIG +install_capif_helm() { + local extra_args=("$@") + helm $KUBECONFIG upgrade --install -n $CAPIF_NAMESPACE $CAPIF_NAME_VERSION_CHART $HELM_DIR/capif/ \ + --set grafana.enabled=true \ + --set grafana.ingress.enabled=true \ + --set grafana.ingress.hosts[0].host=ocf-mon-$CAPIF_CI_ENV_ENDPOINT.$CAPIF_DOMAIN \ + --set grafana.ingress.hosts[0].paths[0].path="/" \ + --set grafana.ingress.hosts[0].paths[0].pathType="Prefix" \ + --set grafana.env.prometheusUrl=$PROMETHEUS_URL \ + --set grafana.env.tempoUrl="http://$CAPIF_NAME_VERSION_CHART-tempo:3100" \ + --set grafana.persistence.storageClass=$CAPIF_STORAGE_CLASS \ + --set grafana.persistence.storage=$CAPIF_GRAFANA_STORAGE_SIZE \ + --set fluentbit.enabled=true \ + --set loki.enabled=true \ + --set loki.persistence.storageClass=$CAPIF_STORAGE_CLASS \ + --set loki.persistence.storage=$CAPIF_LOKI_STORAGE_SIZE \ + --set tempo.tempo.metricsGenerator.remoteWriteUrl=$PROMETHEUS_URL/api/v1/write \ + --set tempo.persistence.size=$CAPIF_TEMPO_STORAGE_SIZE \ + --set otelcollector.enabled=true \ + --set otelcollector.configMap.tempoEndpoint=$CAPIF_NAME_VERSION_CHART-tempo:4317 \ + --set ocf-access-control-policy.image.repository=$CAPIF_DOCKER_REGISTRY/ocf-access-control-policy-api \ + --set ocf-access-control-policy.image.tag=$CAPIF_IMAGE_TAG \ + --set ocf-access-control-policy.image.env.capifHostname=$CAPIF_HOSTNAME \ + --set ocf-access-control-policy.monitoring="true" \ + --set ocf-access-control-policy.env.logLevel="$LOG_LEVEL" \ + --set ocf-api-invocation-logs.image.repository=$CAPIF_DOCKER_REGISTRY/ocf-logging-api-invocation-api \ + --set ocf-api-invocation-logs.image.tag=$CAPIF_IMAGE_TAG \ + --set ocf-api-invocation-logs.env.monitoring="true" \ + --set ocf-api-invocation-logs.env.capifHostname=$CAPIF_HOSTNAME \ + --set ocf-api-invocation-logs.env.vaultHostname=$VAULT_INTERNAL_HOSTNAME \ + --set ocf-api-invocation-logs.env.vaultPort=$VAULT_PORT \ + --set ocf-api-invocation-logs.env.vaultAccessToken=$VAULT_ACCESS_TOKEN \ + --set ocf-api-invocation-logs.env.logLevel="$LOG_LEVEL" \ + --set ocf-api-invoker-management.image.repository=$CAPIF_DOCKER_REGISTRY/ocf-api-invoker-management-api \ + --set ocf-api-invoker-management.image.tag=$CAPIF_IMAGE_TAG \ + --set ocf-api-invoker-management.env.monitoring="true" \ + --set ocf-api-invoker-management.env.capifHostname=$CAPIF_HOSTNAME \ + --set ocf-api-invoker-management.env.vaultHostname=$VAULT_INTERNAL_HOSTNAME \ + --set ocf-api-invoker-management.env.vaultPort=$VAULT_PORT \ + --set ocf-api-invoker-management.env.vaultAccessToken=$VAULT_ACCESS_TOKEN \ + --set ocf-api-invoker-management.env.logLevel="$LOG_LEVEL" \ + --set ocf-api-provider-management.image.repository=$CAPIF_DOCKER_REGISTRY/ocf-api-provider-management-api \ + --set ocf-api-provider-management.image.tag=$CAPIF_IMAGE_TAG \ + --set ocf-api-provider-management.env.monitoring="true" \ + --set ocf-api-provider-management.env.capifHostname=$CAPIF_HOSTNAME \ + --set ocf-api-provider-management.env.vaultHostname=$VAULT_INTERNAL_HOSTNAME \ + --set ocf-api-provider-management.env.logLevel="$LOG_LEVEL" \ + --set ocf-api-provider-management.env.vaultPort=$VAULT_PORT \ + --set ocf-api-provider-management.env.vaultAccessToken=$VAULT_ACCESS_TOKEN \ + --set ocf-events.image.repository=$CAPIF_DOCKER_REGISTRY/ocf-events-api \ + --set ocf-events.image.tag=$CAPIF_IMAGE_TAG \ + --set ocf-events.env.monitoring="true" \ + --set ocf-events.env.capifHostname=$CAPIF_HOSTNAME \ + --set ocf-events.env.logLevel="$LOG_LEVEL" \ + --set ocf-routing-info.image.repository=$CAPIF_DOCKER_REGISTRY/ocf-routing-info-api \ + --set ocf-routing-info.image.tag=$CAPIF_IMAGE_TAG \ + --set ocf-routing-info.env.monitoring="true" \ + --set ocf-routing-info.env.logLevel="$LOG_LEVEL" \ + --set ocf-security.image.repository=$CAPIF_DOCKER_REGISTRY/ocf-security-api \ + --set ocf-security.image.tag=$CAPIF_IMAGE_TAG \ + --set ocf-security.env.monitoring="true" \ + --set ocf-security.env.capifHostname=$CAPIF_HOSTNAME \ + --set ocf-security.env.vaultHostname=$VAULT_INTERNAL_HOSTNAME \ + --set ocf-security.env.vaultPort=$VAULT_PORT \ + --set ocf-security.env.vaultAccessToken=$VAULT_ACCESS_TOKEN \ + --set ocf-security.env.logLevel="$LOG_LEVEL" \ + --set ocf-register.image.repository=$CAPIF_DOCKER_REGISTRY/register \ + --set ocf-register.image.tag=$CAPIF_IMAGE_TAG \ + --set ocf-register.env.registerHostname=$REGISTER_HOSTNAME \ + --set ocf-register.env.vaultHostname=$VAULT_INTERNAL_HOSTNAME \ + --set ocf-register.env.vaultAccessToken=$VAULT_ACCESS_TOKEN \ + --set ocf-register.env.vaultPort=$VAULT_PORT \ + --set ocf-register.env.mongoHost=mongo-register \ + --set ocf-register.env.mongoPort=27017 \ + --set ocf-register.env.capifHostname=$CAPIF_HOSTNAME \ + --set ocf-register.ingress.enabled=true \ + --set ocf-register.ingress.hosts[0].host=$REGISTER_HOSTNAME \ + --set ocf-register.ingress.hosts[0].paths[0].path="/" \ + --set ocf-register.ingress.hosts[0].paths[0].pathType="Prefix" \ + --set ocf-register.env.logLevel="$LOG_LEVEL" \ + --set ocf-register.extraConfigPod.hostAliases[0].hostnames[0]=$CAPIF_HOSTNAME \ + --set ocf-register.extraConfigPod.hostAliases[0].ip=$K8S_IP \ + --set ocf-auditing-api-logs.image.repository=$CAPIF_DOCKER_REGISTRY/ocf-auditing-api \ + --set ocf-auditing-api-logs.image.tag=$CAPIF_IMAGE_TAG \ + --set ocf-auditing-api-logs.env.monitoring="true" \ + --set ocf-auditing-api-logs.env.logLevel="$LOG_LEVEL" \ + --set ocf-publish-service-api.image.repository=$CAPIF_DOCKER_REGISTRY/ocf-publish-service-api \ + --set ocf-publish-service-api.image.tag=$CAPIF_IMAGE_TAG \ + --set ocf-publish-service-api.env.monitoring="true" \ + --set ocf-publish-service-api.env.capifHostname=$CAPIF_HOSTNAME \ + --set ocf-publish-service-api.env.logLevel="$LOG_LEVEL" \ + --set ocf-discover-service-api.image.repository=$CAPIF_DOCKER_REGISTRY/ocf-discover-service-api \ + --set ocf-discover-service-api.image.tag=$CAPIF_IMAGE_TAG \ + --set ocf-discover-service-api.env.monitoring="true" \ + --set ocf-discover-service-api.env.logLevel="$LOG_LEVEL" \ + --set nginx.image.repository=$CAPIF_DOCKER_REGISTRY/nginx \ + --set nginx.image.tag=$CAPIF_IMAGE_TAG \ + --set nginx.env.capifHostname=$CAPIF_HOSTNAME \ + --set nginx.env.vaultHostname=$VAULT_INTERNAL_HOSTNAME \ + --set nginx.env.vaultPort=$VAULT_PORT \ + --set nginx.env.vaultAccessToken=$VAULT_ACCESS_TOKEN \ + --set nginx.ingress.enabled=true \ + --set nginx.ingress.hosts[0].host=$CAPIF_HOSTNAME \ + --set nginx.ingress.hosts[0].paths[0].path="/" \ + --set nginx.ingress.hosts[0].paths[0].pathType="Prefix" \ + --set nginx.env.logLevel="$LOG_LEVEL" \ + --set ocf-helper.image.repository=$CAPIF_DOCKER_REGISTRY/helper \ + --set ocf-helper.image.tag=$CAPIF_IMAGE_TAG \ + --set ocf-helper.env.vaultHostname=$VAULT_INTERNAL_HOSTNAME \ + --set ocf-helper.env.vaultPort=$VAULT_PORT \ + --set ocf-helper.env.vaultAccessToken=$VAULT_ACCESS_TOKEN \ + --set ocf-helper.env.capifHostname=$CAPIF_HOSTNAME \ + --set ocf-helper.env.logLevel="$LOG_LEVEL" \ + --set mock-server.enabled=true \ + --set mock-server.image.repository=$CAPIF_DOCKER_REGISTRY/mock-server \ + --set mock-server.image.tag=$CAPIF_IMAGE_TAG \ + --set mock-server.ingress.enabled=true \ + --set mock-server.ingress.hosts[0].host=mock-server-$CAPIF_CI_ENV_ENDPOINT.$CAPIF_DOMAIN \ + --set mock-server.ingress.hosts[0].paths[0].path="/" \ + --set mock-server.ingress.hosts[0].paths[0].pathType="Prefix" \ + --set mock-server.env.logLevel="$LOG_LEVEL" \ + --set mock-server.service.port=$MOCK_SERVER_PORT \ + --set mock-server.livenessProbe.tcpSocket.port=$MOCK_SERVER_PORT \ + --set mongo-register.image.repository=$BASE_DOCKER_REGISTRY/mongo \ + --set mongo-register.image.tag=6.0.2 \ + --set mongo-register.persistence.storageClass=$CAPIF_STORAGE_CLASS \ + --set mongo-register.persistence.storage=$CAPIF_MONGO_REGISTER_STORAGE_SIZE \ + --set mongo-register.extraFlags[0]="--repair" \ + --set mongo-register-express.enabled=true \ + --set mongo-register-express.ingress.enabled=true \ + --set mongo-register-express.ingress.hosts[0].host="mongo-express-register-$CAPIF_CI_ENV_ENDPOINT.$CAPIF_DOMAIN" \ + --set mongo-register-express.ingress.hosts[0].paths[0].path="/" \ + --set mongo-register-express.ingress.hosts[0].paths[0].pathType="Prefix" \ + --set mongo.persistence.storageClass=$CAPIF_STORAGE_CLASS \ + --set mongo.persistence.storage=$CAPIF_MONGO_STORAGE_SIZE \ + --set mongo.extraFlags[0]="--repair" \ + --set mongo.image.repository=$BASE_DOCKER_REGISTRY/mongo \ + --set mongo.image.tag=6.0.2 \ + --set mongo.busybox.repository=$BASE_DOCKER_REGISTRY/busybox \ + --set mongo.busybox.tag=1.37.0 \ + --set mongo-express.enabled=true \ + --set mongo-express.ingress.enabled=true \ + --set mongo-express.ingress.hosts[0].host="mongo-express-$CAPIF_CI_ENV_ENDPOINT.$CAPIF_DOMAIN" \ + --set mongo-express.ingress.hosts[0].paths[0].path="/" \ + --set mongo-express.ingress.hosts[0].paths[0].pathType="Prefix" \ + --set redis.image.repository=$BASE_DOCKER_REGISTRY/redis \ + --set redis.image.tag=7.4.2-alpine \ + --set celery-beat.image.repository=$CAPIF_DOCKER_REGISTRY/celery \ + --set celery-beat.image.tag=$CAPIF_IMAGE_TAG \ + --set celery-beat.env.celeryModel=beat \ + --set celery-beat.env.redisHost=redis \ + --set celery-beat.env.redisPort=6379 \ + --set celery-beat.env.logLevel="$LOG_LEVEL" \ + --set celery-worker.image.repository=$CAPIF_DOCKER_REGISTRY/celery \ + --set celery-worker.image.tag=$CAPIF_IMAGE_TAG \ + --set celery-worker.env.celeryModel=worker \ + --set celery-worker.env.redisHost=redis \ + --set celery-worker.env.redisPort=6379 \ + --set celery-worker.env.logLevel="$LOG_LEVEL" \ + --wait --timeout=10m --create-namespace --atomic $CAPIF_RESOURCES_RESERVE $CAPIF_STORAGE_ACCESS_MODE $CAPIF_RUN_AS_USER_CONFIG "${extra_args[@]}" +} + +install_capif_helm diff --git a/helm/scripts/install_monitoring.sh b/helm/scripts/install_monitoring.sh index 9d6a00f370ad1fb9a02047365e2d45d221e68e92..9f201ccf927218832cfab18e1d9bd93235764219 100755 --- a/helm/scripts/install_monitoring.sh +++ b/helm/scripts/install_monitoring.sh @@ -1,5 +1,14 @@ #!/bin/bash -source $(dirname "$(readlink -f "$0")")/variables.sh + +# Capture the first parameter as a possible environment +ENVIRONMENT="dev" +if [[ "$1" != -* && -n "$1" ]]; then + ENVIRONMENT="$1" + shift +fi + +# Load variables for the selected environment +source "$(dirname "$0")/variables.sh" "$ENVIRONMENT" helm repo add bitnami https://charts.bitnami.com/bitnami helm repo add grafana https://grafana.github.io/helm-charts @@ -7,13 +16,21 @@ helm repo add grafana https://grafana.github.io/helm-charts helm $KUBECONFIG dependency build $HELM_DIR/monitoring-stack/ helm $KUBECONFIG upgrade --install -n $MONITORING_NAMESPACE $MONITORING_SERVICE_NAME $HELM_DIR/monitoring-stack/ \ ---set grafana.enabled=false \ +--set grafana.enabled=$MONITORING_GRAFANA_ENABLED \ --set grafana.env.prometheusUrl=$PROMETHEUS_URL \ ---set prometheus.enabled=true \ +--set grafana.ingress.enabled=true \ +--set grafana.ingress.hosts[0].host=$GRAFANA_HOSTNAME \ +--set grafana.ingress.hosts[0].paths[0].path="/" \ +--set grafana.ingress.hosts[0].paths[0].pathType="Prefix" \ +--set prometheus.enabled=$MONITORING_PROMETHEUS_ENABLED \ --set prometheus.ingress.enabled=true \ --set prometheus.ingress.hosts[0].host=$PROMETHEUS_HOSTNAME \ --set prometheus.ingress.hosts[0].paths[0].path="/" \ --set prometheus.ingress.hosts[0].paths[0].pathType="Prefix" \ --set skooner.enabled=$MONITORING_SNOOKER_ENABLED \ +--set skooner.ingress.enabled=true \ +--set skooner.ingress.hosts[0].host=$SKOONER_HOSTNAME \ +--set skooner.ingress.hosts[0].paths[0].path="/" \ +--set skooner.ingress.hosts[0].paths[0].pathType="Prefix" \ --wait --timeout=10m --create-namespace --atomic diff --git a/helm/scripts/install_vault.sh b/helm/scripts/install_vault.sh index 971d520044b8ace5428fa19172b0b3e865099959..c9fb249e76f8264275b83e316e201018f1ee9cf0 100755 --- a/helm/scripts/install_vault.sh +++ b/helm/scripts/install_vault.sh @@ -1,5 +1,14 @@ #!/bin/bash -source $(dirname "$(readlink -f "$0")")/variables.sh + +# Capture the first parameter as a possible environment +ENVIRONMENT="dev" +if [[ "$1" != -* && -n "$1" ]]; then + ENVIRONMENT="$1" + shift +fi + +# Load variables for the selected environment +source "$(dirname "$0")/variables.sh" "$ENVIRONMENT" # Function to get the service status get_service_status() { @@ -123,7 +132,7 @@ while true; do if [ "$FAILED_JOB_STATUS" != "" ]; then echo "The vault job fails, check variables." exit -1 - elif [ "$SUCCEEDED_JOB_STATUS" != "" ] && (( SUCCEEDED_JOB_STATUS > 0 )) && [ "$COMPLETED_TYPE_JOB_STATUS" == "Complete" ] && [ "$COMPLETION_JOB_STATUS" == "True" ]; then + elif [ "$SUCCEEDED_JOB_STATUS" != "" ] && (( SUCCEEDED_JOB_STATUS > 0 )) && { [ "$COMPLETED_TYPE_JOB_STATUS" == "Complete" ] || [ "$COMPLETED_TYPE_JOB_STATUS" == "SuccessCriteriaMet" ]; } && [ "$COMPLETION_JOB_STATUS" == "True" ]; then echo "The vault job succeeded." break else diff --git a/helm/scripts/populate_create_remote_dummy_users.sh b/helm/scripts/populate_create_remote_dummy_users.sh index 3243db82bb52d55c481ac9bc92389e67742d9937..2c7dbfbe55de9ec5eddcfdac4585cf6a2b5cd3ff 100755 --- a/helm/scripts/populate_create_remote_dummy_users.sh +++ b/helm/scripts/populate_create_remote_dummy_users.sh @@ -1,15 +1,33 @@ #!/bin/bash -source $(dirname "$(readlink -f "$0")")/variables.sh + +# Capture the first parameter as a possible environment +ENVIRONMENT="dev" +if [[ "$1" != -* && -n "$1" ]]; then + ENVIRONMENT="$1" + shift +fi + +# Load variables for the selected environment +source "$(dirname "$0")/variables.sh" "$ENVIRONMENT" # Populate variables TOTAL_INVOKERS=10 TOTAL_PROVIDERS=10 help() { - echo "Usage: $1 " - echo " -p : Total providers to create (default 10)" - echo " -i : Total providers to create (default 10)" - echo " -h : show this help" + echo "Usage: $0 [environment] [options]" + echo "" + echo " environment Optional. Environment name to use (e.g. dev, prod)." + echo " If not specified, 'dev' will be used by default." + echo "" + echo "Options:" + echo " -p Total providers to create (default: 10)" + echo " -i Total invokers to create (default: 10)" + echo " -h Show this help message" + echo "" + echo "Examples:" + echo " $0 prod -p 20 -i 15" + echo " $0 -p 5" exit 1 } @@ -122,4 +140,6 @@ docker run -ti --rm --network="host" \ --variable MOCK_SERVER_URL:$MOCK_SERVER_URL \ --variable TOTAL_PROVIDERS:$TOTAL_PROVIDERS \ --variable TOTAL_INVOKERS:$TOTAL_INVOKERS \ + --variable REGISTER_ADMIN_USER:$REGISTER_ADMIN_USER \ + --variable REGISTER_ADMIN_PASSWORD:$REGISTER_ADMIN_PASSWORD \ --include populate-create diff --git a/helm/scripts/populate_remove_remote_dummy_users.sh b/helm/scripts/populate_remove_remote_dummy_users.sh index 7847525ef7004e37789866e30947f2f27358b2bf..8c55005f844f12200f7dcb2da9dbffa1f65af458 100755 --- a/helm/scripts/populate_remove_remote_dummy_users.sh +++ b/helm/scripts/populate_remove_remote_dummy_users.sh @@ -1,10 +1,29 @@ #!/bin/bash -source $(dirname "$(readlink -f "$0")")/variables.sh + +# Capture the first parameter as a possible environment +ENVIRONMENT="dev" +if [[ "$1" != -* && -n "$1" ]]; then + ENVIRONMENT="$1" + shift +fi + +# Load variables for the selected environment +source "$(dirname "$0")/variables.sh" "$ENVIRONMENT" help() { - echo "Usage: $1 " - echo "Removes all dummy users populated, stored on latest zip file on results" - echo " -h : show this help" + echo "Usage: $0 [environment] [options]" + echo "" + echo " environment Optional. Environment name to use (e.g. dev, prod)." + echo " If not specified, 'dev' will be used by default." + echo "" + echo "Options:" + echo " -h Show this help message" + echo "" + echo "Removes all dummy users populated, stored on latest zip file in results." + echo "" + echo "Examples:" + echo " $0 prod" + echo " $0" exit 1 } @@ -109,4 +128,6 @@ docker run -ti --rm --network="host" \ --variable CAPIF_VAULT_TOKEN:$CAPIF_VAULT_TOKEN \ --variable NOTIFICATION_DESTINATION_URL:$NOTIFICATION_DESTINATION_URL \ --variable MOCK_SERVER_URL:$MOCK_SERVER_URL \ + --variable REGISTER_ADMIN_USER:$REGISTER_ADMIN_USER \ + --variable REGISTER_ADMIN_PASSWORD:$REGISTER_ADMIN_PASSWORD \ --include populate-remove diff --git a/helm/scripts/remove_remote_users.sh b/helm/scripts/remove_remote_users.sh index dc6fa7620590aabca3fbeb11384a2f48d85735a7..ad9b89f6db4a9e966f24f74a7ec6fcd1ce2270f4 100755 --- a/helm/scripts/remove_remote_users.sh +++ b/helm/scripts/remove_remote_users.sh @@ -1,13 +1,31 @@ #!/bin/bash -source $(dirname "$(readlink -f "$0")")/variables.sh + +# Capture the first parameter as a possible environment +ENVIRONMENT="dev" +if [[ "$1" != -* && -n "$1" ]]; then + ENVIRONMENT="$1" + shift +fi + +# Load variables for the selected environment +source "$(dirname "$0")/variables.sh" "$ENVIRONMENT" # User to remove USERNAME_PREFIX= help() { - echo "Usage: $1 " - echo " -u : User prefix to use" - echo " -h : show this help" + echo "Usage: $0 [environment] [options]" + echo "" + echo " environment Optional. Environment name to use (e.g. dev, prod)." + echo " If not specified, 'dev' will be used by default." + echo "" + echo "Options:" + echo " -u User prefix to use (required)" + echo " -h Show this help message" + echo "" + echo "Examples:" + echo " $0 prod -u testuser" + echo " $0 -u testuser" exit 1 } @@ -123,4 +141,6 @@ docker run -ti --rm --network="host" \ --variable NOTIFICATION_DESTINATION_URL:$NOTIFICATION_DESTINATION_URL \ --variable MOCK_SERVER_URL:$MOCK_SERVER_URL \ --variable USERNAME_PREFIX:$USERNAME_PREFIX \ + --variable REGISTER_ADMIN_USER:$REGISTER_ADMIN_USER \ + --variable REGISTER_ADMIN_PASSWORD:$REGISTER_ADMIN_PASSWORD \ --include remove-users diff --git a/helm/scripts/remove_remote_users_by_prefix.sh b/helm/scripts/remove_remote_users_by_prefix.sh index 003d694feec94cb1038ebdd5f3cd61370960a3d0..ccc2ded6d0c7a69ca32878a9f08f025fa79a100c 100755 --- a/helm/scripts/remove_remote_users_by_prefix.sh +++ b/helm/scripts/remove_remote_users_by_prefix.sh @@ -1,13 +1,31 @@ #!/bin/bash -source $(dirname "$(readlink -f "$0")")/variables.sh + +# Capture the first parameter as a possible environment +ENVIRONMENT="dev" +if [[ "$1" != -* && -n "$1" ]]; then + ENVIRONMENT="$1" + shift +fi + +# Load variables for the selected environment +source "$(dirname "$0")/variables.sh" "$ENVIRONMENT" # User to remove USERNAME_PREFIX= help() { - echo "Usage: $1 " - echo " -u : User prefix to use" - echo " -h : show this help" + echo "Usage: $0 [environment] [options]" + echo "" + echo " environment Optional. Environment name to use (e.g. dev, prod)." + echo " If not specified, 'dev' will be used by default." + echo "" + echo "Options:" + echo " -u User prefix to use (required)" + echo " -h Show this help message" + echo "" + echo "Examples:" + echo " $0 prod -u testuser" + echo " $0 -u testuser" exit 1 } @@ -123,4 +141,6 @@ docker run -ti --rm --network="host" \ --variable NOTIFICATION_DESTINATION_URL:$NOTIFICATION_DESTINATION_URL \ --variable MOCK_SERVER_URL:$MOCK_SERVER_URL \ --variable USERNAME_PREFIX:$USERNAME_PREFIX \ + --variable REGISTER_ADMIN_USER:$REGISTER_ADMIN_USER \ + --variable REGISTER_ADMIN_PASSWORD:$REGISTER_ADMIN_PASSWORD \ --include remove-users-by-prefix diff --git a/helm/scripts/run_remote_capif_tests.sh b/helm/scripts/run_remote_capif_tests.sh index 38b7e807399963c8bb2b5be342cee4c56c6d8693..086f2a8ba618543efda903d3e9b63b104c15092b 100755 --- a/helm/scripts/run_remote_capif_tests.sh +++ b/helm/scripts/run_remote_capif_tests.sh @@ -1,5 +1,14 @@ #!/bin/bash -source $(dirname "$(readlink -f "$0")")/variables.sh + +# Capture the first parameter as a possible environment +ENVIRONMENT="dev" +if [[ "$1" != -* && -n "$1" ]]; then + ENVIRONMENT="$1" + shift +fi + +# Load variables for the selected environment +source "$(dirname "$0")/variables.sh" "$ENVIRONMENT" DOCKER_ROBOT_IMAGE=labs.etsi.org:5050/ocf/capif/robot-tests-image DOCKER_ROBOT_IMAGE_VERSION=1.0 @@ -37,6 +46,7 @@ echo "CAPIF_VAULT_PORT = $VAULT_PORT" echo "CAPIF_VAULT_TOKEN = $VAULT_ACCESS_TOKEN" echo "MOCK_SERVER_URL = $MOCK_SERVER_URL" echo "DOCKER_ROBOT_IMAGE = $DOCKER_ROBOT_IMAGE:$DOCKER_ROBOT_IMAGE_VERSION" +echo "REGISTER_ADMIN_PASSWORD = $REGISTER_ADMIN_PASSWORD" INPUT_OPTIONS=$@ # Check if input is provided @@ -83,4 +93,6 @@ docker run -ti --rm --network="host" \ --variable CAPIF_VAULT_PORT:$CAPIF_VAULT_PORT \ --variable CAPIF_VAULT_TOKEN:$CAPIF_VAULT_TOKEN \ --variable NOTIFICATION_DESTINATION_URL:$NOTIFICATION_DESTINATION_URL \ - --variable MOCK_SERVER_URL:$MOCK_SERVER_URL $INPUT_OPTIONS + --variable MOCK_SERVER_URL:$MOCK_SERVER_URL \ + --variable REGISTER_ADMIN_USER:$REGISTER_ADMIN_USER \ + --variable REGISTER_ADMIN_PASSWORD:$REGISTER_ADMIN_PASSWORD $INPUT_OPTIONS diff --git a/helm/scripts/set_ingress.sh b/helm/scripts/set_ingress.sh index 7f4034776503a82d3fd883ebb073f024831aa22e..4aa8dbb4b9341b6a595949d759f785cb49cc3762 100755 --- a/helm/scripts/set_ingress.sh +++ b/helm/scripts/set_ingress.sh @@ -1,14 +1,32 @@ #!/bin/bash IP="" NAMESPACE="" -source $(dirname "$(readlink -f "$0")")/variables.sh + +# Capture the first parameter as a possible environment +ENVIRONMENT="dev" +if [[ "$1" != -* && -n "$1" ]]; then + ENVIRONMENT="$1" + shift +fi + +# Load variables for the selected environment +source "$(dirname "$0")/variables.sh" "$ENVIRONMENT" help() { - echo "Usage: $1 " - echo " -i : IP to use" - echo " -n : Namespace to get ingress information" - echo " -k : Kubeconfig to be used" - echo " -h : show this help" + echo "Usage: $0 [environment] [options]" + echo "" + echo " environment Optional. Environment name to use (e.g. dev, prod)." + echo " If not specified, 'dev' will be used by default." + echo "" + echo "Options:" + echo " -i IP to use" + echo " -n Namespace to get ingress information" + echo " -k Kubeconfig to be used" + echo " -h Show this help message" + echo "" + echo "Examples:" + echo " $0 prod -i 10.0.0.1 -n mynamespace" + echo " $0 -n mynamespace" exit 1 } # Read params diff --git a/helm/scripts/uninstall_capif.sh b/helm/scripts/uninstall_capif.sh index bacd0e0f2a1a6c31b978c6d17847221e069125c3..afb7aabd5f4f850302061901c3d415bc23c0a835 100755 --- a/helm/scripts/uninstall_capif.sh +++ b/helm/scripts/uninstall_capif.sh @@ -1,10 +1,28 @@ #!/bin/bash -source $(dirname "$(readlink -f "$0")")/variables.sh + +# Capture the first parameter as a possible environment +ENVIRONMENT="dev" +if [[ "$1" != -* && -n "$1" ]]; then + ENVIRONMENT="$1" + shift +fi + +# Load variables for the selected environment +source "$(dirname "$0")/variables.sh" "$ENVIRONMENT" help() { - echo "Usage: $1 " - echo " -y : Force uninstall component" - echo " -h : show this help" + echo "Usage: $0 [environment] [options]" + echo "" + echo " environment Optional. Environment name to use (e.g. dev, prod)." + echo " If not specified, 'dev' will be used by default." + echo "" + echo "Options:" + echo " -y Force uninstall component" + echo " -h Show this help message" + echo "" + echo "Examples:" + echo " $0 prod -y" + echo " $0" exit 1 } diff --git a/helm/scripts/uninstall_monitoring.sh b/helm/scripts/uninstall_monitoring.sh index aff1706b20e584e11ae4b29f4c2c9e8ad6fc2280..8599dc0ed65c02327ecccd02b4c04509d48bb528 100755 --- a/helm/scripts/uninstall_monitoring.sh +++ b/helm/scripts/uninstall_monitoring.sh @@ -1,10 +1,28 @@ #!/bin/bash -source $(dirname "$(readlink -f "$0")")/variables.sh + +# Capture the first parameter as a possible environment +ENVIRONMENT="dev" +if [[ "$1" != -* && -n "$1" ]]; then + ENVIRONMENT="$1" + shift +fi + +# Load variables for the selected environment +source "$(dirname "$0")/variables.sh" "$ENVIRONMENT" help() { - echo "Usage: $1 " - echo " -y : Force uninstall component" - echo " -h : show this help" + echo "Usage: $0 [environment] [options]" + echo "" + echo " environment Optional. Environment name to use (e.g. dev, prod)." + echo " If not specified, 'dev' will be used by default." + echo "" + echo "Options:" + echo " -y Force uninstall component" + echo " -h Show this help message" + echo "" + echo "Examples:" + echo " $0 prod -y" + echo " $0" exit 1 } diff --git a/helm/scripts/uninstall_vault.sh b/helm/scripts/uninstall_vault.sh index cb9535f67569aedb36052cbef522fb8232268ede..3834c1ed7f2c3f6a7a50ea9065321f38b6a72e7c 100755 --- a/helm/scripts/uninstall_vault.sh +++ b/helm/scripts/uninstall_vault.sh @@ -1,10 +1,28 @@ #!/bin/bash -source $(dirname "$(readlink -f "$0")")/variables.sh + +# Capture the first parameter as a possible environment +ENVIRONMENT="dev" +if [[ "$1" != -* && -n "$1" ]]; then + ENVIRONMENT="$1" + shift +fi + +# Load variables for the selected environment +source "$(dirname "$0")/variables.sh" "$ENVIRONMENT" help() { - echo "Usage: $1 " - echo " -y : Force uninstall component" - echo " -h : show this help" + echo "Usage: $0 [environment] [options]" + echo "" + echo " environment Optional. Environment name to use (e.g. dev, prod)." + echo " If not specified, 'dev' will be used by default." + echo "" + echo "Options:" + echo " -y Force uninstall component" + echo " -h Show this help message" + echo "" + echo "Examples:" + echo " $0 prod -y" + echo " $0" exit 1 } diff --git a/helm/scripts/variables.sh b/helm/scripts/variables.sh index 2abf7de3400a54b52719fe3c144d006eddbef0fd..26e4c71114426ac0c94b64b4a962c9afff848d1f 100755 --- a/helm/scripts/variables.sh +++ b/helm/scripts/variables.sh @@ -25,6 +25,15 @@ export SCRIPTS_DIR=$(dirname "$(readlink -f "$0")") export HELM_DIR=$(dirname "$SCRIPTS_DIR") export CAPIF_BASE_DIR=$(dirname "$HELM_DIR") +# Docker registry to be used in deployment +export BASE_DOCKER_REGISTRY="labs.etsi.org:5050/ocf/capif" +# Common Configurations +## Log level to be used in deployment [CRITICAL, FATAL, ERROR, WARNING, WARN, INFO, DEBUG, NOTSET] +export LOG_LEVEL=DEBUG +## Register admin user and password to be used on testing +export REGISTER_ADMIN_USER='admin' +export REGISTER_ADMIN_PASSWORD='password123' + # Print scripts directory echo "The /helm/scripts directory is: $SCRIPTS_DIR" echo "The /helm directory is: $HELM_DIR" @@ -53,9 +62,15 @@ VAULT_JOB_NAME=vault-pki # Monitoring installation variables ## Prometheus Hostname to be used at ingress configuration export PROMETHEUS_HOSTNAME=prometheus.testbed.develop +export SKOONER_HOSTNAME=skooner.testbed.develop +export GRAFANA_HOSTNAME=grafana.testbed.develop +## Monitoring namespace and service name export MONITORING_NAMESPACE=monitoring export MONITORING_SERVICE_NAME=monitoring +## Monitoring Services enabled export MONITORING_SNOOKER_ENABLED=false +export MONITORING_GRAFANA_ENABLED=false +export MONITORING_PROMETHEUS_ENABLED=true # OpenCAPIF deployment variables export CAPIF_RESOURCES_RESERVE="YES" @@ -85,7 +100,7 @@ export CAPIF_CI_ENV_ENDPOINT=capif export CAPIF_DOMAIN=testbed.develop ## Configuration of images to be used on deplyment ### Docker Registry to download images (must be accesible by k8s cluster) -export CAPIF_DOCKER_REGISTRY="labs.etsi.org:5050/ocf/capif/prod" +export CAPIF_DOCKER_REGISTRY="$BASE_DOCKER_REGISTRY/prod" ### Tag to be used export CAPIF_IMAGE_TAG="v1.0.0-release" ## Prometheus url, usually internal k8s hostname (if capif will be deployed on same k8s cluster) with port 9090 @@ -97,6 +112,34 @@ export VAULT_ACCESS_TOKEN="dev-only-token" ## Only for testing purpouses, configuration of mock-server port export MOCK_SERVER_PORT="9100" +# special configuration for capif deployment + +## Setup KUBECONFIG +export KUBECONFIG=$CUSTOM_KUBECONFIG + +## If CAPIF_STORAGE_CLASS is longhorn, then we need to set runAsUser to 0 in some deployments to allow write on PVC +export CAPIF_RUN_AS_USER_CONFIG="" + +## SED command, in MacOS sed is different and need gnu-sed (gsed) +export SED_CMD=sed + +# Load environment variables from file +## Directory for environment variables +ENV_DIR="$SCRIPTS_DIR/envs" + +## Environment selection (default: dev) +ENVIRONMENT="${1:-dev}" +ENV_FILE="$ENV_DIR/$ENVIRONMENT.env" + +if [ -f "$ENV_FILE" ]; then + echo "Loading environment configuration: $ENVIRONMENT" + set -a + source "$ENV_FILE" + set +a +else + echo "Environment file not found: $ENV_FILE. Using default values." +fi + ######### POST PROCESSING VARIABLES SET ######## ### To deploy in other environment we need to setup urls according to it and also using specific kubeconfig: if [ -f "$VAULT_FILE" ] && [ -s "$VAULT_FILE" ]; then @@ -107,8 +150,7 @@ else fi echo "Using value on VAULT_ACCESS_TOKEN=$VAULT_ACCESS_TOKEN" -## Setup KUBECONFIG -export KUBECONFIG=$CUSTOM_KUBECONFIG + ### If K8S_IP is empty, then script will try to get ingress-nginx-controller NodePort to grant DNS resolution for register to connect locally to CAPIF nginx if [ "$K8S_IP" == "NONE" ]; then @@ -151,7 +193,7 @@ if [ -n "$CAPIF_STORAGE_ACCESS_MODE" ]; then " fi -export CAPIF_RUN_AS_USER_CONFIG="" + if [ "$CAPIF_STORAGE_CLASS" == "longhorn" ]; then echo "$CAPIF_STORAGE_CLASS needs to configure runAsUser at mongo, mongo-register and grafana to 0, in order to allow write con PVC created." CAPIF_RUN_AS_USER_CONFIG="--set mongo.securityContext.runAsUser=0 @@ -159,7 +201,7 @@ if [ "$CAPIF_STORAGE_CLASS" == "longhorn" ]; then --set grafana.securityContext.runAsUser=0" fi -export SED_CMD=sed + if [[ "$OSTYPE" == "darwin"* ]]; then # Require gnu-sed. if ! [ -x "$(command -v gsed)" ]; then @@ -186,4 +228,6 @@ else --set $service.resources.requests.cpu=$CAPIF_RESOURCES_REQUESTS_CPU --set $service.resources.requests.memory=$CAPIF_RESOURCES_REQUESTS_MEMORY " done -fi \ No newline at end of file +fi + + diff --git a/helm/vault-job/vault-job.yaml b/helm/vault-job/vault-job.yaml index a68f2f9eb0c1e142be88606b3ea246cf97748cd5..399aec0c76b52ef8fe0b96b8ad4aa9b64f510e73 100644 --- a/helm/vault-job/vault-job.yaml +++ b/helm/vault-job/vault-job.yaml @@ -16,7 +16,7 @@ data: echo "install dependencies" apk add --no-cache jq openssl - # Establecer las variables de entorno de Vault + # Set Vault environment variables export VAULT_ADDR='http://vault-internal:8200' @@ -37,22 +37,22 @@ data: vault secrets enable pki - echo "# Generar una CA en Vault #" + echo "# Generate a CA in Vault #" vault secrets tune -max-lease-ttl=87600h pki vault write -field=certificate pki/root/generate/internal \ common_name="capif" \ - issuer_name="root-2023" \ - ttl=87600h > root_2023_ca.crt + issuer_name="root-2026" \ + ttl=87600h > root_2026_ca.crt - echo "# check root_2023_ca.crt #" - cat root_2023_ca.crt + echo "# check root_2026_ca.crt #" + cat root_2026_ca.crt vault write pki/config/urls \ issuing_certificates="$VAULT_ADDR/v1/pki/ca" \ crl_distribution_points="$VAULT_ADDR/v1/pki/crl" - # # Generar una CA intermedia en Vault + # # Generate an intermediate CA in Vault vault secrets enable -path=pki_int pki vault secrets tune -max-lease-ttl=43800h pki_int @@ -65,20 +65,20 @@ data: echo "### content pki_intermediate.csr ###" cat pki_intermediate.csr - # Firmar la CA intermedia con la CA raíz + # Sign the intermediate CA with the root CA vault write -format=json pki/root/sign-intermediate \ - issuer_ref="root-2023" \ + issuer_ref="root-2026" \ csr=@pki_intermediate.csr \ format=pem_bundle ttl="43800h" \ | jq -r '.data.certificate' > capif_intermediate.cert.pem - # Configurar la CA intermedia en Vault + # Configure the intermediate AC in Vault vault write pki_int/intermediate/set-signed certificate=@capif_intermediate.cert.pem - #Crear rol en Vault + # Create a role in Vault vault write pki_int/roles/my-ca use_csr_common_name=false require_cn=false allowed_domains="*" allow_any_name=true allow_bare_domains=true allow_glob_domains=true allow_subdomains=true max_ttl=4300h ttl=4300h - # Emitir un certificado firmado por la CA intermedia + # Issue a certificate signed by the intermediary CA # vault write -format=json pki_int/issue/my-ca \ # common_name="nginx.mon.svc.cluster.local" \ # format=pem_bundle ttl="438h" \ @@ -92,131 +92,31 @@ data: # | jq -r '.data.private_key as $private_key | .data.issuing_ca as $issuing_ca | .data.certificate as $certificate | [$private_key, $issuing_ca, $certificate]' > cert_data.json - #Create CSR - openssl genrsa -out ./server.key 2048 - - cat > ./foo.cnf < cert_data.json - - vault write -format=json pki_int/sign/my-ca format=pem_bundle ttl="43000h" csr=@server.csr | jq -r '.data.issuing_ca as $issuing_ca | .data.certificate as $certificate | [$issuing_ca, $certificate]' > cert_data.json - - jq -r '.[0]' cert_data.json > root_ca.crt.pem - echo "### content root_ca.crt.pem ###" - cat root_ca.crt.pem - - echo "### content server_certificate.crt.pem ###" - jq -r '.[1]' cert_data.json > server_certificate.crt.pem - - openssl x509 -pubkey -noout -in server_certificate.crt.pem > server_certificate_pub.pem - - #vault kv put secret/ca ca=@root_helm.pem root_2023_ca.crt - - #cat root_2023_ca.crt root_2023_ca.crt > ca.crt - - cat > certificados_concatenados.crt << EOF - $(cat "root_2023_ca.crt") - $(cat "root_ca.crt.pem") - EOF - echo "### content of root_2023_ca.crt ###" - cat root_2023_ca.crt - - echo "### content of root_ca.crt.pem ###" - cat root_ca.crt.pem - - echo "### content of certificados_concatenados.crt ###" - cat certificados_concatenados.crt - - # vault kv put secret/ca ca=@root_2023_ca.crt + ############################################################ + # 4) CA BUNDLE (KV v2) + ############################################################ echo "### enable secrets kv ###" vault secrets enable -path=secret -version=2 kv - vault kv put secret/ca ca=@certificados_concatenados.crt - - vault kv put secret/server_cert cert=@server_certificate.crt.pem - - vault kv put secret/server_cert/pub pub_key=@server_certificate_pub.pem - - vault kv put secret/server_cert/private key=@server.key + # Store CA bundle at secret/ca (same as docker script) + vault kv put secret/ca ca=@capif_intermediate.cert.pem + + echo "[INFO] CA bundle stored at secret/ca" + #POLICY_NAME="my-policy" #POLICY_FILE="my-policy.hcl" #TOKEN_ID="read-ca-token" - # Crear la política en Vault + # Create the policy in Vault #echo "path \"secret/data/ca\" { # capabilities = [\"read\"] #}" > "$POLICY_FILE" #vault policy write "$POLICY_NAME" "$POLICY_FILE" - # Generar un nuevo token y asignar la política + # Generate a new token and assign the policy #TOKEN=$(vault token create -id="$TOKEN_ID" -policy="$POLICY_NAME" -format=json | jq -r '.auth.client_token') #echo "Token generado:" diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/.openapi-generator/FILES b/services/TS29222_CAPIF_API_Invoker_Management_API/.openapi-generator/FILES index 716733b50c4a3eb61f5bd5dfa747bccff799aec9..ae0d5d92d8c75671e6a4e8544f423f165325a640 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/.openapi-generator/FILES +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/.openapi-generator/FILES @@ -8,13 +8,14 @@ git_push.sh api_invoker_management/__init__.py api_invoker_management/__main__.py api_invoker_management/controllers/__init__.py -api_invoker_management/controllers/default_controller.py -api_invoker_management/controllers/individual_api_invoker_enrolment_details_controller.py +api_invoker_management/controllers/individual_on_boarded_api_invoker_document_controller.py +api_invoker_management/controllers/on_boarded_api_invokers_collection_controller.py api_invoker_management/controllers/security_controller.py api_invoker_management/encoder.py api_invoker_management/models/__init__.py api_invoker_management/models/aef_location.py api_invoker_management/models/aef_profile.py +api_invoker_management/models/api_info.py api_invoker_management/models/api_invoker_enrolment_details.py api_invoker_management/models/api_invoker_enrolment_details_patch.py api_invoker_management/models/api_list.py @@ -25,6 +26,8 @@ api_invoker_management/models/communication_type.py api_invoker_management/models/custom_operation.py api_invoker_management/models/data_format.py api_invoker_management/models/ellipsoid_arc.py +api_invoker_management/models/enrol_fail_cause.py +api_invoker_management/models/enrol_fail_reason.py api_invoker_management/models/gad_shape.py api_invoker_management/models/geographic_area.py api_invoker_management/models/geographical_coordinates.py @@ -37,7 +40,10 @@ api_invoker_management/models/ipv6_address_range.py api_invoker_management/models/local2d_point_uncertainty_ellipse.py api_invoker_management/models/local3d_point_uncertainty_ellipsoid.py api_invoker_management/models/local_origin.py +api_invoker_management/models/net_slice_id.py api_invoker_management/models/o_auth_grant_type.py +api_invoker_management/models/onboarding_criteria.py +api_invoker_management/models/onboarding_fail_reason.py api_invoker_management/models/onboarding_information.py api_invoker_management/models/onboarding_notification.py api_invoker_management/models/operation.py @@ -50,12 +56,14 @@ api_invoker_management/models/polygon.py api_invoker_management/models/problem_details.py api_invoker_management/models/protocol.py api_invoker_management/models/published_api_path.py +api_invoker_management/models/related_criteria.py api_invoker_management/models/relative_cartesian_location.py api_invoker_management/models/resource.py api_invoker_management/models/security_method.py api_invoker_management/models/service_api_description.py api_invoker_management/models/service_kpis.py api_invoker_management/models/shareable_information.py +api_invoker_management/models/snssai.py api_invoker_management/models/supported_gad_shapes.py api_invoker_management/models/uncertainty_ellipse.py api_invoker_management/models/uncertainty_ellipsoid.py @@ -63,8 +71,8 @@ api_invoker_management/models/version.py api_invoker_management/models/websock_notif_config.py api_invoker_management/openapi/openapi.yaml api_invoker_management/test/__init__.py -api_invoker_management/test/test_default_controller.py -api_invoker_management/test/test_individual_api_invoker_enrolment_details_controller.py +api_invoker_management/test/test_individual_on_boarded_api_invoker_document_controller.py +api_invoker_management/test/test_on_boarded_api_invokers_collection_controller.py api_invoker_management/typing_utils.py api_invoker_management/util.py requirements.txt diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/app.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/app.py index abe585969bd76909574b9e9ee5596314f7eadd10..351bc6798e217b212a6a90040118a5ab4717baa0 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/app.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/app.py @@ -14,13 +14,19 @@ from flask_executor import Executor from flask_jwt_extended import JWTManager from fluent import sender from opentelemetry import trace -from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter +from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import \ + OTLPSpanExporter from opentelemetry.instrumentation.flask import FlaskInstrumentor from opentelemetry.instrumentation.redis import RedisInstrumentor from opentelemetry.sdk.resources import Resource from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import BatchSpanProcessor -from opentelemetry.trace.propagation.tracecontext import TraceContextTextMapPropagator +from opentelemetry.trace.propagation.tracecontext import \ + TraceContextTextMapPropagator + +from cryptography import x509 +from cryptography.hazmat.backends import default_backend +from cryptography.hazmat.primitives import serialization NAME = "Invoker-Service" @@ -118,6 +124,21 @@ def verbose_formatter(): with open("/usr/src/app/api_invoker_management/pubkey.pem", "rb") as pub_file: pub_data = pub_file.read() +# with open("/usr/src/app/api_invoker_management/pubkey.pem", "rb") as f: +# pem_data = f.read() + +# # Extract the first certificate from the PEM (even if it comes in a bundle) +# cert = x509.load_pem_x509_certificate(pem_data, default_backend()) + +# # Extract the public key +# public_key = cert.public_key() + +# # Convert the public key to PEM (which JWT needs) +# pub_data = public_key.public_bytes( +# encoding=serialization.Encoding.PEM, +# format=serialization.PublicFormat.SubjectPublicKeyInfo, +# ) + app = connexion.App(__name__, specification_dir='openapi/') app.app.json_encoder = encoder.CustomJSONEncoder app.add_api('openapi.yaml', diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/controllers/individual_api_invoker_enrolment_details_controller.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/controllers/individual_api_invoker_enrolment_details_controller.py deleted file mode 100644 index a033932ba7166e38aa0dc963afa45963d37d954f..0000000000000000000000000000000000000000 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/controllers/individual_api_invoker_enrolment_details_controller.py +++ /dev/null @@ -1,61 +0,0 @@ -from flask import current_app, request -from functools import wraps -from cryptography import x509 -from cryptography.hazmat.backends import default_backend - -from ..core.apiinvokerenrolmentdetails import InvokerManagementOperations -from ..core.validate_user import ControlAccess -from api_invoker_management.models.api_invoker_enrolment_details_patch import \ - APIInvokerEnrolmentDetailsPatch # noqa: E501 - -invoker_operations = InvokerManagementOperations() -valid_user = ControlAccess() - - -def cert_validation(): - def _cert_validation(f): - @wraps(f) - def __cert_validation(*args, **kwargs): - - args = request.view_args - cert_tmp = request.headers['X-Ssl-Client-Cert'] - cert_raw = cert_tmp.replace('\t', '') - - cert = x509.load_pem_x509_certificate(str.encode(cert_raw), default_backend()) - - cn = cert.subject.get_attributes_for_oid(x509.OID_COMMON_NAME)[0].value.strip() - - if cn != "superadmin": - cert_signature = cert.signature.hex() - result = valid_user.validate_user_cert(args["onboardingId"], cert_signature) - - if result is not None: - return result - - result = f(**kwargs) - return result - return __cert_validation - return _cert_validation - - -@cert_validation() -def modify_ind_api_invoke_enrolment(onboarding_id, body): # noqa: E501 - """modify_ind_api_invoke_enrolment - - Modify an individual API invoker details. # noqa: E501 - - :param onboarding_id: - :type onboarding_id: str - :param api_invoker_enrolment_details_patch: - :type api_invoker_enrolment_details_patch: dict | bytes - - :rtype: Union[APIInvokerEnrolmentDetails, Tuple[APIInvokerEnrolmentDetails, int], Tuple[APIInvokerEnrolmentDetails, int, Dict[str, str]] - """ - current_app.logger.info("Updating invoker") - if request.is_json: - body = APIInvokerEnrolmentDetailsPatch.from_dict(request.get_json()) # noqa: E501 - - res = invoker_operations.patch_apiinvokerenrolmentdetail(onboarding_id, body) - - return res - diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/controllers/default_controller.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/controllers/individual_on_boarded_api_invoker_document_controller.py similarity index 59% rename from services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/controllers/default_controller.py rename to services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/controllers/individual_on_boarded_api_invoker_document_controller.py index 09ffb62420d0330c04292f3d2617c47cde0712e3..aaff12d09ccadfe5957b5f693b4b6a88e8c147c2 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/controllers/default_controller.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/controllers/individual_on_boarded_api_invoker_document_controller.py @@ -1,13 +1,17 @@ from functools import wraps +from api_invoker_management.models.api_invoker_enrolment_details_patch import \ + APIInvokerEnrolmentDetailsPatch # noqa: E501 from cryptography import x509 from cryptography.hazmat.backends import default_backend from flask import current_app, request -from flask_jwt_extended import get_jwt_identity, jwt_required + +from ..core.responses import unauthorized_error from ..core.apiinvokerenrolmentdetails import InvokerManagementOperations from ..core.validate_user import ControlAccess -from ..models.api_invoker_enrolment_details import APIInvokerEnrolmentDetails # noqa: E501 +from ..models.api_invoker_enrolment_details import \ + APIInvokerEnrolmentDetails # noqa: E501 invoker_operations = InvokerManagementOperations() valid_user = ControlAccess() @@ -18,7 +22,11 @@ def cert_validation(): def __cert_validation(*args, **kwargs): args = request.view_args - cert_tmp = request.headers['X-Ssl-Client-Cert'] + cert_tmp = request.headers.get('X-Ssl-Client-Cert') + + if not cert_tmp: + return unauthorized_error("Client certificate required", "X-Ssl-Client-Cert header is missing") + cert_raw = cert_tmp.replace('\t', '') cert = x509.load_pem_x509_certificate(str.encode(cert_raw), default_backend()) @@ -38,12 +46,12 @@ def cert_validation(): return _cert_validation @cert_validation() -def onboarded_invokers_onboarding_id_delete(onboarding_id): # noqa: E501 - """onboarded_invokers_onboarding_id_delete +def delete_ind_onboarded_api_invoker(onboarding_id): # noqa: E501 + """Delete an existing Individual On-boarded API Invoker resource. - Deletes an individual API Invoker. # noqa: E501 + Deletes an existing Individual On-boarded API Invoker. # noqa: E501 - :param onboarding_id: String identifying an individual on-boarded API invoker resource + :param onboarding_id: :type onboarding_id: str :rtype: Union[None, Tuple[None, int], Tuple[None, int, Dict[str, str]] @@ -54,44 +62,43 @@ def onboarded_invokers_onboarding_id_delete(onboarding_id): # noqa: E501 return res @cert_validation() -def onboarded_invokers_onboarding_id_put(onboarding_id, body): # noqa: E501 - """onboarded_invokers_onboarding_id_put +def modify_ind_api_invoke_enrolment(onboarding_id, body): # noqa: E501 + """modify_ind_api_invoke_enrolment - Updates an individual API invoker details. # noqa: E501 + # noqa: E501 - :param onboarding_id: String identifying an individual on-boarded API invoker resource + :param onboarding_id: :type onboarding_id: str - :param api_invoker_enrolment_details: representation of the API invoker details to be updated in CAPIF core function - :type api_invoker_enrolment_details: dict | bytes + :param api_invoker_enrolment_details_patch: + :type api_invoker_enrolment_details_patch: dict | bytes :rtype: Union[APIInvokerEnrolmentDetails, Tuple[APIInvokerEnrolmentDetails, int], Tuple[APIInvokerEnrolmentDetails, int, Dict[str, str]] """ current_app.logger.info("Updating invoker") if request.is_json: - body = APIInvokerEnrolmentDetails.from_dict(request.get_json()) # noqa: E501 + body = APIInvokerEnrolmentDetailsPatch.from_dict(request.get_json()) # noqa: E501 - res = invoker_operations.update_apiinvokerenrolmentdetail(onboarding_id,body) + res = invoker_operations.patch_apiinvokerenrolmentdetail(onboarding_id, body) return res -@jwt_required() -def onboarded_invokers_post(body): # noqa: E501 - """onboarded_invokers_post +@cert_validation() +def update_ind_onboarded_api_invoker(onboarding_id, body): # noqa: E501 + """Update an existing Individual On-boarded API Invoker resource. - Creates a new individual API Invoker profile. # noqa: E501 + # noqa: E501 + :param onboarding_id: + :type onboarding_id: str :param api_invoker_enrolment_details: :type api_invoker_enrolment_details: dict | bytes :rtype: Union[APIInvokerEnrolmentDetails, Tuple[APIInvokerEnrolmentDetails, int], Tuple[APIInvokerEnrolmentDetails, int, Dict[str, str]] """ - identity = get_jwt_identity() - username, uuid = identity.split() - - current_app.logger.info("Creating Invoker") + current_app.logger.info("Updating invoker") if request.is_json: body = APIInvokerEnrolmentDetails.from_dict(request.get_json()) # noqa: E501 - res = invoker_operations.add_apiinvokerenrolmentdetail(body, username, uuid) + res = invoker_operations.update_apiinvokerenrolmentdetail(onboarding_id,body) return res diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/controllers/on_boarded_api_invokers_collection_controller.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/controllers/on_boarded_api_invokers_collection_controller.py new file mode 100644 index 0000000000000000000000000000000000000000..240dc26ec750e49b89de285603bce550f32c93e9 --- /dev/null +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/controllers/on_boarded_api_invokers_collection_controller.py @@ -0,0 +1,33 @@ + +from api_invoker_management.models.api_invoker_enrolment_details import \ + APIInvokerEnrolmentDetails # noqa: E501 +from api_invoker_management.models.problem_details import \ + ProblemDetails # noqa: E501 +from flask import current_app, request +from flask_jwt_extended import get_jwt_identity, jwt_required + +from ..core.apiinvokerenrolmentdetails import InvokerManagementOperations + +invoker_operations = InvokerManagementOperations() + +@jwt_required() +def create_onboarded_api_invoker(body): # noqa: E501 + """Request the Creation of a new On-boarded API Invoker. + + # noqa: E501 + + :param api_invoker_enrolment_details: + :type api_invoker_enrolment_details: dict | bytes + + :rtype: Union[APIInvokerEnrolmentDetails, Tuple[APIInvokerEnrolmentDetails, int], Tuple[APIInvokerEnrolmentDetails, int, Dict[str, str]] + """ + identity = get_jwt_identity() + username, uuid = identity.split() + + current_app.logger.info("Creating Invoker") + if request.is_json: + body = APIInvokerEnrolmentDetails.from_dict(request.get_json()) # noqa: E501 + + res = invoker_operations.add_apiinvokerenrolmentdetail(body, username, uuid) + + return res diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/controllers/security_controller.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/controllers/security_controller.py index 139597f9cb07c5d48bed18984ec4747f4b4f3438..82c94978b09fbb3cd1dbab182c97b19cbe9ca07f 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/controllers/security_controller.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/controllers/security_controller.py @@ -1,2 +1,30 @@ +def info_from_oAuth2ClientCredentials(token): + """ + Validate and decode token. + Returned value will be passed in 'token_info' parameter of your operation function, if there is one. + 'sub' or 'uid' will be set in 'user' parameter of your operation function, if there is one. + 'scope' or 'scopes' will be passed to scope validation function. + + :param token Token provided by Authorization header + :type token: str + :return: Decoded token information or None if token is invalid + :rtype: dict | None + """ + return {'scopes': ['read:pets', 'write:pets'], 'uid': 'user_id'} + + +def validate_scope_oAuth2ClientCredentials(required_scopes, token_scopes): + """ + Validate required scopes are included in token scope + + :param required_scopes Required scope to access called API + :type required_scopes: List[str] + :param token_scopes Scope present in token + :type token_scopes: List[str] + :return: True if access to called API is allowed + :rtype: bool + """ + return set(required_scopes).issubset(set(token_scopes)) + diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/apiinvokerenrolmentdetails.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/apiinvokerenrolmentdetails.py index 381df7b75e1203b2ba2345a4fb94c279f16b4292..70e35b85787a21e5020a7f1c461e5b0c24656372 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/apiinvokerenrolmentdetails.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/apiinvokerenrolmentdetails.py @@ -6,19 +6,20 @@ from datetime import datetime import requests import rfc3987 from api_invoker_management.db.db import MongoDatabse -from api_invoker_management.models.api_invoker_enrolment_details import APIInvokerEnrolmentDetails +from api_invoker_management.models.api_invoker_enrolment_details import \ + APIInvokerEnrolmentDetails from flask import Response, current_app from pymongo import ReturnDocument from ..config import Config -from ..util import dict_to_camel_case, serialize_clean_camel_case, clean_empty +from ..util import clean_empty, dict_to_camel_case, serialize_clean_camel_case from .auth_manager import AuthManager from .publisher import Publisher from .redis_event import RedisEvent from .redis_internal_event import RedisInternalEvent from .resources import Resource -from .responses import bad_request_error, forbidden_error, internal_server_error, make_response, not_found_error - +from .responses import (bad_request_error, forbidden_error, + internal_server_error, make_response, not_found_error) TOTAL_FEATURES = 4 SUPPORTED_FEATURES_HEX = "0" @@ -100,6 +101,13 @@ class InvokerManagementOperations(Resource): current_app.logger.error("Bad url format") return bad_request_error(detail="Bad Param", cause="Detected Bad formar of param", invalid_params=[{"param": "notificationDestination", "reason": "Not valid URL format"}]) + if not apiinvokerenrolmentdetail.supported_features: + return bad_request_error( + detail="supportedFeatures not present in request", + cause="supportedFeatures not present", + invalid_params=[{"param": "supportedFeatures", "reason": "not defined"}] + ) + current_app.logger.debug("Signing Certificate") api_invoker_id = 'INV'+str(secrets.token_hex(15)) @@ -148,6 +156,13 @@ class InvokerManagementOperations(Resource): if isinstance(result, Response): return result + if not apiinvokerenrolmentdetail.supported_features: + return bad_request_error( + detail="supportedFeatures not present in request", + cause="supportedFeatures not present", + invalid_params=[{"param": "supportedFeatures", "reason": "not defined"}] + ) + if apiinvokerenrolmentdetail.onboarding_information.api_invoker_public_key != result["onboarding_information"]["api_invoker_public_key"]: cert = self.__sign_cert( apiinvokerenrolmentdetail.onboarding_information.api_invoker_public_key, result["api_invoker_id"]) diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/responses.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/responses.py index 8f975cbf426c304c4ae0681f65af67fcad9abca5..82305f4b9663242c41a36091ec47c4c9f808ce5d 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/responses.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/core/responses.py @@ -33,11 +33,18 @@ def bad_request_error(detail, cause, invalid_params): prob = ProblemDetails(title="Bad Request", status=400, detail=detail, cause=cause, invalid_params=invalid_params) prob = serialize_clean_camel_case(prob) - return Response(json.dumps(prob, cls=CustomJSONEncoder), status=400, mimetype=cause) + return Response(json.dumps(prob, cls=CustomJSONEncoder), status=400, mimetype=mimetype) def not_found_error(detail, cause): prob = ProblemDetails(title="Not Found", status=404, detail=detail, cause=cause) prob = serialize_clean_camel_case(prob) - return Response(json.dumps(prob, cls=CustomJSONEncoder), status=404, mimetype=mimetype) \ No newline at end of file + return Response(json.dumps(prob, cls=CustomJSONEncoder), status=404, mimetype=mimetype) + + +def unauthorized_error(detail, cause): + prob = ProblemDetails(title="Unauthorized", status=401, detail=detail, cause=cause) + prob = serialize_clean_camel_case(prob) + + return Response(json.dumps(prob, cls=CustomJSONEncoder), status=401, mimetype=mimetype) diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/aef_location.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/aef_location.py index 512c9804f4bb480bedbdab8d7c9ac0301cd49e15..5ef2b9718f631b097de697f03c882b3eebc787bf 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/aef_location.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/aef_location.py @@ -3,8 +3,10 @@ from typing import Dict, List # noqa: F401 from api_invoker_management import util from api_invoker_management.models.base_model import Model -from api_invoker_management.models.civic_address import CivicAddress # noqa: E501 -from api_invoker_management.models.geographic_area import GeographicArea # noqa: E501 +from api_invoker_management.models.civic_address import \ + CivicAddress # noqa: E501 +from api_invoker_management.models.geographic_area import \ + GeographicArea # noqa: E501 class AefLocation(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/aef_profile.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/aef_profile.py index 6286622622af842e5b4b9d955c2cdb781d77186d..c2dc56f5d2c69ba46484273a934a1d35c7d63362 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/aef_profile.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/aef_profile.py @@ -2,15 +2,21 @@ from datetime import date, datetime # noqa: F401 from typing import Dict, List # noqa: F401 from api_invoker_management import util -from api_invoker_management.models.aef_location import AefLocation # noqa: E501 +from api_invoker_management.models.aef_location import \ + AefLocation # noqa: E501 from api_invoker_management.models.base_model import Model from api_invoker_management.models.data_format import DataFormat # noqa: E501 -from api_invoker_management.models.interface_description import InterfaceDescription # noqa: E501 -from api_invoker_management.models.ip_addr_range import IpAddrRange # noqa: E501 -from api_invoker_management.models.o_auth_grant_type import OAuthGrantType # noqa: E501 +from api_invoker_management.models.interface_description import \ + InterfaceDescription # noqa: E501 +from api_invoker_management.models.ip_addr_range import \ + IpAddrRange # noqa: E501 +from api_invoker_management.models.o_auth_grant_type import \ + OAuthGrantType # noqa: E501 from api_invoker_management.models.protocol import Protocol # noqa: E501 -from api_invoker_management.models.security_method import SecurityMethod # noqa: E501 -from api_invoker_management.models.service_kpis import ServiceKpis # noqa: E501 +from api_invoker_management.models.security_method import \ + SecurityMethod # noqa: E501 +from api_invoker_management.models.service_kpis import \ + ServiceKpis # noqa: E501 from api_invoker_management.models.version import Version # noqa: E501 diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_info.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_info.py new file mode 100644 index 0000000000000000000000000000000000000000..ff9729a4fe0420b36e8b52515515a93962a8542a --- /dev/null +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_info.py @@ -0,0 +1,90 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api_invoker_management import util +from api_invoker_management.models.base_model import Model + + +class ApiInfo(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, api_name=None, supported_api_versions=None): # noqa: E501 + """ApiInfo - a model defined in OpenAPI + + :param api_name: The api_name of this ApiInfo. # noqa: E501 + :type api_name: str + :param supported_api_versions: The supported_api_versions of this ApiInfo. # noqa: E501 + :type supported_api_versions: List[str] + """ + self.openapi_types = { + 'api_name': str, + 'supported_api_versions': List[str] + } + + self.attribute_map = { + 'api_name': 'apiName', + 'supported_api_versions': 'supportedApiVersions' + } + + self._api_name = api_name + self._supported_api_versions = supported_api_versions + + @classmethod + def from_dict(cls, dikt) -> 'ApiInfo': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The ApiInfo of this ApiInfo. # noqa: E501 + :rtype: ApiInfo + """ + return util.deserialize_model(dikt, cls) + + @property + def api_name(self) -> str: + """Gets the api_name of this ApiInfo. + + + :return: The api_name of this ApiInfo. + :rtype: str + """ + return self._api_name + + @api_name.setter + def api_name(self, api_name: str): + """Sets the api_name of this ApiInfo. + + + :param api_name: The api_name of this ApiInfo. + :type api_name: str + """ + if api_name is None: + raise ValueError("Invalid value for `api_name`, must not be `None`") # noqa: E501 + + self._api_name = api_name + + @property + def supported_api_versions(self) -> List[str]: + """Gets the supported_api_versions of this ApiInfo. + + + :return: The supported_api_versions of this ApiInfo. + :rtype: List[str] + """ + return self._supported_api_versions + + @supported_api_versions.setter + def supported_api_versions(self, supported_api_versions: List[str]): + """Sets the supported_api_versions of this ApiInfo. + + + :param supported_api_versions: The supported_api_versions of this ApiInfo. + :type supported_api_versions: List[str] + """ + if supported_api_versions is not None and len(supported_api_versions) < 1: + raise ValueError("Invalid value for `supported_api_versions`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._supported_api_versions = supported_api_versions diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_invoker_enrolment_details.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_invoker_enrolment_details.py index bec061ae6b0ca7c7bd0cec0c1d5cc282f288ac27..0a79b7d6e128faff1c059a23f91b013b2c9f2b39 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_invoker_enrolment_details.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_invoker_enrolment_details.py @@ -5,8 +5,12 @@ from typing import Dict, List # noqa: F401 from api_invoker_management import util from api_invoker_management.models.api_list import APIList # noqa: E501 from api_invoker_management.models.base_model import Model -from api_invoker_management.models.onboarding_information import OnboardingInformation # noqa: E501 -from api_invoker_management.models.websock_notif_config import WebsockNotifConfig # noqa: E501 +from api_invoker_management.models.enrol_fail_reason import \ + EnrolFailReason # noqa: E501 +from api_invoker_management.models.onboarding_information import \ + OnboardingInformation # noqa: E501 +from api_invoker_management.models.websock_notif_config import \ + WebsockNotifConfig # noqa: E501 class APIInvokerEnrolmentDetails(Model): @@ -15,7 +19,7 @@ class APIInvokerEnrolmentDetails(Model): Do not edit the class manually. """ - def __init__(self, api_invoker_id=None, onboarding_information=None, notification_destination=None, request_test_notification=None, websock_notif_config=None, api_list=None, api_invoker_information=None, exp_time=None, supported_features=None): # noqa: E501 + def __init__(self, api_invoker_id=None, onboarding_information=None, notification_destination=None, request_test_notification=None, websock_notif_config=None, api_list=None, api_invoker_information=None, exp_time=None, supported_features=None, failure_reasons=None): # noqa: E501 """APIInvokerEnrolmentDetails - a model defined in OpenAPI :param api_invoker_id: The api_invoker_id of this APIInvokerEnrolmentDetails. # noqa: E501 @@ -36,6 +40,8 @@ class APIInvokerEnrolmentDetails(Model): :type exp_time: datetime :param supported_features: The supported_features of this APIInvokerEnrolmentDetails. # noqa: E501 :type supported_features: str + :param failure_reasons: The failure_reasons of this APIInvokerEnrolmentDetails. # noqa: E501 + :type failure_reasons: List[EnrolFailReason] """ self.openapi_types = { 'api_invoker_id': str, @@ -46,7 +52,8 @@ class APIInvokerEnrolmentDetails(Model): 'api_list': APIList, 'api_invoker_information': str, 'exp_time': datetime, - 'supported_features': str + 'supported_features': str, + 'failure_reasons': List[EnrolFailReason] } self.attribute_map = { @@ -58,7 +65,8 @@ class APIInvokerEnrolmentDetails(Model): 'api_list': 'apiList', 'api_invoker_information': 'apiInvokerInformation', 'exp_time': 'expTime', - 'supported_features': 'supportedFeatures' + 'supported_features': 'supportedFeatures', + 'failure_reasons': 'failureReasons' } self._api_invoker_id = api_invoker_id @@ -70,6 +78,7 @@ class APIInvokerEnrolmentDetails(Model): self._api_invoker_information = api_invoker_information self._exp_time = exp_time self._supported_features = supported_features + self._failure_reasons = failure_reasons @classmethod def from_dict(cls, dikt) -> 'APIInvokerEnrolmentDetails': @@ -157,7 +166,7 @@ class APIInvokerEnrolmentDetails(Model): def request_test_notification(self) -> bool: """Gets the request_test_notification of this APIInvokerEnrolmentDetails. - Set to true by Subscriber to request the CAPIF core function to send a test notification as defined in in clause 7.6. Set to false or omitted otherwise. # noqa: E501 + Set to true to request the CCF to send a test notification as defined in in clause 7.6. Set to false or omitted otherwise. # noqa: E501 :return: The request_test_notification of this APIInvokerEnrolmentDetails. :rtype: bool @@ -168,7 +177,7 @@ class APIInvokerEnrolmentDetails(Model): def request_test_notification(self, request_test_notification: bool): """Sets the request_test_notification of this APIInvokerEnrolmentDetails. - Set to true by Subscriber to request the CAPIF core function to send a test notification as defined in in clause 7.6. Set to false or omitted otherwise. # noqa: E501 + Set to true to request the CCF to send a test notification as defined in in clause 7.6. Set to false or omitted otherwise. # noqa: E501 :param request_test_notification: The request_test_notification of this APIInvokerEnrolmentDetails. :type request_test_notification: bool @@ -288,3 +297,26 @@ class APIInvokerEnrolmentDetails(Model): raise ValueError(r"Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 self._supported_features = supported_features + + @property + def failure_reasons(self) -> List[EnrolFailReason]: + """Gets the failure_reasons of this APIInvokerEnrolmentDetails. + + + :return: The failure_reasons of this APIInvokerEnrolmentDetails. + :rtype: List[EnrolFailReason] + """ + return self._failure_reasons + + @failure_reasons.setter + def failure_reasons(self, failure_reasons: List[EnrolFailReason]): + """Sets the failure_reasons of this APIInvokerEnrolmentDetails. + + + :param failure_reasons: The failure_reasons of this APIInvokerEnrolmentDetails. + :type failure_reasons: List[EnrolFailReason] + """ + if failure_reasons is not None and len(failure_reasons) < 1: + raise ValueError("Invalid value for `failure_reasons`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._failure_reasons = failure_reasons diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_invoker_enrolment_details_patch.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_invoker_enrolment_details_patch.py index c827f22bdf4440dce000cc719f1c7c55c076ccbf..d1e9ff90deb11a3bb0f705e31632ac122cdb54df 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_invoker_enrolment_details_patch.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_invoker_enrolment_details_patch.py @@ -4,7 +4,8 @@ from typing import Dict, List # noqa: F401 from api_invoker_management import util from api_invoker_management.models.api_list import APIList # noqa: E501 from api_invoker_management.models.base_model import Model -from api_invoker_management.models.onboarding_information import OnboardingInformation # noqa: E501 +from api_invoker_management.models.onboarding_information import \ + OnboardingInformation # noqa: E501 class APIInvokerEnrolmentDetailsPatch(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_list.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_list.py index 25ddd0033bb259c8360700b463c9041f8d1cc929..d273297ba756ef85ad463ffa2b8723d36ff935a1 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_list.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_list.py @@ -3,7 +3,8 @@ from typing import Dict, List # noqa: F401 from api_invoker_management import util from api_invoker_management.models.base_model import Model -from api_invoker_management.models.service_api_description import ServiceAPIDescription # noqa: E501 +from api_invoker_management.models.service_api_description import \ + ServiceAPIDescription # noqa: E501 class APIList(Model): @@ -43,7 +44,7 @@ class APIList(Model): def service_api_descriptions(self) -> List[ServiceAPIDescription]: """Gets the service_api_descriptions of this APIList. - Represents the list of service APIs that the API Invoker is allowed to invoke. # noqa: E501 + Represents the list of service APIs that the API Invoker is allowed to invoke. # noqa: E501 :return: The service_api_descriptions of this APIList. :rtype: List[ServiceAPIDescription] @@ -54,7 +55,7 @@ class APIList(Model): def service_api_descriptions(self, service_api_descriptions: List[ServiceAPIDescription]): """Sets the service_api_descriptions of this APIList. - Represents the list of service APIs that the API Invoker is allowed to invoke. # noqa: E501 + Represents the list of service APIs that the API Invoker is allowed to invoke. # noqa: E501 :param service_api_descriptions: The service_api_descriptions of this APIList. :type service_api_descriptions: List[ServiceAPIDescription] diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_status.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_status.py index 7bf0540b228019b16750a4d073aac24364f9c21b..65e48d05935f6cfe5349be14f77fe81716cf4fc9 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_status.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/api_status.py @@ -42,7 +42,7 @@ class ApiStatus(Model): def aef_ids(self) -> List[str]: """Gets the aef_ids of this ApiStatus. - Indicates the list of AEF ID(s) where the API is active. If this attribute is omitted, the API is inactive at all AEF(s) defined in the \"aefProfiles\" attribute within the ServiceAPIDescription data structure. # noqa: E501 + Indicates the list of AEF ID(s) where the API is active. If an empty array is provided, it indicates that the API is inactive in all AEF(s). # noqa: E501 :return: The aef_ids of this ApiStatus. :rtype: List[str] @@ -53,7 +53,7 @@ class ApiStatus(Model): def aef_ids(self, aef_ids: List[str]): """Sets the aef_ids of this ApiStatus. - Indicates the list of AEF ID(s) where the API is active. If this attribute is omitted, the API is inactive at all AEF(s) defined in the \"aefProfiles\" attribute within the ServiceAPIDescription data structure. # noqa: E501 + Indicates the list of AEF ID(s) where the API is active. If an empty array is provided, it indicates that the API is inactive in all AEF(s). # noqa: E501 :param aef_ids: The aef_ids of this ApiStatus. :type aef_ids: List[str] diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/custom_operation.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/custom_operation.py index 0fc567820dda825bea7921332167367750f3c030..d94b6eefb7c0b252f5302959df426d031bf4adba 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/custom_operation.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/custom_operation.py @@ -3,7 +3,8 @@ from typing import Dict, List # noqa: F401 from api_invoker_management import util from api_invoker_management.models.base_model import Model -from api_invoker_management.models.communication_type import CommunicationType # noqa: E501 +from api_invoker_management.models.communication_type import \ + CommunicationType # noqa: E501 from api_invoker_management.models.operation import Operation # noqa: E501 diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ellipsoid_arc.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ellipsoid_arc.py index de005059d93e860ad99b7fe9f81ee5abadbc63d0..357b57e98e53544a376e8cc3b1c9eff991b8782a 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ellipsoid_arc.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ellipsoid_arc.py @@ -4,8 +4,10 @@ from typing import Dict, List # noqa: F401 from api_invoker_management import util from api_invoker_management.models.base_model import Model from api_invoker_management.models.gad_shape import GADShape # noqa: E501 -from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 -from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 +from api_invoker_management.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from api_invoker_management.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 class EllipsoidArc(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/enrol_fail_cause.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/enrol_fail_cause.py new file mode 100644 index 0000000000000000000000000000000000000000..022a61e4aada00287a2b123d6ccdc7dd3edf4659 --- /dev/null +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/enrol_fail_cause.py @@ -0,0 +1,33 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api_invoker_management import util +from api_invoker_management.models.base_model import Model + + +class EnrolFailCause(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self): # noqa: E501 + """EnrolFailCause - a model defined in OpenAPI + + """ + self.openapi_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'EnrolFailCause': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The EnrolFailCause of this EnrolFailCause. # noqa: E501 + :rtype: EnrolFailCause + """ + return util.deserialize_model(dikt, cls) diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/enrol_fail_reason.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/enrol_fail_reason.py new file mode 100644 index 0000000000000000000000000000000000000000..5c03f2c9d4b66e3b22bc6cc82a3b6016f64379c8 --- /dev/null +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/enrol_fail_reason.py @@ -0,0 +1,92 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api_invoker_management import util +from api_invoker_management.models.base_model import Model +from api_invoker_management.models.enrol_fail_cause import \ + EnrolFailCause # noqa: E501 + + +class EnrolFailReason(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, api_name=None, failure_code=None): # noqa: E501 + """EnrolFailReason - a model defined in OpenAPI + + :param api_name: The api_name of this EnrolFailReason. # noqa: E501 + :type api_name: List[str] + :param failure_code: The failure_code of this EnrolFailReason. # noqa: E501 + :type failure_code: EnrolFailCause + """ + self.openapi_types = { + 'api_name': List[str], + 'failure_code': EnrolFailCause + } + + self.attribute_map = { + 'api_name': 'apiName', + 'failure_code': 'failureCode' + } + + self._api_name = api_name + self._failure_code = failure_code + + @classmethod + def from_dict(cls, dikt) -> 'EnrolFailReason': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The EnrolFailReason of this EnrolFailReason. # noqa: E501 + :rtype: EnrolFailReason + """ + return util.deserialize_model(dikt, cls) + + @property + def api_name(self) -> List[str]: + """Gets the api_name of this EnrolFailReason. + + + :return: The api_name of this EnrolFailReason. + :rtype: List[str] + """ + return self._api_name + + @api_name.setter + def api_name(self, api_name: List[str]): + """Sets the api_name of this EnrolFailReason. + + + :param api_name: The api_name of this EnrolFailReason. + :type api_name: List[str] + """ + if api_name is None: + raise ValueError("Invalid value for `api_name`, must not be `None`") # noqa: E501 + + self._api_name = api_name + + @property + def failure_code(self) -> EnrolFailCause: + """Gets the failure_code of this EnrolFailReason. + + + :return: The failure_code of this EnrolFailReason. + :rtype: EnrolFailCause + """ + return self._failure_code + + @failure_code.setter + def failure_code(self, failure_code: EnrolFailCause): + """Sets the failure_code of this EnrolFailReason. + + + :param failure_code: The failure_code of this EnrolFailReason. + :type failure_code: EnrolFailCause + """ + if failure_code is None: + raise ValueError("Invalid value for `failure_code`, must not be `None`") # noqa: E501 + + self._failure_code = failure_code diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/gad_shape.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/gad_shape.py index 496c79b9a1ddf99091928870ecb8a51866679ccb..7be25d45841236cf780ead1fcc7717ba5d82916d 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/gad_shape.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/gad_shape.py @@ -3,7 +3,8 @@ from typing import Dict, List # noqa: F401 from api_invoker_management import util from api_invoker_management.models.base_model import Model -from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 +from api_invoker_management.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 class GADShape(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/geographic_area.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/geographic_area.py index 2ec1f5538d915fc30c7245261e118c618f833031..7e69d8f0db9a4a40029d290eeb9c811d6557f51a 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/geographic_area.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/geographic_area.py @@ -3,16 +3,24 @@ from typing import Dict, List # noqa: F401 from api_invoker_management import util from api_invoker_management.models.base_model import Model -from api_invoker_management.models.ellipsoid_arc import EllipsoidArc # noqa: E501 -from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 +from api_invoker_management.models.ellipsoid_arc import \ + EllipsoidArc # noqa: E501 +from api_invoker_management.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 from api_invoker_management.models.point import Point # noqa: E501 -from api_invoker_management.models.point_altitude import PointAltitude # noqa: E501 -from api_invoker_management.models.point_altitude_uncertainty import PointAltitudeUncertainty # noqa: E501 -from api_invoker_management.models.point_uncertainty_circle import PointUncertaintyCircle # noqa: E501 -from api_invoker_management.models.point_uncertainty_ellipse import PointUncertaintyEllipse # noqa: E501 +from api_invoker_management.models.point_altitude import \ + PointAltitude # noqa: E501 +from api_invoker_management.models.point_altitude_uncertainty import \ + PointAltitudeUncertainty # noqa: E501 +from api_invoker_management.models.point_uncertainty_circle import \ + PointUncertaintyCircle # noqa: E501 +from api_invoker_management.models.point_uncertainty_ellipse import \ + PointUncertaintyEllipse # noqa: E501 from api_invoker_management.models.polygon import Polygon # noqa: E501 -from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 -from api_invoker_management.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 +from api_invoker_management.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 +from api_invoker_management.models.uncertainty_ellipse import \ + UncertaintyEllipse # noqa: E501 class GeographicArea(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/interface_description.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/interface_description.py index 3a9d6f55387eedef0650f1531b8dc960cb5a1909..41a4ecc32815585998bd15cd31ba923f21634fb8 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/interface_description.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/interface_description.py @@ -4,8 +4,10 @@ from typing import Dict, List # noqa: F401 from api_invoker_management import util from api_invoker_management.models.base_model import Model -from api_invoker_management.models.o_auth_grant_type import OAuthGrantType # noqa: E501 -from api_invoker_management.models.security_method import SecurityMethod # noqa: E501 +from api_invoker_management.models.o_auth_grant_type import \ + OAuthGrantType # noqa: E501 +from api_invoker_management.models.security_method import \ + SecurityMethod # noqa: E501 class InterfaceDescription(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ip_addr_range.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ip_addr_range.py index 70ad8a6fcd67532ccc77e3addf5804915411eb32..acf63a0395cfcc2d171b4301910069d42e8f652b 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ip_addr_range.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/ip_addr_range.py @@ -3,8 +3,10 @@ from typing import Dict, List # noqa: F401 from api_invoker_management import util from api_invoker_management.models.base_model import Model -from api_invoker_management.models.ipv4_address_range import Ipv4AddressRange # noqa: E501 -from api_invoker_management.models.ipv6_address_range import Ipv6AddressRange # noqa: E501 +from api_invoker_management.models.ipv4_address_range import \ + Ipv4AddressRange # noqa: E501 +from api_invoker_management.models.ipv6_address_range import \ + Ipv6AddressRange # noqa: E501 class IpAddrRange(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/local2d_point_uncertainty_ellipse.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/local2d_point_uncertainty_ellipse.py index 5e05b82071b2293309be5dc06d7989653cb54c98..70a15f8d5e2835635f42e5658e2cb76101cb7d63 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/local2d_point_uncertainty_ellipse.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/local2d_point_uncertainty_ellipse.py @@ -4,10 +4,14 @@ from typing import Dict, List # noqa: F401 from api_invoker_management import util from api_invoker_management.models.base_model import Model from api_invoker_management.models.gad_shape import GADShape # noqa: E501 -from api_invoker_management.models.local_origin import LocalOrigin # noqa: E501 -from api_invoker_management.models.relative_cartesian_location import RelativeCartesianLocation # noqa: E501 -from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 -from api_invoker_management.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 +from api_invoker_management.models.local_origin import \ + LocalOrigin # noqa: E501 +from api_invoker_management.models.relative_cartesian_location import \ + RelativeCartesianLocation # noqa: E501 +from api_invoker_management.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 +from api_invoker_management.models.uncertainty_ellipse import \ + UncertaintyEllipse # noqa: E501 class Local2dPointUncertaintyEllipse(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/local3d_point_uncertainty_ellipsoid.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/local3d_point_uncertainty_ellipsoid.py index 22c894f2bd1bc1e5f95487ca234737fb1fff8822..83a652b7b9891d29828919680d8b267f99c7dcf1 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/local3d_point_uncertainty_ellipsoid.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/local3d_point_uncertainty_ellipsoid.py @@ -4,10 +4,14 @@ from typing import Dict, List # noqa: F401 from api_invoker_management import util from api_invoker_management.models.base_model import Model from api_invoker_management.models.gad_shape import GADShape # noqa: E501 -from api_invoker_management.models.local_origin import LocalOrigin # noqa: E501 -from api_invoker_management.models.relative_cartesian_location import RelativeCartesianLocation # noqa: E501 -from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 -from api_invoker_management.models.uncertainty_ellipsoid import UncertaintyEllipsoid # noqa: E501 +from api_invoker_management.models.local_origin import \ + LocalOrigin # noqa: E501 +from api_invoker_management.models.relative_cartesian_location import \ + RelativeCartesianLocation # noqa: E501 +from api_invoker_management.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 +from api_invoker_management.models.uncertainty_ellipsoid import \ + UncertaintyEllipsoid # noqa: E501 class Local3dPointUncertaintyEllipsoid(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/local_origin.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/local_origin.py index 489ceef80012f12b98a12ee57aa21ccffa0d4fdd..a1b30e2b9fbac15512036140c83abf4813d6aa52 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/local_origin.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/local_origin.py @@ -3,8 +3,10 @@ from typing import Dict, List # noqa: F401 from api_invoker_management import util from api_invoker_management.models.base_model import Model -from api_invoker_management.models.geographic_area import GeographicArea # noqa: E501 -from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 +from api_invoker_management.models.geographic_area import \ + GeographicArea # noqa: E501 +from api_invoker_management.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 class LocalOrigin(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/net_slice_id.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/net_slice_id.py new file mode 100644 index 0000000000000000000000000000000000000000..b385e09b4e1b1678575ebe5ee7605b398d61b8d0 --- /dev/null +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/net_slice_id.py @@ -0,0 +1,117 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api_invoker_management import util +from api_invoker_management.models.base_model import Model +from api_invoker_management.models.snssai import Snssai # noqa: E501 + + +class NetSliceId(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, snssai=None, nsi_id=None, ensi=None): # noqa: E501 + """NetSliceId - a model defined in OpenAPI + + :param snssai: The snssai of this NetSliceId. # noqa: E501 + :type snssai: Snssai + :param nsi_id: The nsi_id of this NetSliceId. # noqa: E501 + :type nsi_id: str + :param ensi: The ensi of this NetSliceId. # noqa: E501 + :type ensi: str + """ + self.openapi_types = { + 'snssai': Snssai, + 'nsi_id': str, + 'ensi': str + } + + self.attribute_map = { + 'snssai': 'snssai', + 'nsi_id': 'nsiId', + 'ensi': 'ensi' + } + + self._snssai = snssai + self._nsi_id = nsi_id + self._ensi = ensi + + @classmethod + def from_dict(cls, dikt) -> 'NetSliceId': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The NetSliceId of this NetSliceId. # noqa: E501 + :rtype: NetSliceId + """ + return util.deserialize_model(dikt, cls) + + @property + def snssai(self) -> Snssai: + """Gets the snssai of this NetSliceId. + + + :return: The snssai of this NetSliceId. + :rtype: Snssai + """ + return self._snssai + + @snssai.setter + def snssai(self, snssai: Snssai): + """Sets the snssai of this NetSliceId. + + + :param snssai: The snssai of this NetSliceId. + :type snssai: Snssai + """ + + self._snssai = snssai + + @property + def nsi_id(self) -> str: + """Gets the nsi_id of this NetSliceId. + + Contains the Identifier of the selected Network Slice instance # noqa: E501 + + :return: The nsi_id of this NetSliceId. + :rtype: str + """ + return self._nsi_id + + @nsi_id.setter + def nsi_id(self, nsi_id: str): + """Sets the nsi_id of this NetSliceId. + + Contains the Identifier of the selected Network Slice instance # noqa: E501 + + :param nsi_id: The nsi_id of this NetSliceId. + :type nsi_id: str + """ + + self._nsi_id = nsi_id + + @property + def ensi(self) -> str: + """Gets the ensi of this NetSliceId. + + Represents the External Network Slice Information that is used to identify a network slice, as specified in 3GPP TS 33.501. # noqa: E501 + + :return: The ensi of this NetSliceId. + :rtype: str + """ + return self._ensi + + @ensi.setter + def ensi(self, ensi: str): + """Sets the ensi of this NetSliceId. + + Represents the External Network Slice Information that is used to identify a network slice, as specified in 3GPP TS 33.501. # noqa: E501 + + :param ensi: The ensi of this NetSliceId. + :type ensi: str + """ + + self._ensi = ensi diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/onboarding_criteria.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/onboarding_criteria.py new file mode 100644 index 0000000000000000000000000000000000000000..ac56f5fce6f73059381de7c3c24eea4a81d0576e --- /dev/null +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/onboarding_criteria.py @@ -0,0 +1,94 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api_invoker_management import util +from api_invoker_management.models.base_model import Model +from api_invoker_management.models.related_criteria import \ + RelatedCriteria # noqa: E501 +from api_invoker_management.models.security_method import \ + SecurityMethod # noqa: E501 + + +class OnboardingCriteria(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, sec_methods=None, related_criteria=None): # noqa: E501 + """OnboardingCriteria - a model defined in OpenAPI + + :param sec_methods: The sec_methods of this OnboardingCriteria. # noqa: E501 + :type sec_methods: List[SecurityMethod] + :param related_criteria: The related_criteria of this OnboardingCriteria. # noqa: E501 + :type related_criteria: RelatedCriteria + """ + self.openapi_types = { + 'sec_methods': List[SecurityMethod], + 'related_criteria': RelatedCriteria + } + + self.attribute_map = { + 'sec_methods': 'secMethods', + 'related_criteria': 'relatedCriteria' + } + + self._sec_methods = sec_methods + self._related_criteria = related_criteria + + @classmethod + def from_dict(cls, dikt) -> 'OnboardingCriteria': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The OnboardingCriteria of this OnboardingCriteria. # noqa: E501 + :rtype: OnboardingCriteria + """ + return util.deserialize_model(dikt, cls) + + @property + def sec_methods(self) -> List[SecurityMethod]: + """Gets the sec_methods of this OnboardingCriteria. + + + :return: The sec_methods of this OnboardingCriteria. + :rtype: List[SecurityMethod] + """ + return self._sec_methods + + @sec_methods.setter + def sec_methods(self, sec_methods: List[SecurityMethod]): + """Sets the sec_methods of this OnboardingCriteria. + + + :param sec_methods: The sec_methods of this OnboardingCriteria. + :type sec_methods: List[SecurityMethod] + """ + if sec_methods is None: + raise ValueError("Invalid value for `sec_methods`, must not be `None`") # noqa: E501 + if sec_methods is not None and len(sec_methods) < 1: + raise ValueError("Invalid value for `sec_methods`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._sec_methods = sec_methods + + @property + def related_criteria(self) -> RelatedCriteria: + """Gets the related_criteria of this OnboardingCriteria. + + + :return: The related_criteria of this OnboardingCriteria. + :rtype: RelatedCriteria + """ + return self._related_criteria + + @related_criteria.setter + def related_criteria(self, related_criteria: RelatedCriteria): + """Sets the related_criteria of this OnboardingCriteria. + + + :param related_criteria: The related_criteria of this OnboardingCriteria. + :type related_criteria: RelatedCriteria + """ + + self._related_criteria = related_criteria diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/onboarding_fail_reason.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/onboarding_fail_reason.py new file mode 100644 index 0000000000000000000000000000000000000000..72f51607f54f6108c93e101b7e95cc6ad7879d51 --- /dev/null +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/onboarding_fail_reason.py @@ -0,0 +1,33 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api_invoker_management import util +from api_invoker_management.models.base_model import Model + + +class OnboardingFailReason(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self): # noqa: E501 + """OnboardingFailReason - a model defined in OpenAPI + + """ + self.openapi_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'OnboardingFailReason': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The OnboardingFailReason of this OnboardingFailReason. # noqa: E501 + :rtype: OnboardingFailReason + """ + return util.deserialize_model(dikt, cls) diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/onboarding_information.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/onboarding_information.py index 2ab7410e2e8d925876b3ff11572f5c263d5ec77d..596f0471a4796a8c8f0a416f854132321d8ad5d5 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/onboarding_information.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/onboarding_information.py @@ -3,6 +3,8 @@ from typing import Dict, List # noqa: F401 from api_invoker_management import util from api_invoker_management.models.base_model import Model +from api_invoker_management.models.onboarding_criteria import \ + OnboardingCriteria # noqa: E501 class OnboardingInformation(Model): @@ -11,7 +13,7 @@ class OnboardingInformation(Model): Do not edit the class manually. """ - def __init__(self, api_invoker_public_key=None, api_invoker_certificate=None, onboarding_secret=None): # noqa: E501 + def __init__(self, api_invoker_public_key=None, api_invoker_certificate=None, onboarding_secret=None, onboarding_criteria=None): # noqa: E501 """OnboardingInformation - a model defined in OpenAPI :param api_invoker_public_key: The api_invoker_public_key of this OnboardingInformation. # noqa: E501 @@ -20,22 +22,27 @@ class OnboardingInformation(Model): :type api_invoker_certificate: str :param onboarding_secret: The onboarding_secret of this OnboardingInformation. # noqa: E501 :type onboarding_secret: str + :param onboarding_criteria: The onboarding_criteria of this OnboardingInformation. # noqa: E501 + :type onboarding_criteria: List[OnboardingCriteria] """ self.openapi_types = { 'api_invoker_public_key': str, 'api_invoker_certificate': str, - 'onboarding_secret': str + 'onboarding_secret': str, + 'onboarding_criteria': List[OnboardingCriteria] } self.attribute_map = { 'api_invoker_public_key': 'apiInvokerPublicKey', 'api_invoker_certificate': 'apiInvokerCertificate', - 'onboarding_secret': 'onboardingSecret' + 'onboarding_secret': 'onboardingSecret', + 'onboarding_criteria': 'onboardingCriteria' } self._api_invoker_public_key = api_invoker_public_key self._api_invoker_certificate = api_invoker_certificate self._onboarding_secret = onboarding_secret + self._onboarding_criteria = onboarding_criteria @classmethod def from_dict(cls, dikt) -> 'OnboardingInformation': @@ -118,3 +125,26 @@ class OnboardingInformation(Model): """ self._onboarding_secret = onboarding_secret + + @property + def onboarding_criteria(self) -> List[OnboardingCriteria]: + """Gets the onboarding_criteria of this OnboardingInformation. + + + :return: The onboarding_criteria of this OnboardingInformation. + :rtype: List[OnboardingCriteria] + """ + return self._onboarding_criteria + + @onboarding_criteria.setter + def onboarding_criteria(self, onboarding_criteria: List[OnboardingCriteria]): + """Sets the onboarding_criteria of this OnboardingInformation. + + + :param onboarding_criteria: The onboarding_criteria of this OnboardingInformation. + :type onboarding_criteria: List[OnboardingCriteria] + """ + if onboarding_criteria is not None and len(onboarding_criteria) < 1: + raise ValueError("Invalid value for `onboarding_criteria`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._onboarding_criteria = onboarding_criteria diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/onboarding_notification.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/onboarding_notification.py index c60d37ee81c37e3ee3946bd84b558c00f4a6faba..8f5bc502a3da460cbbcbe4063353376e289d040c 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/onboarding_notification.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/onboarding_notification.py @@ -2,7 +2,8 @@ from datetime import date, datetime # noqa: F401 from typing import Dict, List # noqa: F401 from api_invoker_management import util -from api_invoker_management.models.api_invoker_enrolment_details import APIInvokerEnrolmentDetails # noqa: E501 +from api_invoker_management.models.api_invoker_enrolment_details import \ + APIInvokerEnrolmentDetails # noqa: E501 from api_invoker_management.models.api_list import APIList # noqa: E501 from api_invoker_management.models.base_model import Model @@ -59,7 +60,7 @@ class OnboardingNotification(Model): def result(self) -> bool: """Gets the result of this OnboardingNotification. - Set to \"true\" indicate successful on-boarding. Otherwise set to \"false\" # noqa: E501 + Set to \"true\" to indicate successful on-boarding. Otherwise set to \"false\". # noqa: E501 :return: The result of this OnboardingNotification. :rtype: bool @@ -70,7 +71,7 @@ class OnboardingNotification(Model): def result(self, result: bool): """Sets the result of this OnboardingNotification. - Set to \"true\" indicate successful on-boarding. Otherwise set to \"false\" # noqa: E501 + Set to \"true\" to indicate successful on-boarding. Otherwise set to \"false\". # noqa: E501 :param result: The result of this OnboardingNotification. :type result: bool diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point.py index b9f091aee8af49583cf4837a19441ba804e64afc..4169294a6015b1faed8f3fb323015f81a0ada238 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point.py @@ -4,8 +4,10 @@ from typing import Dict, List # noqa: F401 from api_invoker_management import util from api_invoker_management.models.base_model import Model from api_invoker_management.models.gad_shape import GADShape # noqa: E501 -from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 -from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 +from api_invoker_management.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from api_invoker_management.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 class Point(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_altitude.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_altitude.py index f4e1481d77c15cdaf052bef8e1f4d7fa6a94de6f..3604bf3f78b263e4733ba36f0f1bf2da494e846e 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_altitude.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_altitude.py @@ -4,8 +4,10 @@ from typing import Dict, List # noqa: F401 from api_invoker_management import util from api_invoker_management.models.base_model import Model from api_invoker_management.models.gad_shape import GADShape # noqa: E501 -from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 -from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 +from api_invoker_management.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from api_invoker_management.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 class PointAltitude(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_altitude_uncertainty.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_altitude_uncertainty.py index 5f5449dd19fbae8ed34f0520f49f3cae6db0f24e..7efb07d46f563a5944c5442609f47fbed8f8aac3 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_altitude_uncertainty.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_altitude_uncertainty.py @@ -4,9 +4,12 @@ from typing import Dict, List # noqa: F401 from api_invoker_management import util from api_invoker_management.models.base_model import Model from api_invoker_management.models.gad_shape import GADShape # noqa: E501 -from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 -from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 -from api_invoker_management.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 +from api_invoker_management.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from api_invoker_management.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 +from api_invoker_management.models.uncertainty_ellipse import \ + UncertaintyEllipse # noqa: E501 class PointAltitudeUncertainty(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_uncertainty_circle.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_uncertainty_circle.py index deb1f0a0e0907b426382f3be5e6f896c24f8ffab..a6948febb726874613e86ed57fe4255685cff2a1 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_uncertainty_circle.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_uncertainty_circle.py @@ -4,8 +4,10 @@ from typing import Dict, List # noqa: F401 from api_invoker_management import util from api_invoker_management.models.base_model import Model from api_invoker_management.models.gad_shape import GADShape # noqa: E501 -from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 -from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 +from api_invoker_management.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from api_invoker_management.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 class PointUncertaintyCircle(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_uncertainty_ellipse.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_uncertainty_ellipse.py index ad7cc40dcab7914541b66ed460595c44223c784f..e69993d8d14a6a40c98f4354b7889f7b5933481f 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_uncertainty_ellipse.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/point_uncertainty_ellipse.py @@ -4,9 +4,12 @@ from typing import Dict, List # noqa: F401 from api_invoker_management import util from api_invoker_management.models.base_model import Model from api_invoker_management.models.gad_shape import GADShape # noqa: E501 -from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 -from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 -from api_invoker_management.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 +from api_invoker_management.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from api_invoker_management.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 +from api_invoker_management.models.uncertainty_ellipse import \ + UncertaintyEllipse # noqa: E501 class PointUncertaintyEllipse(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/polygon.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/polygon.py index 0999dd1bffe06365cdf45e64ef6ab6e161796f5f..4ab4dec5f585980d6f75f5b12a0dd12edba609f3 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/polygon.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/polygon.py @@ -4,8 +4,10 @@ from typing import Dict, List # noqa: F401 from api_invoker_management import util from api_invoker_management.models.base_model import Model from api_invoker_management.models.gad_shape import GADShape # noqa: E501 -from api_invoker_management.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 -from api_invoker_management.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 +from api_invoker_management.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from api_invoker_management.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 class Polygon(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/problem_details.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/problem_details.py index f4405ce28408a513a5fd3922e27c0c054f0ab14b..a520bf77e0d840d980ed179707df3f21a763bbca 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/problem_details.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/problem_details.py @@ -4,7 +4,8 @@ from typing import Dict, List # noqa: F401 from api_invoker_management import util from api_invoker_management.models.base_model import Model -from api_invoker_management.models.invalid_param import InvalidParam # noqa: E501 +from api_invoker_management.models.invalid_param import \ + InvalidParam # noqa: E501 class ProblemDetails(Model): diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/related_criteria.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/related_criteria.py new file mode 100644 index 0000000000000000000000000000000000000000..2624bc3c0d46c39579fcdcf8dc126e2cda16feb3 --- /dev/null +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/related_criteria.py @@ -0,0 +1,119 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api_invoker_management import util +from api_invoker_management.models.api_info import ApiInfo # noqa: E501 +from api_invoker_management.models.base_model import Model + + +class RelatedCriteria(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, aef_ids=None, apis=None, service_api_categories=None): # noqa: E501 + """RelatedCriteria - a model defined in OpenAPI + + :param aef_ids: The aef_ids of this RelatedCriteria. # noqa: E501 + :type aef_ids: List[str] + :param apis: The apis of this RelatedCriteria. # noqa: E501 + :type apis: List[ApiInfo] + :param service_api_categories: The service_api_categories of this RelatedCriteria. # noqa: E501 + :type service_api_categories: List[str] + """ + self.openapi_types = { + 'aef_ids': List[str], + 'apis': List[ApiInfo], + 'service_api_categories': List[str] + } + + self.attribute_map = { + 'aef_ids': 'aefIds', + 'apis': 'apis', + 'service_api_categories': 'serviceAPICategories' + } + + self._aef_ids = aef_ids + self._apis = apis + self._service_api_categories = service_api_categories + + @classmethod + def from_dict(cls, dikt) -> 'RelatedCriteria': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The RelatedCriteria of this RelatedCriteria. # noqa: E501 + :rtype: RelatedCriteria + """ + return util.deserialize_model(dikt, cls) + + @property + def aef_ids(self) -> List[str]: + """Gets the aef_ids of this RelatedCriteria. + + + :return: The aef_ids of this RelatedCriteria. + :rtype: List[str] + """ + return self._aef_ids + + @aef_ids.setter + def aef_ids(self, aef_ids: List[str]): + """Sets the aef_ids of this RelatedCriteria. + + + :param aef_ids: The aef_ids of this RelatedCriteria. + :type aef_ids: List[str] + """ + if aef_ids is not None and len(aef_ids) < 1: + raise ValueError("Invalid value for `aef_ids`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._aef_ids = aef_ids + + @property + def apis(self) -> List[ApiInfo]: + """Gets the apis of this RelatedCriteria. + + + :return: The apis of this RelatedCriteria. + :rtype: List[ApiInfo] + """ + return self._apis + + @apis.setter + def apis(self, apis: List[ApiInfo]): + """Sets the apis of this RelatedCriteria. + + + :param apis: The apis of this RelatedCriteria. + :type apis: List[ApiInfo] + """ + if apis is not None and len(apis) < 1: + raise ValueError("Invalid value for `apis`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._apis = apis + + @property + def service_api_categories(self) -> List[str]: + """Gets the service_api_categories of this RelatedCriteria. + + + :return: The service_api_categories of this RelatedCriteria. + :rtype: List[str] + """ + return self._service_api_categories + + @service_api_categories.setter + def service_api_categories(self, service_api_categories: List[str]): + """Sets the service_api_categories of this RelatedCriteria. + + + :param service_api_categories: The service_api_categories of this RelatedCriteria. + :type service_api_categories: List[str] + """ + if service_api_categories is not None and len(service_api_categories) < 1: + raise ValueError("Invalid value for `service_api_categories`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._service_api_categories = service_api_categories diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/resource.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/resource.py index e30732ae3f2a840bf11c090562b0eba5604828b9..0c970f9fcebf47853213c14aa2b04d590662de59 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/resource.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/resource.py @@ -3,8 +3,10 @@ from typing import Dict, List # noqa: F401 from api_invoker_management import util from api_invoker_management.models.base_model import Model -from api_invoker_management.models.communication_type import CommunicationType # noqa: E501 -from api_invoker_management.models.custom_operation import CustomOperation # noqa: E501 +from api_invoker_management.models.communication_type import \ + CommunicationType # noqa: E501 +from api_invoker_management.models.custom_operation import \ + CustomOperation # noqa: E501 from api_invoker_management.models.operation import Operation # noqa: E501 diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/service_api_description.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/service_api_description.py index 1b38bd50460880ac4ce1372ab8de2448e706ee5a..5c6976bf8ede0203991b6148285a9166195c958d 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/service_api_description.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/service_api_description.py @@ -6,8 +6,11 @@ from api_invoker_management import util from api_invoker_management.models.aef_profile import AefProfile # noqa: E501 from api_invoker_management.models.api_status import ApiStatus # noqa: E501 from api_invoker_management.models.base_model import Model -from api_invoker_management.models.published_api_path import PublishedApiPath # noqa: E501 -from api_invoker_management.models.shareable_information import ShareableInformation # noqa: E501 +from api_invoker_management.models.net_slice_id import NetSliceId # noqa: E501 +from api_invoker_management.models.published_api_path import \ + PublishedApiPath # noqa: E501 +from api_invoker_management.models.shareable_information import \ + ShareableInformation # noqa: E501 class ServiceAPIDescription(Model): @@ -16,7 +19,7 @@ class ServiceAPIDescription(Model): Do not edit the class manually. """ - def __init__(self, api_name=None, api_id=None, api_status=None, aef_profiles=None, description=None, supported_features=None, shareable_info=None, service_api_category=None, api_supp_feats=None, pub_api_path=None, ccf_id=None, api_prov_name=None): # noqa: E501 + def __init__(self, api_name=None, api_id=None, api_status=None, aef_profiles=None, description=None, supported_features=None, shareable_info=None, service_api_category=None, api_supp_feats=None, pub_api_path=None, ccf_id=None, api_prov_name=None, net_slice_info=None): # noqa: E501 """ServiceAPIDescription - a model defined in OpenAPI :param api_name: The api_name of this ServiceAPIDescription. # noqa: E501 @@ -43,6 +46,8 @@ class ServiceAPIDescription(Model): :type ccf_id: str :param api_prov_name: The api_prov_name of this ServiceAPIDescription. # noqa: E501 :type api_prov_name: str + :param net_slice_info: The net_slice_info of this ServiceAPIDescription. # noqa: E501 + :type net_slice_info: List[NetSliceId] """ self.openapi_types = { 'api_name': str, @@ -56,7 +61,8 @@ class ServiceAPIDescription(Model): 'api_supp_feats': str, 'pub_api_path': PublishedApiPath, 'ccf_id': str, - 'api_prov_name': str + 'api_prov_name': str, + 'net_slice_info': List[NetSliceId] } self.attribute_map = { @@ -71,7 +77,8 @@ class ServiceAPIDescription(Model): 'api_supp_feats': 'apiSuppFeats', 'pub_api_path': 'pubApiPath', 'ccf_id': 'ccfId', - 'api_prov_name': 'apiProvName' + 'api_prov_name': 'apiProvName', + 'net_slice_info': 'netSliceInfo' } self._api_name = api_name @@ -86,6 +93,7 @@ class ServiceAPIDescription(Model): self._pub_api_path = pub_api_path self._ccf_id = ccf_id self._api_prov_name = api_prov_name + self._net_slice_info = net_slice_info @classmethod def from_dict(cls, dikt) -> 'ServiceAPIDescription': @@ -102,7 +110,7 @@ class ServiceAPIDescription(Model): def api_name(self) -> str: """Gets the api_name of this ServiceAPIDescription. - API name, it is set as {apiName} part of the URI structure as defined in clause 5.2.4 of 3GPP TS 29.122. # noqa: E501 + Contains the API name set to the value of the \"\" placeholder of the API URI as defined in clause 5.2.4 of 3GPP TS 29.122 [14]. # noqa: E501 :return: The api_name of this ServiceAPIDescription. :rtype: str @@ -113,7 +121,7 @@ class ServiceAPIDescription(Model): def api_name(self, api_name: str): """Sets the api_name of this ServiceAPIDescription. - API name, it is set as {apiName} part of the URI structure as defined in clause 5.2.4 of 3GPP TS 29.122. # noqa: E501 + Contains the API name set to the value of the \"\" placeholder of the API URI as defined in clause 5.2.4 of 3GPP TS 29.122 [14]. # noqa: E501 :param api_name: The api_name of this ServiceAPIDescription. :type api_name: str @@ -375,3 +383,28 @@ class ServiceAPIDescription(Model): """ self._api_prov_name = api_prov_name + + @property + def net_slice_info(self) -> List[NetSliceId]: + """Gets the net_slice_info of this ServiceAPIDescription. + + Represents the applicable network slice identifiers. # noqa: E501 + + :return: The net_slice_info of this ServiceAPIDescription. + :rtype: List[NetSliceId] + """ + return self._net_slice_info + + @net_slice_info.setter + def net_slice_info(self, net_slice_info: List[NetSliceId]): + """Sets the net_slice_info of this ServiceAPIDescription. + + Represents the applicable network slice identifiers. # noqa: E501 + + :param net_slice_info: The net_slice_info of this ServiceAPIDescription. + :type net_slice_info: List[NetSliceId] + """ + if net_slice_info is not None and len(net_slice_info) < 1: + raise ValueError("Invalid value for `net_slice_info`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._net_slice_info = net_slice_info diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/shareable_information.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/shareable_information.py index 7e73226d4fdbdacdf47fb3747013640bb8c0f136..042c3fdde410d6d40f85f65042c2a951dc8f2377 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/shareable_information.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/shareable_information.py @@ -47,7 +47,7 @@ class ShareableInformation(Model): def is_shareable(self) -> bool: """Gets the is_shareable of this ShareableInformation. - Set to \"true\" indicates that the service API and/or the service API category can be shared to the list of CAPIF provider domain information. Otherwise set to \"false\". # noqa: E501 + Indicates whether the service API and/or the service API category can be shared to the list of CAPIF provider domain information. true indicates that the service API and/or the service API category can be shared to the list of CAPIF provider domain information. false indicates that the service API and/or the service API category can not be shared to the list of CAPIF provider domain information. # noqa: E501 :return: The is_shareable of this ShareableInformation. :rtype: bool @@ -58,7 +58,7 @@ class ShareableInformation(Model): def is_shareable(self, is_shareable: bool): """Sets the is_shareable of this ShareableInformation. - Set to \"true\" indicates that the service API and/or the service API category can be shared to the list of CAPIF provider domain information. Otherwise set to \"false\". # noqa: E501 + Indicates whether the service API and/or the service API category can be shared to the list of CAPIF provider domain information. true indicates that the service API and/or the service API category can be shared to the list of CAPIF provider domain information. false indicates that the service API and/or the service API category can not be shared to the list of CAPIF provider domain information. # noqa: E501 :param is_shareable: The is_shareable of this ShareableInformation. :type is_shareable: bool diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/snssai.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/snssai.py new file mode 100644 index 0000000000000000000000000000000000000000..d7392ffaddb8f9f4c2437e5396053d2156a6301a --- /dev/null +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/snssai.py @@ -0,0 +1,99 @@ +import re # noqa: E501 +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api_invoker_management import util +from api_invoker_management.models.base_model import Model + + +class Snssai(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, sst=None, sd=None): # noqa: E501 + """Snssai - a model defined in OpenAPI + + :param sst: The sst of this Snssai. # noqa: E501 + :type sst: int + :param sd: The sd of this Snssai. # noqa: E501 + :type sd: str + """ + self.openapi_types = { + 'sst': int, + 'sd': str + } + + self.attribute_map = { + 'sst': 'sst', + 'sd': 'sd' + } + + self._sst = sst + self._sd = sd + + @classmethod + def from_dict(cls, dikt) -> 'Snssai': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The Snssai of this Snssai. # noqa: E501 + :rtype: Snssai + """ + return util.deserialize_model(dikt, cls) + + @property + def sst(self) -> int: + """Gets the sst of this Snssai. + + Unsigned integer, within the range 0 to 255, representing the Slice/Service Type. It indicates the expected Network Slice behaviour in terms of features and services. Values 0 to 127 correspond to the standardized SST range. Values 128 to 255 correspond to the Operator-specific range. See clause 28.4.2 of 3GPP TS 23.003. Standardized values are defined in clause 5.15.2.2 of 3GPP TS 23.501. # noqa: E501 + + :return: The sst of this Snssai. + :rtype: int + """ + return self._sst + + @sst.setter + def sst(self, sst: int): + """Sets the sst of this Snssai. + + Unsigned integer, within the range 0 to 255, representing the Slice/Service Type. It indicates the expected Network Slice behaviour in terms of features and services. Values 0 to 127 correspond to the standardized SST range. Values 128 to 255 correspond to the Operator-specific range. See clause 28.4.2 of 3GPP TS 23.003. Standardized values are defined in clause 5.15.2.2 of 3GPP TS 23.501. # noqa: E501 + + :param sst: The sst of this Snssai. + :type sst: int + """ + if sst is None: + raise ValueError("Invalid value for `sst`, must not be `None`") # noqa: E501 + if sst is not None and sst > 255: # noqa: E501 + raise ValueError("Invalid value for `sst`, must be a value less than or equal to `255`") # noqa: E501 + if sst is not None and sst < 0: # noqa: E501 + raise ValueError("Invalid value for `sst`, must be a value greater than or equal to `0`") # noqa: E501 + + self._sst = sst + + @property + def sd(self) -> str: + """Gets the sd of this Snssai. + + 3-octet string, representing the Slice Differentiator, in hexadecimal representation. Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent 4 bits. The most significant character representing the 4 most significant bits of the SD shall appear first in the string, and the character representing the 4 least significant bit of the SD shall appear last in the string. This is an optional parameter that complements the Slice/Service type(s) to allow to differentiate amongst multiple Network Slices of the same Slice/Service type. This IE shall be absent if no SD value is associated with the SST. # noqa: E501 + + :return: The sd of this Snssai. + :rtype: str + """ + return self._sd + + @sd.setter + def sd(self, sd: str): + """Sets the sd of this Snssai. + + 3-octet string, representing the Slice Differentiator, in hexadecimal representation. Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent 4 bits. The most significant character representing the 4 most significant bits of the SD shall appear first in the string, and the character representing the 4 least significant bit of the SD shall appear last in the string. This is an optional parameter that complements the Slice/Service type(s) to allow to differentiate amongst multiple Network Slices of the same Slice/Service type. This IE shall be absent if no SD value is associated with the SST. # noqa: E501 + + :param sd: The sd of this Snssai. + :type sd: str + """ + if sd is not None and not re.search(r'^[A-Fa-f0-9]{6}$', sd): # noqa: E501 + raise ValueError(r"Invalid value for `sd`, must be a follow pattern or equal to `/^[A-Fa-f0-9]{6}$/`") # noqa: E501 + + self._sd = sd diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/version.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/version.py index 9570e89f6676d5dcf3e68bd5f51bf1b7883b11fb..0bbd20f469bd3c1a97eefb962ad3cfeb326de933 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/version.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/models/version.py @@ -3,7 +3,8 @@ from typing import Dict, List # noqa: F401 from api_invoker_management import util from api_invoker_management.models.base_model import Model -from api_invoker_management.models.custom_operation import CustomOperation # noqa: E501 +from api_invoker_management.models.custom_operation import \ + CustomOperation # noqa: E501 from api_invoker_management.models.resource import Resource # noqa: E501 diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/openapi/openapi.yaml b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/openapi/openapi.yaml index 799074641c3dc13e81c534dbf1d30b604ac119fa..08eb26cb103c6599c29fbbb48690ec0bd93a6a0f 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/openapi/openapi.yaml +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/openapi/openapi.yaml @@ -1,11 +1,11 @@ openapi: 3.0.0 info: - description: "API for API invoker management. \n© 2024, 3GPP Organizational Partners\ + description: "API for API invoker management. \n© 2025, 3GPP Organizational Partners\ \ (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). \nAll rights reserved.\n" title: CAPIF_API_Invoker_Management_API - version: 1.3.0 + version: 1.4.0-alpha.5 externalDocs: - description: 3GPP TS 29.222 V18.6.0 Common API Framework for 3GPP Northbound APIs + description: 3GPP TS 29.222 V19.4.0 Common API Framework for 3GPP Northbound APIs url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.222/ servers: - url: "{apiRoot}/api-invoker-management/v1" @@ -20,7 +20,6 @@ paths: notificationDestination: '{$request.body#/notificationDestination}': post: - description: Notify the API Invoker about the onboarding completion operationId: notification_destination_post requestBody: content: @@ -30,7 +29,8 @@ paths: required: true responses: "204": - description: No Content (successful onboarding notification) + description: | + No Content. The onboarding notification is successfully received. "307": description: Temporary Redirect headers: @@ -110,8 +110,7 @@ paths: default: description: Generic Error x-callback-request: true - description: Creates a new individual API Invoker profile. - operationId: onboarded_invokers_post + operationId: create_onboarded_api_invoker requestBody: content: application/json: @@ -124,19 +123,20 @@ paths: application/json: schema: $ref: '#/components/schemas/APIInvokerEnrolmentDetails' - description: API invoker on-boarded successfully. + description: | + Created. The API Invoker is successfully on-boarded. headers: Location: description: | - Contains the URI of the newly created resource, according to the structure {apiRoot}/api-invoker-management/v1/onboardedInvokers/{onboardingId} + Contains the URI of the newly created resource. explode: false required: true schema: type: string style: simple "202": - description: The CAPIF core has accepted the Onboarding request and is processing - it. + description: | + Accepted. The CCF accepted the Onboarding request and is processing it. "400": content: application/problem+json: @@ -199,14 +199,16 @@ paths: description: Service Unavailable default: description: Generic Error - x-openapi-router-controller: api_invoker_management.controllers.default_controller + summary: Request the Creation of a new On-boarded API Invoker. + tags: + - On-boarded API Invokers (Collection) + x-openapi-router-controller: api_invoker_management.controllers.on_boarded_api_invokers_collection_controller /onboardedInvokers/{onboardingId}: delete: - description: Deletes an individual API Invoker. - operationId: onboarded_invokers_onboarding_id_delete + description: Deletes an existing Individual On-boarded API Invoker. + operationId: delete_ind_onboarded_api_invoker parameters: - - description: String identifying an individual on-boarded API invoker resource - explode: false + - explode: false in: path name: onboardingId required: true @@ -215,7 +217,8 @@ paths: style: simple responses: "204": - description: The individual API Invoker matching onboardingId was offboarded. + description: | + No Content. The Individual On-boarded API Invoker resource is successfully deleted. "307": description: Temporary Redirect headers: @@ -276,9 +279,11 @@ paths: description: Service Unavailable default: description: Generic Error - x-openapi-router-controller: api_invoker_management.controllers.default_controller + summary: Delete an existing Individual On-boarded API Invoker resource. + tags: + - Individual On-boarded API Invoker (Document) + x-openapi-router-controller: api_invoker_management.controllers.individual_on_boarded_api_invoker_document_controller patch: - description: Modify an individual API invoker details. operationId: modify_ind_api_invoke_enrolment parameters: - explode: false @@ -301,11 +306,13 @@ paths: schema: $ref: '#/components/schemas/APIInvokerEnrolmentDetails' description: | - The definition of the service API is modified successfully and a representation of the updated service API is returned in the request body. + OK. The Individual On-boarded API Invoker resource is successfully modified and the representation of the updated resource is returned in the response body. "202": - description: The request is accepted and under processing. + description: | + Accepted. The request is accepted and under processing. "204": - description: No Content. The definition of the service API is modified successfully. + description: | + No Content. The Individual On-boarded API Invoker resource is successfully modified and no content is returned in the response body. "307": description: Temporary Redirect headers: @@ -385,108 +392,12 @@ paths: default: description: Generic Error tags: - - Individual API Invoker enrolment details - x-openapi-router-controller: api_invoker_management.controllers.individual_api_invoker_enrolment_details_controller + - Individual On-boarded API Invoker (Document) + x-openapi-router-controller: api_invoker_management.controllers.individual_on_boarded_api_invoker_document_controller put: - callbacks: - notificationDestination: - '{$request.body#/notificationDestination}': - post: - description: Notify the API Invoker about the API invoker update completion - operationId: notification_destination_post - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OnboardingNotification' - required: true - responses: - "204": - description: No Content (successful API invoker update notification) - "307": - description: Temporary Redirect - headers: - Location: - description: An alternative URI of the resource. - required: true - schema: - type: string - "308": - description: Permanent Redirect - headers: - Location: - description: An alternative URI of the resource. - required: true - schema: - type: string - "400": - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: Bad request - "401": - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: Unauthorized - "403": - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: Forbidden - "404": - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: Not Found - "411": - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: Length Required - "413": - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: Content Too Large - "415": - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: Unsupported Media Type - "429": - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: Too Many Requests - "500": - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: Internal Server Error - "503": - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ProblemDetails' - description: Service Unavailable - default: - description: Generic Error - x-callback-request: true - description: Updates an individual API invoker details. - operationId: onboarded_invokers_onboarding_id_put + operationId: update_ind_onboarded_api_invoker parameters: - - description: String identifying an individual on-boarded API invoker resource - explode: false + - explode: false in: path name: onboardingId required: true @@ -498,8 +409,6 @@ paths: application/json: schema: $ref: '#/components/schemas/APIInvokerEnrolmentDetails' - description: representation of the API invoker details to be updated in CAPIF - core function required: true responses: "200": @@ -507,13 +416,14 @@ paths: application/json: schema: $ref: '#/components/schemas/APIInvokerEnrolmentDetails' - description: API invoker details updated successfully. + description: | + OK. The Individual On-boarded API Invoker resource is successfully updated and the representation of the updated resource is returned in the response body. "202": description: | - The CAPIF core has accepted the API invoker update details request and is processing it. + Accepted. The request is accepted and under processing. "204": description: | - API invoker's information updated successfully, with no content to be sent in the response body. + No Content. The Individual On-boarded API Invoker resource is successfully updated and no content is returned in the response body. "307": description: Temporary Redirect headers: @@ -592,7 +502,10 @@ paths: description: Service Unavailable default: description: Generic Error - x-openapi-router-controller: api_invoker_management.controllers.default_controller + summary: Update an existing Individual On-boarded API Invoker resource. + tags: + - Individual On-boarded API Invoker (Document) + x-openapi-router-controller: api_invoker_management.controllers.individual_on_boarded_api_invoker_document_controller components: responses: "400": @@ -675,10 +588,49 @@ components: type: string schemas: OnboardingInformation: - description: Represents on-boarding information of the API invoker. + description: Represents the on-boarding information of the API Invoker. example: apiInvokerPublicKey: apiInvokerPublicKey onboardingSecret: onboardingSecret + onboardingCriteria: + - relatedCriteria: + aefIds: + - aefIds + - aefIds + apis: + - apiName: apiName + supportedApiVersions: + - supportedApiVersions + - supportedApiVersions + - apiName: apiName + supportedApiVersions: + - supportedApiVersions + - supportedApiVersions + serviceAPICategories: + - serviceAPICategories + - serviceAPICategories + secMethods: + - PSK + - PSK + - relatedCriteria: + aefIds: + - aefIds + - aefIds + apis: + - apiName: apiName + supportedApiVersions: + - supportedApiVersions + - supportedApiVersions + - apiName: apiName + supportedApiVersions: + - supportedApiVersions + - supportedApiVersions + serviceAPICategories: + - serviceAPICategories + - serviceAPICategories + secMethods: + - PSK + - PSK apiInvokerCertificate: apiInvokerCertificate properties: apiInvokerPublicKey: @@ -695,31 +647,26 @@ components: The API Invoker's onboarding secret, provided by the CAPIF core function. title: onboardingSecret type: string + onboardingCriteria: + items: + $ref: '#/components/schemas/OnboardingCriteria' + minItems: 1 + title: onboardingCriteria + type: array required: - apiInvokerPublicKey title: OnboardingInformation type: object APIList: - description: Represents a list of APIs. + description: Represents a list of APIs with the corresponding information. example: serviceAPIDescriptions: - serviceAPICategory: serviceAPICategory ccfId: ccfId apiName: apiName - shareableInfo: - capifProvDoms: - - capifProvDoms - - capifProvDoms - isShareable: true apiProvName: apiProvName supportedFeatures: supportedFeatures description: description - apiSuppFeats: apiSuppFeats - apiId: apiId - apiStatus: - aefIds: - - aefIds - - aefIds aefProfiles: - protocol: HTTP_1_1 grantTypes: @@ -737,8 +684,8 @@ components: - start: 2001:db8:85a3::8a2e:370:7334 end: 2001:db8:85a3::8a2e:370:7334 securityMethods: - - PSK - - PSK + - null + - null versions: - apiVersion: apiVersion resources: @@ -949,8 +896,8 @@ components: - start: 2001:db8:85a3::8a2e:370:7334 end: 2001:db8:85a3::8a2e:370:7334 securityMethods: - - PSK - - PSK + - null + - null versions: - apiVersion: apiVersion resources: @@ -1145,27 +1092,38 @@ components: availability: 0 maxReqRate: 0 avalGraComp: avalGraComp - pubApiPath: - ccfIds: - - ccfIds - - ccfIds - - serviceAPICategory: serviceAPICategory - ccfId: ccfId - apiName: apiName shareableInfo: capifProvDoms: - capifProvDoms - capifProvDoms isShareable: true - apiProvName: apiProvName - supportedFeatures: supportedFeatures - description: description + netSliceInfo: + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId apiSuppFeats: apiSuppFeats apiId: apiId apiStatus: aefIds: - aefIds - aefIds + pubApiPath: + ccfIds: + - ccfIds + - ccfIds + - serviceAPICategory: serviceAPICategory + ccfId: ccfId + apiName: apiName + apiProvName: apiProvName + supportedFeatures: supportedFeatures + description: description aefProfiles: - protocol: HTTP_1_1 grantTypes: @@ -1183,8 +1141,8 @@ components: - start: 2001:db8:85a3::8a2e:370:7334 end: 2001:db8:85a3::8a2e:370:7334 securityMethods: - - PSK - - PSK + - null + - null versions: - apiVersion: apiVersion resources: @@ -1395,8 +1353,8 @@ components: - start: 2001:db8:85a3::8a2e:370:7334 end: 2001:db8:85a3::8a2e:370:7334 securityMethods: - - PSK - - PSK + - null + - null versions: - apiVersion: apiVersion resources: @@ -1591,14 +1549,36 @@ components: availability: 0 maxReqRate: 0 avalGraComp: avalGraComp + shareableInfo: + capifProvDoms: + - capifProvDoms + - capifProvDoms + isShareable: true + netSliceInfo: + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + apiSuppFeats: apiSuppFeats + apiId: apiId + apiStatus: + aefIds: + - aefIds + - aefIds pubApiPath: ccfIds: - ccfIds - ccfIds properties: serviceAPIDescriptions: - description: Represents the list of service APIs that the API Invoker is - allowed to invoke. + description: | + Represents the list of service APIs that the API Invoker is allowed to invoke. items: $ref: '#/components/schemas/ServiceAPIDescription' minItems: 1 @@ -1607,20 +1587,67 @@ components: title: APIList type: object APIInvokerEnrolmentDetails: - description: Represents information about the API Invoker that requested to - onboard. + description: Represents the onboarding information of the API Invoker. example: notificationDestination: notificationDestination supportedFeatures: supportedFeatures apiInvokerId: apiInvokerId expTime: 2000-01-23T04:56:07.000+00:00 apiInvokerInformation: apiInvokerInformation + failureReasons: + - apiName: + - apiName + - apiName + failureCode: AUTHORIZATION_ISSUE + - apiName: + - apiName + - apiName + failureCode: AUTHORIZATION_ISSUE websockNotifConfig: requestWebsocketUri: true websocketUri: websocketUri onboardingInformation: apiInvokerPublicKey: apiInvokerPublicKey onboardingSecret: onboardingSecret + onboardingCriteria: + - relatedCriteria: + aefIds: + - aefIds + - aefIds + apis: + - apiName: apiName + supportedApiVersions: + - supportedApiVersions + - supportedApiVersions + - apiName: apiName + supportedApiVersions: + - supportedApiVersions + - supportedApiVersions + serviceAPICategories: + - serviceAPICategories + - serviceAPICategories + secMethods: + - PSK + - PSK + - relatedCriteria: + aefIds: + - aefIds + - aefIds + apis: + - apiName: apiName + supportedApiVersions: + - supportedApiVersions + - supportedApiVersions + - apiName: apiName + supportedApiVersions: + - supportedApiVersions + - supportedApiVersions + serviceAPICategories: + - serviceAPICategories + - serviceAPICategories + secMethods: + - PSK + - PSK apiInvokerCertificate: apiInvokerCertificate requestTestNotification: true apiList: @@ -1628,20 +1655,9 @@ components: - serviceAPICategory: serviceAPICategory ccfId: ccfId apiName: apiName - shareableInfo: - capifProvDoms: - - capifProvDoms - - capifProvDoms - isShareable: true apiProvName: apiProvName supportedFeatures: supportedFeatures description: description - apiSuppFeats: apiSuppFeats - apiId: apiId - apiStatus: - aefIds: - - aefIds - - aefIds aefProfiles: - protocol: HTTP_1_1 grantTypes: @@ -1659,8 +1675,8 @@ components: - start: 2001:db8:85a3::8a2e:370:7334 end: 2001:db8:85a3::8a2e:370:7334 securityMethods: - - PSK - - PSK + - null + - null versions: - apiVersion: apiVersion resources: @@ -1871,8 +1887,8 @@ components: - start: 2001:db8:85a3::8a2e:370:7334 end: 2001:db8:85a3::8a2e:370:7334 securityMethods: - - PSK - - PSK + - null + - null versions: - apiVersion: apiVersion resources: @@ -2067,27 +2083,38 @@ components: availability: 0 maxReqRate: 0 avalGraComp: avalGraComp - pubApiPath: - ccfIds: - - ccfIds - - ccfIds - - serviceAPICategory: serviceAPICategory - ccfId: ccfId - apiName: apiName shareableInfo: capifProvDoms: - capifProvDoms - capifProvDoms isShareable: true - apiProvName: apiProvName - supportedFeatures: supportedFeatures - description: description + netSliceInfo: + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId apiSuppFeats: apiSuppFeats apiId: apiId apiStatus: aefIds: - aefIds - aefIds + pubApiPath: + ccfIds: + - ccfIds + - ccfIds + - serviceAPICategory: serviceAPICategory + ccfId: ccfId + apiName: apiName + apiProvName: apiProvName + supportedFeatures: supportedFeatures + description: description aefProfiles: - protocol: HTTP_1_1 grantTypes: @@ -2105,8 +2132,8 @@ components: - start: 2001:db8:85a3::8a2e:370:7334 end: 2001:db8:85a3::8a2e:370:7334 securityMethods: - - PSK - - PSK + - null + - null versions: - apiVersion: apiVersion resources: @@ -2317,8 +2344,8 @@ components: - start: 2001:db8:85a3::8a2e:370:7334 end: 2001:db8:85a3::8a2e:370:7334 securityMethods: - - PSK - - PSK + - null + - null versions: - apiVersion: apiVersion resources: @@ -2513,6 +2540,28 @@ components: availability: 0 maxReqRate: 0 avalGraComp: avalGraComp + shareableInfo: + capifProvDoms: + - capifProvDoms + - capifProvDoms + isShareable: true + netSliceInfo: + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + apiSuppFeats: apiSuppFeats + apiId: apiId + apiStatus: + aefIds: + - aefIds + - aefIds pubApiPath: ccfIds: - ccfIds @@ -2532,7 +2581,7 @@ components: type: string requestTestNotification: description: | - Set to true by Subscriber to request the CAPIF core function to send a test notification as defined in in clause 7.6. Set to false or omitted otherwise. + Set to true to request the CCF to send a test notification as defined in in clause 7.6. Set to false or omitted otherwise. title: requestTestNotification type: boolean websockNotifConfig: @@ -2555,13 +2604,19 @@ components: pattern: "^[A-Fa-f0-9]*$" title: SupportedFeatures type: string + failureReasons: + items: + $ref: '#/components/schemas/EnrolFailReason' + minItems: 1 + title: failureReasons + type: array required: - notificationDestination - onboardingInformation title: APIInvokerEnrolmentDetails type: object OnboardingNotification: - description: Represents a notification of on-boarding or update result. + description: Represents a notification of on-boarding creation or update result. example: result: true apiInvokerEnrolmentDetails: @@ -2570,12 +2625,60 @@ components: apiInvokerId: apiInvokerId expTime: 2000-01-23T04:56:07.000+00:00 apiInvokerInformation: apiInvokerInformation + failureReasons: + - apiName: + - apiName + - apiName + failureCode: AUTHORIZATION_ISSUE + - apiName: + - apiName + - apiName + failureCode: AUTHORIZATION_ISSUE websockNotifConfig: requestWebsocketUri: true websocketUri: websocketUri onboardingInformation: apiInvokerPublicKey: apiInvokerPublicKey onboardingSecret: onboardingSecret + onboardingCriteria: + - relatedCriteria: + aefIds: + - aefIds + - aefIds + apis: + - apiName: apiName + supportedApiVersions: + - supportedApiVersions + - supportedApiVersions + - apiName: apiName + supportedApiVersions: + - supportedApiVersions + - supportedApiVersions + serviceAPICategories: + - serviceAPICategories + - serviceAPICategories + secMethods: + - PSK + - PSK + - relatedCriteria: + aefIds: + - aefIds + - aefIds + apis: + - apiName: apiName + supportedApiVersions: + - supportedApiVersions + - supportedApiVersions + - apiName: apiName + supportedApiVersions: + - supportedApiVersions + - supportedApiVersions + serviceAPICategories: + - serviceAPICategories + - serviceAPICategories + secMethods: + - PSK + - PSK apiInvokerCertificate: apiInvokerCertificate requestTestNotification: true apiList: @@ -2583,20 +2686,9 @@ components: - serviceAPICategory: serviceAPICategory ccfId: ccfId apiName: apiName - shareableInfo: - capifProvDoms: - - capifProvDoms - - capifProvDoms - isShareable: true apiProvName: apiProvName supportedFeatures: supportedFeatures description: description - apiSuppFeats: apiSuppFeats - apiId: apiId - apiStatus: - aefIds: - - aefIds - - aefIds aefProfiles: - protocol: HTTP_1_1 grantTypes: @@ -2614,8 +2706,8 @@ components: - start: 2001:db8:85a3::8a2e:370:7334 end: 2001:db8:85a3::8a2e:370:7334 securityMethods: - - PSK - - PSK + - null + - null versions: - apiVersion: apiVersion resources: @@ -2826,8 +2918,8 @@ components: - start: 2001:db8:85a3::8a2e:370:7334 end: 2001:db8:85a3::8a2e:370:7334 securityMethods: - - PSK - - PSK + - null + - null versions: - apiVersion: apiVersion resources: @@ -3022,27 +3114,38 @@ components: availability: 0 maxReqRate: 0 avalGraComp: avalGraComp - pubApiPath: - ccfIds: - - ccfIds - - ccfIds - - serviceAPICategory: serviceAPICategory - ccfId: ccfId - apiName: apiName shareableInfo: capifProvDoms: - capifProvDoms - capifProvDoms isShareable: true - apiProvName: apiProvName - supportedFeatures: supportedFeatures - description: description + netSliceInfo: + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId apiSuppFeats: apiSuppFeats apiId: apiId apiStatus: aefIds: - aefIds - aefIds + pubApiPath: + ccfIds: + - ccfIds + - ccfIds + - serviceAPICategory: serviceAPICategory + ccfId: ccfId + apiName: apiName + apiProvName: apiProvName + supportedFeatures: supportedFeatures + description: description aefProfiles: - protocol: HTTP_1_1 grantTypes: @@ -3060,8 +3163,8 @@ components: - start: 2001:db8:85a3::8a2e:370:7334 end: 2001:db8:85a3::8a2e:370:7334 securityMethods: - - PSK - - PSK + - null + - null versions: - apiVersion: apiVersion resources: @@ -3272,8 +3375,8 @@ components: - start: 2001:db8:85a3::8a2e:370:7334 end: 2001:db8:85a3::8a2e:370:7334 securityMethods: - - PSK - - PSK + - null + - null versions: - apiVersion: apiVersion resources: @@ -3468,6 +3571,28 @@ components: availability: 0 maxReqRate: 0 avalGraComp: avalGraComp + shareableInfo: + capifProvDoms: + - capifProvDoms + - capifProvDoms + isShareable: true + netSliceInfo: + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + apiSuppFeats: apiSuppFeats + apiId: apiId + apiStatus: + aefIds: + - aefIds + - aefIds pubApiPath: ccfIds: - ccfIds @@ -3478,20 +3603,9 @@ components: - serviceAPICategory: serviceAPICategory ccfId: ccfId apiName: apiName - shareableInfo: - capifProvDoms: - - capifProvDoms - - capifProvDoms - isShareable: true apiProvName: apiProvName supportedFeatures: supportedFeatures description: description - apiSuppFeats: apiSuppFeats - apiId: apiId - apiStatus: - aefIds: - - aefIds - - aefIds aefProfiles: - protocol: HTTP_1_1 grantTypes: @@ -3509,8 +3623,8 @@ components: - start: 2001:db8:85a3::8a2e:370:7334 end: 2001:db8:85a3::8a2e:370:7334 securityMethods: - - PSK - - PSK + - null + - null versions: - apiVersion: apiVersion resources: @@ -3721,8 +3835,8 @@ components: - start: 2001:db8:85a3::8a2e:370:7334 end: 2001:db8:85a3::8a2e:370:7334 securityMethods: - - PSK - - PSK + - null + - null versions: - apiVersion: apiVersion resources: @@ -3917,27 +4031,38 @@ components: availability: 0 maxReqRate: 0 avalGraComp: avalGraComp - pubApiPath: - ccfIds: - - ccfIds - - ccfIds - - serviceAPICategory: serviceAPICategory - ccfId: ccfId - apiName: apiName shareableInfo: capifProvDoms: - capifProvDoms - capifProvDoms isShareable: true - apiProvName: apiProvName - supportedFeatures: supportedFeatures - description: description + netSliceInfo: + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId apiSuppFeats: apiSuppFeats apiId: apiId apiStatus: aefIds: - aefIds - aefIds + pubApiPath: + ccfIds: + - ccfIds + - ccfIds + - serviceAPICategory: serviceAPICategory + ccfId: ccfId + apiName: apiName + apiProvName: apiProvName + supportedFeatures: supportedFeatures + description: description aefProfiles: - protocol: HTTP_1_1 grantTypes: @@ -3955,8 +4080,8 @@ components: - start: 2001:db8:85a3::8a2e:370:7334 end: 2001:db8:85a3::8a2e:370:7334 securityMethods: - - PSK - - PSK + - null + - null versions: - apiVersion: apiVersion resources: @@ -4167,8 +4292,8 @@ components: - start: 2001:db8:85a3::8a2e:370:7334 end: 2001:db8:85a3::8a2e:370:7334 securityMethods: - - PSK - - PSK + - null + - null versions: - apiVersion: apiVersion resources: @@ -4363,14 +4488,36 @@ components: availability: 0 maxReqRate: 0 avalGraComp: avalGraComp + shareableInfo: + capifProvDoms: + - capifProvDoms + - capifProvDoms + isShareable: true + netSliceInfo: + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + apiSuppFeats: apiSuppFeats + apiId: apiId + apiStatus: + aefIds: + - aefIds + - aefIds pubApiPath: ccfIds: - ccfIds - ccfIds properties: result: - description: Set to "true" indicate successful on-boarding. Otherwise set - to "false" + description: Set to "true" to indicate successful on-boarding. Otherwise + set to "false". title: result type: boolean resourceLocation: @@ -4410,6 +4557,154 @@ components: type: string title: APIInvokerEnrolmentDetailsPatch type: object + OnboardingCriteria: + description: Represents the onboarding criteria information. + example: + relatedCriteria: + aefIds: + - aefIds + - aefIds + apis: + - apiName: apiName + supportedApiVersions: + - supportedApiVersions + - supportedApiVersions + - apiName: apiName + supportedApiVersions: + - supportedApiVersions + - supportedApiVersions + serviceAPICategories: + - serviceAPICategories + - serviceAPICategories + secMethods: + - PSK + - PSK + properties: + secMethods: + items: + $ref: '#/components/schemas/SecurityMethod' + minItems: 1 + title: secMethods + type: array + relatedCriteria: + $ref: '#/components/schemas/RelatedCriteria' + required: + - secMethods + title: OnboardingCriteria + type: object + RelatedCriteria: + anyOf: + - required: [aefIds] + - required: [apis] + - required: [serviceAPICategories] + not: + required: [apis, serviceAPICategories] + description: Represents onboarding related criteria. + example: + aefIds: + - aefIds + - aefIds + apis: + - apiName: apiName + supportedApiVersions: + - supportedApiVersions + - supportedApiVersions + - apiName: apiName + supportedApiVersions: + - supportedApiVersions + - supportedApiVersions + serviceAPICategories: + - serviceAPICategories + - serviceAPICategories + nullable: true + properties: + aefIds: + items: + type: string + minItems: 1 + title: aefIds + type: array + apis: + items: + $ref: '#/components/schemas/ApiInfo' + minItems: 1 + title: apis + type: array + serviceAPICategories: + items: + type: string + minItems: 1 + title: serviceAPICategories + type: array + title: RelatedCriteria + type: object + ApiInfo: + description: Represents service API identification related information. + example: + apiName: apiName + supportedApiVersions: + - supportedApiVersions + - supportedApiVersions + properties: + apiName: + title: apiName + type: string + supportedApiVersions: + items: + type: string + minItems: 1 + title: supportedApiVersions + type: array + required: + - apiName + title: ApiInfo + type: object + EnrolFailReason: + description: Represents the failure reason for not those APIs not enrolled successfully. + example: + apiName: + - apiName + - apiName + failureCode: AUTHORIZATION_ISSUE + properties: + apiName: + items: + type: string + title: apiName + type: array + failureCode: + $ref: '#/components/schemas/EnrolFailCause' + required: + - apiName + - failureCode + title: EnrolFailReason + type: object + EnrolFailCause: + enum: + - AUTHORIZATION_ISSUE + - ONBOARDING_CRI_NOT_MET + - UNSPECIFIED + type: string + description: "Represents API Invoker's per API enrollment failure code. \n\ + Possible values are:\n- AUTHORIZATION_ISSUE: Indicates that the service API\ + \ enrollment failed because the service\n API is not authorized for the API\ + \ Invoker.\n- ONBOARDING_CRI_NOT_MET: Indicates that the service API entollment\ + \ failed because the\n onboarding criteria not met for this service API for\ + \ the API Invoker.\n- UNSPECIFIED: Indicates that the service API enrollment\ + \ failed due to an unspecified\n reason.\n" + title: EnrolFailCause + OnboardingFailReason: + enum: + - API_INVOKER_NOT_ALLOWED + - ONBOARDING_CRI_NOT_MET + - OTHER + type: string + description: "Represents the API Invoker onboarding failure reason. \nPossible\ + \ values are:\n- API_INVOKER_NOT_ALLOWED: Indicates that the onboarding of\ + \ the API Invoker failed because\n the API Invoker is not allowed.\n- ONBOARDING_CRI_NOT_MET:\ + \ Indicates that the onboarding of the API Invoker failed because\n the onboarding\ + \ criteria is not met.\n- OTHER: Indicates that the onboarding of the API\ + \ Invoker failed because of other reasons.\n" ProblemDetails: description: Represents additional information and details on an error response. properties: @@ -4484,20 +4779,9 @@ components: serviceAPICategory: serviceAPICategory ccfId: ccfId apiName: apiName - shareableInfo: - capifProvDoms: - - capifProvDoms - - capifProvDoms - isShareable: true apiProvName: apiProvName supportedFeatures: supportedFeatures description: description - apiSuppFeats: apiSuppFeats - apiId: apiId - apiStatus: - aefIds: - - aefIds - - aefIds aefProfiles: - protocol: HTTP_1_1 grantTypes: @@ -4515,8 +4799,8 @@ components: - start: 2001:db8:85a3::8a2e:370:7334 end: 2001:db8:85a3::8a2e:370:7334 securityMethods: - - PSK - - PSK + - null + - null versions: - apiVersion: apiVersion resources: @@ -4727,8 +5011,8 @@ components: - start: 2001:db8:85a3::8a2e:370:7334 end: 2001:db8:85a3::8a2e:370:7334 securityMethods: - - PSK - - PSK + - null + - null versions: - apiVersion: apiVersion resources: @@ -4923,6 +5207,28 @@ components: availability: 0 maxReqRate: 0 avalGraComp: avalGraComp + shareableInfo: + capifProvDoms: + - capifProvDoms + - capifProvDoms + isShareable: true + netSliceInfo: + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + apiSuppFeats: apiSuppFeats + apiId: apiId + apiStatus: + aefIds: + - aefIds + - aefIds pubApiPath: ccfIds: - ccfIds @@ -4930,7 +5236,7 @@ components: properties: apiName: description: | - API name, it is set as {apiName} part of the URI structure as defined in clause 5.2.4 of 3GPP TS 29.122. + Contains the API name set to the value of the "" placeholder of the API URI as defined in clause 5.2.4 of 3GPP TS 29.122 [14]. title: apiName type: string apiId: @@ -4980,6 +5286,13 @@ components: description: Represents the API provider name. title: apiProvName type: string + netSliceInfo: + description: Represents the applicable network slice identifiers. + items: + $ref: '#/components/schemas/NetSliceId' + minItems: 1 + title: netSliceInfo + type: array required: - apiName title: ServiceAPIDescription @@ -4993,8 +5306,9 @@ components: - aefIds properties: aefIds: - description: | - Indicates the list of AEF ID(s) where the API is active. If this attribute is omitted, the API is inactive at all AEF(s) defined in the "aefProfiles" attribute within the ServiceAPIDescription data structure. + description: "Indicates the list of AEF ID(s) where the API is active. If\ + \ an empty array is provided, it indicates that the API is inactive in\ + \ all AEF(s). \n" items: type: string title: aefIds @@ -5022,8 +5336,8 @@ components: - start: 2001:db8:85a3::8a2e:370:7334 end: 2001:db8:85a3::8a2e:370:7334 securityMethods: - - PSK - - PSK + - null + - null versions: - apiVersion: apiVersion resources: @@ -5219,7 +5533,7 @@ components: maxReqRate: 0 avalGraComp: avalGraComp nullable: true - oneOf: + oneOf: - required: ["domainName"] - required: ["interfaceDescriptions"] - {} @@ -5706,7 +6020,7 @@ components: title: ServiceKpis type: object IpAddrRange: - anyOf: + anyOf: - required: ["ueIpv4AddrRanges"] - required: ["ueIpv6AddrRanges"] description: Represents the list of public IP ranges @@ -5750,7 +6064,7 @@ components: properties: isShareable: description: | - Set to "true" indicates that the service API and/or the service API category can be shared to the list of CAPIF provider domain information. Otherwise set to "false". + Indicates whether the service API and/or the service API category can be shared to the list of CAPIF provider domain information. true indicates that the service API and/or the service API category can be shared to the list of CAPIF provider domain information. false indicates that the service API and/or the service API category can not be shared to the list of CAPIF provider domain information. title: isShareable type: boolean capifProvDoms: @@ -5825,6 +6139,39 @@ components: nullable: true title: expTime type: string + NetSliceId: + description: | + Represents the network slice identification information. + example: + ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + nullable: true + oneOf: + - required: ["snssai"] + - required: ["nsiId"] + - required: ["ensi"] + properties: + snssai: + $ref: '#/components/schemas/Snssai' + nsiId: + description: Contains the Identifier of the selected Network Slice instance + title: NsiId + type: string + ensi: + description: | + Represents the External Network Slice Information that is used to identify a network slice, as specified in 3GPP TS 33.501. + title: Ensi + type: string + title: NetSliceId + type: object + Ensi: + description: | + Represents the External Network Slice Information that is used to identify a network slice, as specified in 3GPP TS 33.501. + title: Ensi + type: string OAuthGrantType: enum: - CLIENT_CREDENTIALS @@ -6006,13 +6353,13 @@ components: type: object GeographicArea: anyOf: - - $ref: '#/components/schemas/Point' - - $ref: '#/components/schemas/PointUncertaintyCircle' - - $ref: '#/components/schemas/PointUncertaintyEllipse' - - $ref: '#/components/schemas/Polygon' - - $ref: '#/components/schemas/PointAltitude' - - $ref: '#/components/schemas/PointAltitudeUncertainty' - - $ref: '#/components/schemas/EllipsoidArc' + - required: ["Point"] + - required: ["PointUncertaintyCircle"] + - required: ["PointUncertaintyEllipse"] + - required: ["Polygon"] + - required: ["PointAltitude"] + - required: ["PointAltitudeUncertainty"] + - required: ["EllipsoidArc"] description: Geographic area specified by different shape. title: GeographicArea Point: @@ -6455,8 +6802,49 @@ components: example: 2001:db8:85a3::8a2e:370:7334 title: Ipv6Addr_1 type: string + Snssai: + description: | + When Snssai needs to be converted to string (e.g. when used in maps as key), the string shall be composed of one to three digits "sst" optionally followed by "-" and 6 hexadecimal digits "sd". + example: + sd: sd + sst: 237 + properties: + sst: + description: "Unsigned integer, within the range 0 to 255, representing\ + \ the Slice/Service Type. It indicates the expected Network Slice behaviour\ + \ in terms of features and services. Values 0 to 127 correspond to the\ + \ standardized SST range. Values 128 to 255 correspond to the Operator-specific\ + \ range. See clause 28.4.2 of 3GPP TS 23.003. Standardized values are\ + \ defined in clause 5.15.2.2 of 3GPP TS 23.501. \n" + maximum: 255 + minimum: 0 + title: sst + type: integer + sd: + description: | + 3-octet string, representing the Slice Differentiator, in hexadecimal representation. Each character in the string shall take a value of "0" to "9", "a" to "f" or "A" to "F" and shall represent 4 bits. The most significant character representing the 4 most significant bits of the SD shall appear first in the string, and the character representing the 4 least significant bit of the SD shall appear last in the string. This is an optional parameter that complements the Slice/Service type(s) to allow to differentiate amongst multiple Network Slices of the same Slice/Service type. This IE shall be absent if no SD value is associated with the SST. + pattern: "^[A-Fa-f0-9]{6}$" + title: sd + type: string + required: + - sst + title: Snssai + type: object + NsiId: + description: Contains the Identifier of the selected Network Slice instance + title: NsiId + type: string Float: description: string with format 'float' as defined in OpenAPI. format: float title: Float type: number + securitySchemes: + oAuth2ClientCredentials: + flows: + clientCredentials: + scopes: {} + tokenUrl: "{tokenUrl}" + type: oauth2 + x-tokenInfoFunc: api_invoker_management.controllers.security_controller.info_from_oAuth2ClientCredentials + x-scopeValidateFunc: api_invoker_management.controllers.security_controller.validate_scope_oAuth2ClientCredentials diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/test/test_default_controller.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/test/test_default_controller.py deleted file mode 100644 index 0c5bab82ac203067c4f011c9b5d38672ef9d7329..0000000000000000000000000000000000000000 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/test/test_default_controller.py +++ /dev/null @@ -1,67 +0,0 @@ -import unittest - -from api_invoker_management.models.api_invoker_enrolment_details import APIInvokerEnrolmentDetails # noqa: E501 -from api_invoker_management.models.problem_details import ProblemDetails # noqa: E501 -from api_invoker_management.test import BaseTestCase -from flask import json - - -class TestDefaultController(BaseTestCase): - """DefaultController integration test stubs""" - - def test_onboarded_invokers_onboarding_id_delete(self): - """Test case for onboarded_invokers_onboarding_id_delete - - - """ - headers = { - 'Accept': 'application/problem+json', - } - response = self.client.open( - '/api-invoker-management/v1/onboardedInvokers/{onboarding_id}'.format(onboarding_id='onboarding_id_example'), - method='DELETE', - headers=headers) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_onboarded_invokers_onboarding_id_put(self): - """Test case for onboarded_invokers_onboarding_id_put - - - """ - api_invoker_enrolment_details = {"notificationDestination":"notificationDestination","supportedFeatures":"supportedFeatures","apiInvokerId":"apiInvokerId","expTime":"2000-01-23T04:56:07.000+00:00","apiInvokerInformation":"apiInvokerInformation","websockNotifConfig":{"requestWebsocketUri":True,"websocketUri":"websocketUri"},"onboardingInformation":{"apiInvokerPublicKey":"apiInvokerPublicKey","onboardingSecret":"onboardingSecret","apiInvokerCertificate":"apiInvokerCertificate"},"requestTestNotification":True,"apiList":{"serviceAPIDescriptions":[{"serviceAPICategory":"serviceAPICategory","ccfId":"ccfId","apiName":"apiName","shareableInfo":{"capifProvDoms":["capifProvDoms","capifProvDoms"],"isShareable":True},"apiProvName":"apiProvName","supportedFeatures":"supportedFeatures","description":"description","apiSuppFeats":"apiSuppFeats","apiId":"apiId","apiStatus":{"aefIds":["aefIds","aefIds"]},"aefProfiles":[{"protocol":"HTTP_1_1","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}},{"protocol":"HTTP_1_1","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}}],"pubApiPath":{"ccfIds":["ccfIds","ccfIds"]}},{"serviceAPICategory":"serviceAPICategory","ccfId":"ccfId","apiName":"apiName","shareableInfo":{"capifProvDoms":["capifProvDoms","capifProvDoms"],"isShareable":True},"apiProvName":"apiProvName","supportedFeatures":"supportedFeatures","description":"description","apiSuppFeats":"apiSuppFeats","apiId":"apiId","apiStatus":{"aefIds":["aefIds","aefIds"]},"aefProfiles":[{"protocol":"HTTP_1_1","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}},{"protocol":"HTTP_1_1","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}}],"pubApiPath":{"ccfIds":["ccfIds","ccfIds"]}}]}} - headers = { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - } - response = self.client.open( - '/api-invoker-management/v1/onboardedInvokers/{onboarding_id}'.format(onboarding_id='onboarding_id_example'), - method='PUT', - headers=headers, - data=json.dumps(api_invoker_enrolment_details), - content_type='application/json') - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_onboarded_invokers_post(self): - """Test case for onboarded_invokers_post - - - """ - api_invoker_enrolment_details = {"notificationDestination":"notificationDestination","supportedFeatures":"supportedFeatures","apiInvokerId":"apiInvokerId","expTime":"2000-01-23T04:56:07.000+00:00","apiInvokerInformation":"apiInvokerInformation","websockNotifConfig":{"requestWebsocketUri":True,"websocketUri":"websocketUri"},"onboardingInformation":{"apiInvokerPublicKey":"apiInvokerPublicKey","onboardingSecret":"onboardingSecret","apiInvokerCertificate":"apiInvokerCertificate"},"requestTestNotification":True,"apiList":{"serviceAPIDescriptions":[{"serviceAPICategory":"serviceAPICategory","ccfId":"ccfId","apiName":"apiName","shareableInfo":{"capifProvDoms":["capifProvDoms","capifProvDoms"],"isShareable":True},"apiProvName":"apiProvName","supportedFeatures":"supportedFeatures","description":"description","apiSuppFeats":"apiSuppFeats","apiId":"apiId","apiStatus":{"aefIds":["aefIds","aefIds"]},"aefProfiles":[{"protocol":"HTTP_1_1","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}},{"protocol":"HTTP_1_1","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}}],"pubApiPath":{"ccfIds":["ccfIds","ccfIds"]}},{"serviceAPICategory":"serviceAPICategory","ccfId":"ccfId","apiName":"apiName","shareableInfo":{"capifProvDoms":["capifProvDoms","capifProvDoms"],"isShareable":True},"apiProvName":"apiProvName","supportedFeatures":"supportedFeatures","description":"description","apiSuppFeats":"apiSuppFeats","apiId":"apiId","apiStatus":{"aefIds":["aefIds","aefIds"]},"aefProfiles":[{"protocol":"HTTP_1_1","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}},{"protocol":"HTTP_1_1","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}}],"pubApiPath":{"ccfIds":["ccfIds","ccfIds"]}}]}} - headers = { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - } - response = self.client.open( - '/api-invoker-management/v1/onboardedInvokers', - method='POST', - headers=headers, - data=json.dumps(api_invoker_enrolment_details), - content_type='application/json') - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - -if __name__ == '__main__': - unittest.main() diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/test/test_individual_api_invoker_enrolment_details_controller.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/test/test_individual_api_invoker_enrolment_details_controller.py deleted file mode 100644 index 1506dfbb65b41f903bc12b418c5a006d7f9edd0c..0000000000000000000000000000000000000000 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/test/test_individual_api_invoker_enrolment_details_controller.py +++ /dev/null @@ -1,35 +0,0 @@ -import unittest - -from api_invoker_management.models.api_invoker_enrolment_details import APIInvokerEnrolmentDetails # noqa: E501 -from api_invoker_management.models.api_invoker_enrolment_details_patch import \ - APIInvokerEnrolmentDetailsPatch # noqa: E501 -from api_invoker_management.models.problem_details import ProblemDetails # noqa: E501 -from api_invoker_management.test import BaseTestCase -from flask import json - - -class TestIndividualAPIInvokerEnrolmentDetailsController(BaseTestCase): - """IndividualAPIInvokerEnrolmentDetailsController integration test stubs""" - - def test_modify_ind_api_invoke_enrolment(self): - """Test case for modify_ind_api_invoke_enrolment - - - """ - api_invoker_enrolment_details_patch = openapi_server.APIInvokerEnrolmentDetailsPatch() - headers = { - 'Accept': 'application/json', - 'Content-Type': 'application/merge-patch+json', - } - response = self.client.open( - '/api-invoker-management/v1/onboardedInvokers/{onboarding_id}'.format(onboarding_id='onboarding_id_example'), - method='PATCH', - headers=headers, - data=json.dumps(api_invoker_enrolment_details_patch), - content_type='application/merge-patch+json') - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - -if __name__ == '__main__': - unittest.main() diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/test/test_individual_on_boarded_api_invoker_document_controller.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/test/test_individual_on_boarded_api_invoker_document_controller.py new file mode 100644 index 0000000000000000000000000000000000000000..c116f028dc2e06ccfd6552de4675af4229328d0c --- /dev/null +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/test/test_individual_on_boarded_api_invoker_document_controller.py @@ -0,0 +1,71 @@ +import unittest + +from api_invoker_management.models.api_invoker_enrolment_details import \ + APIInvokerEnrolmentDetails # noqa: E501 +from api_invoker_management.models.api_invoker_enrolment_details_patch import \ + APIInvokerEnrolmentDetailsPatch # noqa: E501 +from api_invoker_management.models.problem_details import \ + ProblemDetails # noqa: E501 +from api_invoker_management.test import BaseTestCase +from flask import json + + +class TestIndividualOnBoardedAPIInvokerDocumentController(BaseTestCase): + """IndividualOnBoardedAPIInvokerDocumentController integration test stubs""" + + def test_delete_ind_onboarded_api_invoker(self): + """Test case for delete_ind_onboarded_api_invoker + + Delete an existing Individual On-boarded API Invoker resource. + """ + headers = { + 'Accept': 'application/problem+json', + } + response = self.client.open( + '/api-invoker-management/v1/onboardedInvokers/{onboarding_id}'.format(onboarding_id='onboarding_id_example'), + method='DELETE', + headers=headers) + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_modify_ind_api_invoke_enrolment(self): + """Test case for modify_ind_api_invoke_enrolment + + + """ + api_invoker_enrolment_details_patch = openapi_server.APIInvokerEnrolmentDetailsPatch() + headers = { + 'Accept': 'application/json', + 'Content-Type': 'application/merge-patch+json', + } + response = self.client.open( + '/api-invoker-management/v1/onboardedInvokers/{onboarding_id}'.format(onboarding_id='onboarding_id_example'), + method='PATCH', + headers=headers, + data=json.dumps(api_invoker_enrolment_details_patch), + content_type='application/merge-patch+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_update_ind_onboarded_api_invoker(self): + """Test case for update_ind_onboarded_api_invoker + + Update an existing Individual On-boarded API Invoker resource. + """ + api_invoker_enrolment_details = {"notificationDestination":"notificationDestination","supportedFeatures":"supportedFeatures","apiInvokerId":"apiInvokerId","expTime":"2000-01-23T04:56:07.000+00:00","apiInvokerInformation":"apiInvokerInformation","failureReasons":[{"apiName":["apiName","apiName"],"failureCode":"AUTHORIZATION_ISSUE"},{"apiName":["apiName","apiName"],"failureCode":"AUTHORIZATION_ISSUE"}],"websockNotifConfig":{"requestWebsocketUri":True,"websocketUri":"websocketUri"},"onboardingInformation":{"apiInvokerPublicKey":"apiInvokerPublicKey","onboardingSecret":"onboardingSecret","onboardingCriteria":[{"relatedCriteria":{"aefIds":["aefIds","aefIds"],"apis":[{"apiName":"apiName","supportedApiVersions":["supportedApiVersions","supportedApiVersions"]},{"apiName":"apiName","supportedApiVersions":["supportedApiVersions","supportedApiVersions"]}],"serviceAPICategories":["serviceAPICategories","serviceAPICategories"]},"secMethods":["PSK","PSK"]},{"relatedCriteria":{"aefIds":["aefIds","aefIds"],"apis":[{"apiName":"apiName","supportedApiVersions":["supportedApiVersions","supportedApiVersions"]},{"apiName":"apiName","supportedApiVersions":["supportedApiVersions","supportedApiVersions"]}],"serviceAPICategories":["serviceAPICategories","serviceAPICategories"]},"secMethods":["PSK","PSK"]}],"apiInvokerCertificate":"apiInvokerCertificate"},"requestTestNotification":True,"apiList":{"serviceAPIDescriptions":[{"serviceAPICategory":"serviceAPICategory","ccfId":"ccfId","apiName":"apiName","apiProvName":"apiProvName","supportedFeatures":"supportedFeatures","description":"description","aefProfiles":[{"protocol":"HTTP_1_1","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":[null,null],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}},{"protocol":"HTTP_1_1","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":[null,null],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}}],"shareableInfo":{"capifProvDoms":["capifProvDoms","capifProvDoms"],"isShareable":True},"netSliceInfo":[{"ensi":"ensi","snssai":{"sd":"sd","sst":237},"nsiId":"nsiId"},{"ensi":"ensi","snssai":{"sd":"sd","sst":237},"nsiId":"nsiId"}],"apiSuppFeats":"apiSuppFeats","apiId":"apiId","apiStatus":{"aefIds":["aefIds","aefIds"]},"pubApiPath":{"ccfIds":["ccfIds","ccfIds"]}},{"serviceAPICategory":"serviceAPICategory","ccfId":"ccfId","apiName":"apiName","apiProvName":"apiProvName","supportedFeatures":"supportedFeatures","description":"description","aefProfiles":[{"protocol":"HTTP_1_1","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":[null,null],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}},{"protocol":"HTTP_1_1","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":[null,null],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}}],"shareableInfo":{"capifProvDoms":["capifProvDoms","capifProvDoms"],"isShareable":True},"netSliceInfo":[{"ensi":"ensi","snssai":{"sd":"sd","sst":237},"nsiId":"nsiId"},{"ensi":"ensi","snssai":{"sd":"sd","sst":237},"nsiId":"nsiId"}],"apiSuppFeats":"apiSuppFeats","apiId":"apiId","apiStatus":{"aefIds":["aefIds","aefIds"]},"pubApiPath":{"ccfIds":["ccfIds","ccfIds"]}}]}} + headers = { + 'Accept': 'application/json', + 'Content-Type': 'application/json', + } + response = self.client.open( + '/api-invoker-management/v1/onboardedInvokers/{onboarding_id}'.format(onboarding_id='onboarding_id_example'), + method='PUT', + headers=headers, + data=json.dumps(api_invoker_enrolment_details), + content_type='application/json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + +if __name__ == '__main__': + unittest.main() diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/test/test_on_boarded_api_invokers_collection_controller.py b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/test/test_on_boarded_api_invokers_collection_controller.py new file mode 100644 index 0000000000000000000000000000000000000000..e08acb379256c1293de0b7dfb0510a25331c6d88 --- /dev/null +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/api_invoker_management/test/test_on_boarded_api_invokers_collection_controller.py @@ -0,0 +1,35 @@ +import unittest + +from api_invoker_management.models.api_invoker_enrolment_details import \ + APIInvokerEnrolmentDetails # noqa: E501 +from api_invoker_management.models.problem_details import \ + ProblemDetails # noqa: E501 +from api_invoker_management.test import BaseTestCase +from flask import json + + +class TestOnBoardedAPIInvokersCollectionController(BaseTestCase): + """OnBoardedAPIInvokersCollectionController integration test stubs""" + + def test_create_onboarded_api_invoker(self): + """Test case for create_onboarded_api_invoker + + Request the Creation of a new On-boarded API Invoker. + """ + api_invoker_enrolment_details = {"notificationDestination":"notificationDestination","supportedFeatures":"supportedFeatures","apiInvokerId":"apiInvokerId","expTime":"2000-01-23T04:56:07.000+00:00","apiInvokerInformation":"apiInvokerInformation","failureReasons":[{"apiName":["apiName","apiName"],"failureCode":"AUTHORIZATION_ISSUE"},{"apiName":["apiName","apiName"],"failureCode":"AUTHORIZATION_ISSUE"}],"websockNotifConfig":{"requestWebsocketUri":True,"websocketUri":"websocketUri"},"onboardingInformation":{"apiInvokerPublicKey":"apiInvokerPublicKey","onboardingSecret":"onboardingSecret","onboardingCriteria":[{"relatedCriteria":{"aefIds":["aefIds","aefIds"],"apis":[{"apiName":"apiName","supportedApiVersions":["supportedApiVersions","supportedApiVersions"]},{"apiName":"apiName","supportedApiVersions":["supportedApiVersions","supportedApiVersions"]}],"serviceAPICategories":["serviceAPICategories","serviceAPICategories"]},"secMethods":["PSK","PSK"]},{"relatedCriteria":{"aefIds":["aefIds","aefIds"],"apis":[{"apiName":"apiName","supportedApiVersions":["supportedApiVersions","supportedApiVersions"]},{"apiName":"apiName","supportedApiVersions":["supportedApiVersions","supportedApiVersions"]}],"serviceAPICategories":["serviceAPICategories","serviceAPICategories"]},"secMethods":["PSK","PSK"]}],"apiInvokerCertificate":"apiInvokerCertificate"},"requestTestNotification":True,"apiList":{"serviceAPIDescriptions":[{"serviceAPICategory":"serviceAPICategory","ccfId":"ccfId","apiName":"apiName","apiProvName":"apiProvName","supportedFeatures":"supportedFeatures","description":"description","aefProfiles":[{"protocol":"HTTP_1_1","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":[null,null],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}},{"protocol":"HTTP_1_1","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":[null,null],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}}],"shareableInfo":{"capifProvDoms":["capifProvDoms","capifProvDoms"],"isShareable":True},"netSliceInfo":[{"ensi":"ensi","snssai":{"sd":"sd","sst":237},"nsiId":"nsiId"},{"ensi":"ensi","snssai":{"sd":"sd","sst":237},"nsiId":"nsiId"}],"apiSuppFeats":"apiSuppFeats","apiId":"apiId","apiStatus":{"aefIds":["aefIds","aefIds"]},"pubApiPath":{"ccfIds":["ccfIds","ccfIds"]}},{"serviceAPICategory":"serviceAPICategory","ccfId":"ccfId","apiName":"apiName","apiProvName":"apiProvName","supportedFeatures":"supportedFeatures","description":"description","aefProfiles":[{"protocol":"HTTP_1_1","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":[null,null],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}},{"protocol":"HTTP_1_1","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":[null,null],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}}],"shareableInfo":{"capifProvDoms":["capifProvDoms","capifProvDoms"],"isShareable":True},"netSliceInfo":[{"ensi":"ensi","snssai":{"sd":"sd","sst":237},"nsiId":"nsiId"},{"ensi":"ensi","snssai":{"sd":"sd","sst":237},"nsiId":"nsiId"}],"apiSuppFeats":"apiSuppFeats","apiId":"apiId","apiStatus":{"aefIds":["aefIds","aefIds"]},"pubApiPath":{"ccfIds":["ccfIds","ccfIds"]}}]}} + headers = { + 'Accept': 'application/json', + 'Content-Type': 'application/json', + } + response = self.client.open( + '/api-invoker-management/v1/onboardedInvokers', + method='POST', + headers=headers, + data=json.dumps(api_invoker_enrolment_details), + content_type='application/json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + +if __name__ == '__main__': + unittest.main() diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/prepare_invoker.sh b/services/TS29222_CAPIF_API_Invoker_Management_API/prepare_invoker.sh index 0e2accbb5cae55f617d052f22b0de73a752f66a4..b1258795b65ce19bebadb1888282efbe57435465 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/prepare_invoker.sh +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/prepare_invoker.sh @@ -10,15 +10,43 @@ RETRY_DELAY=10 # Attempt counter ATTEMPT=0 +HELPER_URL="http://helper:8080/helper/api/getCcfId" +ATTEMPT_CCFID=0 +CCF_ID="" + while [ $ATTEMPT -lt $MAX_RETRIES ]; do # Increment ATTEMPT using eval eval "ATTEMPT=\$((ATTEMPT + 1))" echo "Attempt $ATTEMPT of $MAX_RETRIES" + # Get CCF_ID from helper + echo "[STEP] Fetching CCF_ID from Helper: $HELPER_URL" + while [ $ATTEMPT_CCFID -lt $MAX_RETRIES ]; do + ATTEMPT_CCFID=$((ATTEMPT_CCFID + 1)) + echo "[INFO] Attempt $ATTEMPT_CCFID/$MAX_RETRIES – GET $HELPER_URL" + + RAW=$(curl -sS --fail --connect-timeout 5 --max-time 10 "$HELPER_URL" || true) + CCF_ID=$(echo "$RAW" | jq -r '.ccf_id // empty' 2>/dev/null) + + if [ -n "$CCF_ID" ]; then + echo "[INFO] Got CCF_ID=$CCF_ID" + break + fi + + echo "[WARN] Helper not ready or invalid response. Retrying in ${RETRY_DELAY}s..." + sleep $RETRY_DELAY + done + + if [ -z "$CCF_ID" ]; then + echo "[ERROR] Unable to retrieve CCF_ID from Helper after $MAX_RETRIES attempts" + exit 1 + fi + + # Make the request to Vault and store the response in a variable RESPONSE=$(curl -s -k --connect-timeout 5 --max-time 10 \ --header "X-Vault-Token: $VAULT_TOKEN" \ - --request GET "$VAULT_ADDR/v1/secret/data/server_cert/pub" | jq -r '.data.data.pub_key') + --request GET "$VAULT_ADDR/v1/secret/data/capif/${CCF_ID}/nginx" | jq -r '.data.data.server_pub') echo "$RESPONSE" diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/requirements.txt b/services/TS29222_CAPIF_API_Invoker_Management_API/requirements.txt index 9e154c601a02dae73ec9f9b5513bcc83ccdb1e35..7df2a2b717a083c18ddff92678b7d2d1898278f2 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/requirements.txt +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/requirements.txt @@ -1,7 +1,8 @@ connexion[flask, swagger-ui, uvicorn] == 3.1.0; python_version>="3.6" swagger-ui-bundle >= 0.0.2 python_dateutil >= 2.6.0 -setuptools == 74.0.0 +urllib3 >= 2.6.0 +setuptools == 80.9.0 Flask == 3.0.3 pymongo == 4.7.3 redis == 4.5.4 @@ -20,6 +21,6 @@ opentelemetry-api == 1.20.0 opentelemetry-sdk == 1.20.0 flask_executor == 1.0.0 Flask-APScheduler == 1.13.1 -werkzeug == 3.0.6 +werkzeug == 3.1.4 gunicorn == 23.0.0 packaging == 24.0 \ No newline at end of file diff --git a/services/TS29222_CAPIF_API_Invoker_Management_API/setup.py b/services/TS29222_CAPIF_API_Invoker_Management_API/setup.py index c41926d430d403800fb5c805d86533cffd97670a..338aabe764377e1b6e60ddd8192c2673d05aa912 100644 --- a/services/TS29222_CAPIF_API_Invoker_Management_API/setup.py +++ b/services/TS29222_CAPIF_API_Invoker_Management_API/setup.py @@ -1,3 +1,4 @@ + from setuptools import find_packages, setup NAME = "api_invoker_management" @@ -30,7 +31,7 @@ setup( entry_points={ 'console_scripts': ['api_invoker_management=api_invoker_management.__main__:main']}, long_description="""\ - API for API invoker management. © 2024, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. + API for API invoker management. © 2025, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. """ ) diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/app.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/app.py index c4b33c5713a99390eef66a04c78a42e38adb4b7a..854b1a59a06bf8fe9e8556d5e2875456e1e52a2a 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/app.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/app.py @@ -9,13 +9,19 @@ import connexion from flask_jwt_extended import JWTManager from fluent import sender from opentelemetry import trace -from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter +from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import \ + OTLPSpanExporter from opentelemetry.instrumentation.flask import FlaskInstrumentor from opentelemetry.instrumentation.redis import RedisInstrumentor from opentelemetry.sdk.resources import Resource from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import BatchSpanProcessor -from opentelemetry.trace.propagation.tracecontext import TraceContextTextMapPropagator +from opentelemetry.trace.propagation.tracecontext import \ + TraceContextTextMapPropagator + +from cryptography import x509 +from cryptography.hazmat.backends import default_backend +from cryptography.hazmat.primitives import serialization from .config import Config @@ -110,6 +116,23 @@ def verbose_formatter(): with open("/usr/src/app/api_provider_management/pubkey.pem", "rb") as pub_file: pub_data = pub_file.read() + +# with open("/usr/src/app/api_provider_management/pubkey.pem", "rb") as f: +# pem_data = f.read() + +# # Extract the first certificate from the PEM (even if it comes in a bundle) +# cert = x509.load_pem_x509_certificate(pem_data, default_backend()) + +# # Extract the public key +# public_key = cert.public_key() + +# # Convert the public key to PEM (which JWT needs) +# pub_data = public_key.public_bytes( +# encoding=serialization.Encoding.PEM, +# format=serialization.PublicFormat.SubjectPublicKeyInfo, +# ) + + app = connexion.App(__name__, specification_dir='openapi/') app.app.json_encoder = api_provider_management.encoder.CustomJSONEncoder diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/controllers/default_controller.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/controllers/default_controller.py index 0a67ace6383475fee45a17c18c509a2c55f559d4..cbe36042f2146e5d831481bd7bec6da55d81b734 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/controllers/default_controller.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/controllers/default_controller.py @@ -1,11 +1,16 @@ from functools import wraps -from api_provider_management.models.api_provider_enrolment_details import APIProviderEnrolmentDetails # noqa: E501 +from api_provider_management.models.api_provider_enrolment_details import \ + APIProviderEnrolmentDetails # noqa: E501 +from api_provider_management.models.problem_details import \ + ProblemDetails # noqa: E501 from cryptography import x509 from cryptography.hazmat.backends import default_backend from flask import current_app, request from flask_jwt_extended import get_jwt_identity, jwt_required +from ..core.responses import unauthorized_error + from ..core.provider_enrolment_details_api import ProviderManagementOperations from ..core.validate_user import ControlAccess @@ -18,7 +23,11 @@ def cert_validation(): def __cert_validation(*args, **kwargs): args = request.view_args - cert_tmp = request.headers['X-Ssl-Client-Cert'] + cert_tmp = request.headers.get('X-Ssl-Client-Cert') + + if not cert_tmp: + return unauthorized_error("Client certificate required", "X-Ssl-Client-Cert header is missing") + cert_raw = cert_tmp.replace('\t', '') cert = x509.load_pem_x509_certificate(str.encode(cert_raw), default_backend()) @@ -76,7 +85,6 @@ def registrations_registration_id_delete(registration_id): # noqa: E501 return res - @cert_validation() def registrations_registration_id_put(registration_id, body): # noqa: E501 """registrations_registration_id_put diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/controllers/individual_api_provider_enrolment_details_controller.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/controllers/individual_api_provider_enrolment_details_controller.py index cefef1efcb8312e11b0aab822979e7c622c863fe..9305c73b0e0e51f63b352e99e5e0b558c31668ff 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/controllers/individual_api_provider_enrolment_details_controller.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/controllers/individual_api_provider_enrolment_details_controller.py @@ -1,10 +1,48 @@ +from functools import wraps from flask import current_app, request +from cryptography import x509 +from cryptography.hazmat.backends import default_backend + +from ..core.responses import unauthorized_error from ..core.provider_enrolment_details_api import ProviderManagementOperations -from ..models.api_provider_enrolment_details_patch import APIProviderEnrolmentDetailsPatch # noqa: E501 +from ..core.validate_user import ControlAccess +from ..models.api_provider_enrolment_details_patch import \ + APIProviderEnrolmentDetailsPatch # noqa: E501 provider_management_ops = ProviderManagementOperations() +valid_user = ControlAccess() + +def cert_validation(): + def _cert_validation(f): + @wraps(f) + def __cert_validation(*args, **kwargs): + + args = request.view_args + cert_tmp = request.headers.get('X-Ssl-Client-Cert') + + if not cert_tmp: + return unauthorized_error("Client certificate required", "X-Ssl-Client-Cert header is missing") + + cert_raw = cert_tmp.replace('\t', '') + + cert = x509.load_pem_x509_certificate(str.encode(cert_raw), default_backend()) + + cn = cert.subject.get_attributes_for_oid(x509.OID_COMMON_NAME)[0].value.strip() + + if cn != "superadmin": + cert_signature = cert.signature.hex() + result = valid_user.validate_user_cert(args["registrationId"], cert_signature) + + if result is not None: + return result + + result = f(**kwargs) + return result + return __cert_validation + return _cert_validation +@cert_validation() def modify_ind_api_provider_enrolment(registration_id, body): # noqa: E501 """modify_ind_api_provider_enrolment @@ -21,6 +59,6 @@ def modify_ind_api_provider_enrolment(registration_id, body): # noqa: E501 if request.is_json: body = APIProviderEnrolmentDetailsPatch.from_dict(request.get_json()) # noqa: E501 - res = provider_management_ops.update_api_provider_enrolment_details(registration_id, body) + res = provider_management_ops.patch_api_provider_enrolment_details(registration_id, body) return res diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/controllers/security_controller.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/controllers/security_controller.py index 139597f9cb07c5d48bed18984ec4747f4b4f3438..8b137891791fe96927ad78e64b0aad7bded08bdc 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/controllers/security_controller.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/controllers/security_controller.py @@ -1,2 +1 @@ - diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/provider_enrolment_details_api.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/provider_enrolment_details_api.py index 60b89b14c2e8ce2b7270525165916983f6440c1b..f6db1b7bf7a3c7f9955261f4fcc50027c8d303e2 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/provider_enrolment_details_api.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/provider_enrolment_details_api.py @@ -3,7 +3,8 @@ import os import secrets from datetime import datetime -from api_provider_management.models.api_provider_enrolment_details import APIProviderEnrolmentDetails # noqa: E501 +from api_provider_management.models.api_provider_enrolment_details import \ + APIProviderEnrolmentDetails # noqa: E501 from flask import Response, current_app from pymongo import ReturnDocument @@ -12,7 +13,8 @@ from ..util import clean_empty, dict_to_camel_case, serialize_clean_camel_case from .auth_manager import AuthManager from .redis_internal_event import RedisInternalEvent from .resources import Resource -from .responses import bad_request_error, forbidden_error, internal_server_error, make_response, not_found_error +from .responses import (bad_request_error, forbidden_error, + internal_server_error, make_response, not_found_error) TOTAL_FEATURES = 2 SUPPORTED_FEATURES_HEX = "0" @@ -57,6 +59,13 @@ class ProviderManagementOperations(Resource): "Found provider registered with same id") return forbidden_error(detail="Provider already registered", cause="Identical provider reg sec") + if not api_provider_enrolment_details.supp_feat: + return bad_request_error( + detail="suppFeat not present in request", + cause="suppFeat not present", + invalid_params=[{"param": "suppFeat", "reason": "not defined"}] + ) + api_provider_enrolment_details.api_prov_dom_id = secrets.token_hex( 15) @@ -148,7 +157,14 @@ class ProviderManagementOperations(Resource): if isinstance(result, Response): return result - + + if not api_provider_enrolment_details.supp_feat: + return bad_request_error( + detail="suppFeat not present in request", + cause="suppFeat not present", + invalid_params=[{"param": "suppFeat", "reason": "not defined"}] + ) + negotiated_supported_features = return_negotiated_supp_feat_dict(api_provider_enrolment_details.supp_feat) api_provider_enrolment_details.supp_feat = negotiated_supported_features["Final"] diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/responses.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/responses.py index 8f975cbf426c304c4ae0681f65af67fcad9abca5..82305f4b9663242c41a36091ec47c4c9f808ce5d 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/responses.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/core/responses.py @@ -33,11 +33,18 @@ def bad_request_error(detail, cause, invalid_params): prob = ProblemDetails(title="Bad Request", status=400, detail=detail, cause=cause, invalid_params=invalid_params) prob = serialize_clean_camel_case(prob) - return Response(json.dumps(prob, cls=CustomJSONEncoder), status=400, mimetype=cause) + return Response(json.dumps(prob, cls=CustomJSONEncoder), status=400, mimetype=mimetype) def not_found_error(detail, cause): prob = ProblemDetails(title="Not Found", status=404, detail=detail, cause=cause) prob = serialize_clean_camel_case(prob) - return Response(json.dumps(prob, cls=CustomJSONEncoder), status=404, mimetype=mimetype) \ No newline at end of file + return Response(json.dumps(prob, cls=CustomJSONEncoder), status=404, mimetype=mimetype) + + +def unauthorized_error(detail, cause): + prob = ProblemDetails(title="Unauthorized", status=401, detail=detail, cause=cause) + prob = serialize_clean_camel_case(prob) + + return Response(json.dumps(prob, cls=CustomJSONEncoder), status=401, mimetype=mimetype) diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/encoder.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/encoder.py index 51082b2736f57daecc081762914b0d7223f19e2b..c277ef4420fcf2a4af1db958f211546f81768b59 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/encoder.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/encoder.py @@ -1,7 +1,6 @@ +from api_provider_management.models.base_model import Model from connexion.jsonifier import JSONEncoder -from .models.base_model import Model - class CustomJSONEncoder(JSONEncoder): include_nulls = False diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_enrolment_details.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_enrolment_details.py index 18f2a1e6887504279197ef7936b3b57f76c048a8..8985bcb46bd0ab8a9879220c3672058560701aba 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_enrolment_details.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_enrolment_details.py @@ -3,7 +3,8 @@ from datetime import date, datetime # noqa: F401 from typing import Dict, List # noqa: F401 from api_provider_management import util -from api_provider_management.models.api_provider_function_details import APIProviderFunctionDetails # noqa: E501 +from api_provider_management.models.api_provider_function_details import \ + APIProviderFunctionDetails # noqa: E501 from api_provider_management.models.base_model import Model diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_enrolment_details_patch.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_enrolment_details_patch.py index 5f4ab09ba995ff1d65da1256ba17f4513894882d..e72d23876fdd034551d3852b3750b95cefa389d5 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_enrolment_details_patch.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_enrolment_details_patch.py @@ -2,7 +2,8 @@ from datetime import date, datetime # noqa: F401 from typing import Dict, List # noqa: F401 from api_provider_management import util -from api_provider_management.models.api_provider_function_details import APIProviderFunctionDetails # noqa: E501 +from api_provider_management.models.api_provider_function_details import \ + APIProviderFunctionDetails # noqa: E501 from api_provider_management.models.base_model import Model diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_function_details.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_function_details.py index 1c5655bb2d1e3e93d1ea58832e7a6fa1b7d71b21..deab5105a1f15f66070c9182391d41a36b5fb64d 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_function_details.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/api_provider_function_details.py @@ -2,9 +2,11 @@ from datetime import date, datetime # noqa: F401 from typing import Dict, List # noqa: F401 from api_provider_management import util -from api_provider_management.models.api_provider_func_role import ApiProviderFuncRole # noqa: E501 +from api_provider_management.models.api_provider_func_role import \ + ApiProviderFuncRole # noqa: E501 from api_provider_management.models.base_model import Model -from api_provider_management.models.registration_information import RegistrationInformation # noqa: E501 +from api_provider_management.models.registration_information import \ + RegistrationInformation # noqa: E501 class APIProviderFunctionDetails(Model): diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/problem_details.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/problem_details.py index 9d7f12324fe44c31d9b3215b63ccc806e25accda..c02158a1ebacf20337964c090b02d67ded23c051 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/problem_details.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/models/problem_details.py @@ -4,7 +4,8 @@ from typing import Dict, List # noqa: F401 from api_provider_management import util from api_provider_management.models.base_model import Model -from api_provider_management.models.invalid_param import InvalidParam # noqa: E501 +from api_provider_management.models.invalid_param import \ + InvalidParam # noqa: E501 class ProblemDetails(Model): diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/test/test_default_controller.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/test/test_default_controller.py index 120b96f850e45e1c1e516904263881433699ef53..8d2246add205df41ad041dbfd0b0b122c49fe7eb 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/test/test_default_controller.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/test/test_default_controller.py @@ -1,7 +1,9 @@ import unittest -from api_provider_management.models.api_provider_enrolment_details import APIProviderEnrolmentDetails # noqa: E501 -from api_provider_management.models.problem_details import ProblemDetails # noqa: E501 +from api_provider_management.models.api_provider_enrolment_details import \ + APIProviderEnrolmentDetails # noqa: E501 +from api_provider_management.models.problem_details import \ + ProblemDetails # noqa: E501 from api_provider_management.test import BaseTestCase from flask import json diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/test/test_individual_api_provider_enrolment_details_controller.py b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/test/test_individual_api_provider_enrolment_details_controller.py index 9c1819ac17460fe2618982f56653808e44e2e998..b985f99b0d3021b0502a9ef508a10fa6d31fc2f1 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/test/test_individual_api_provider_enrolment_details_controller.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/api_provider_management/test/test_individual_api_provider_enrolment_details_controller.py @@ -1,9 +1,11 @@ import unittest -from api_provider_management.models.api_provider_enrolment_details import APIProviderEnrolmentDetails # noqa: E501 +from api_provider_management.models.api_provider_enrolment_details import \ + APIProviderEnrolmentDetails # noqa: E501 from api_provider_management.models.api_provider_enrolment_details_patch import \ APIProviderEnrolmentDetailsPatch # noqa: E501 -from api_provider_management.models.problem_details import ProblemDetails # noqa: E501 +from api_provider_management.models.problem_details import \ + ProblemDetails # noqa: E501 from api_provider_management.test import BaseTestCase from flask import json diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/prepare_provider.sh b/services/TS29222_CAPIF_API_Provider_Management_API/prepare_provider.sh index edefb5829ae4eeeea723113ef63f4c49c78c3c20..b13dadaa33e1795bafadfcaeb9a5b2495930d3c2 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/prepare_provider.sh +++ b/services/TS29222_CAPIF_API_Provider_Management_API/prepare_provider.sh @@ -10,15 +10,43 @@ RETRY_DELAY=10 # Attempt counter ATTEMPT=0 +HELPER_URL="http://helper:8080/helper/api/getCcfId" +ATTEMPT_CCFID=0 +CCF_ID="" + while [ $ATTEMPT -lt $MAX_RETRIES ]; do # Increment ATTEMPT using eval eval "ATTEMPT=\$((ATTEMPT + 1))" echo "Attempt $ATTEMPT of $MAX_RETRIES" + + # Get CCF_ID from helper + echo "[STEP] Fetching CCF_ID from Helper: $HELPER_URL" + while [ $ATTEMPT_CCFID -lt $MAX_RETRIES ]; do + ATTEMPT_CCFID=$((ATTEMPT_CCFID + 1)) + echo "[INFO] Attempt $ATTEMPT_CCFID/$MAX_RETRIES – GET $HELPER_URL" + + RAW=$(curl -sS --fail --connect-timeout 5 --max-time 10 "$HELPER_URL" || true) + CCF_ID=$(echo "$RAW" | jq -r '.ccf_id // empty' 2>/dev/null) + + if [ -n "$CCF_ID" ]; then + echo "[INFO] Got CCF_ID=$CCF_ID" + break + fi + + echo "[WARN] Helper not ready or invalid response. Retrying in ${RETRY_DELAY}s..." + sleep $RETRY_DELAY + done + + if [ -z "$CCF_ID" ]; then + echo "[ERROR] Unable to retrieve CCF_ID from Helper after $MAX_RETRIES attempts" + exit 1 + fi + # Make the request to Vault and store the response in a variable RESPONSE=$(curl -s -k --connect-timeout 5 --max-time 10 \ --header "X-Vault-Token: $VAULT_TOKEN" \ - --request GET "$VAULT_ADDR/v1/secret/data/server_cert/pub" | jq -r '.data.data.pub_key') + --request GET "$VAULT_ADDR/v1/secret/data/capif/${CCF_ID}/nginx" | jq -r '.data.data.server_pub') echo "$RESPONSE" diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/requirements.txt b/services/TS29222_CAPIF_API_Provider_Management_API/requirements.txt index 9d79f0840b3cc87c0a317f968557882708be9294..6359e8281b9f79b98480f08354861c85a3194611 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/requirements.txt +++ b/services/TS29222_CAPIF_API_Provider_Management_API/requirements.txt @@ -1,23 +1,23 @@ connexion[flask, swagger-ui, uvicorn] == 3.1.0; python_version>="3.6" swagger-ui-bundle >= 0.0.2 python_dateutil >= 2.6.0 -setuptools == 74.0.0 +setuptools == 80.9.0 Flask == 3.0.3 pymongo == 4.7.3 redis == 4.5.4 flask_jwt_extended == 4.6.0 -cryptography == 42.0.8 +cryptography == 46.0.1 rfc3987 == 1.3.8 -opentelemetry-instrumentation == 0.40b0 -opentelemetry-instrumentation-flask == 0.40b0 -opentelemetry-instrumentation-redis == 0.40b0 -opentelemetry-instrumentation-pymongo == 0.40b0 -opentelemetry-exporter-otlp == 1.19.0 +opentelemetry-instrumentation == 0.41b0 +opentelemetry-instrumentation-flask == 0.41b0 +opentelemetry-instrumentation-redis == 0.41b0 +opentelemetry-instrumentation-pymongo == 0.41b0 +opentelemetry-exporter-otlp == 1.20.0 fluent == 0.10.0 fluent-logger == 0.10.0 -opentelemetry-api == 1.19.0 -opentelemetry-sdk == 1.19.0 +opentelemetry-api == 1.20.0 +opentelemetry-sdk == 1.20.0 flask_executor == 1.0.0 -werkzeug == 3.0.4 +werkzeug == 3.1.3 gunicorn == 23.0.0 packaging == 24.0 diff --git a/services/TS29222_CAPIF_API_Provider_Management_API/setup.py b/services/TS29222_CAPIF_API_Provider_Management_API/setup.py index 406d0daec290b7a293ca899a5ccd1ac23b108e59..0a27afc71fb14f02a2943cdf0abff7c8ca4acd31 100644 --- a/services/TS29222_CAPIF_API_Provider_Management_API/setup.py +++ b/services/TS29222_CAPIF_API_Provider_Management_API/setup.py @@ -1,3 +1,4 @@ + from setuptools import find_packages, setup NAME = "api_provider_management" diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/.openapi-generator/FILES b/services/TS29222_CAPIF_Access_Control_Policy_API/.openapi-generator/FILES index eeda92fd5bcfe53d25713964b3ddc9a8a64b43b3..2c87d47969b351b2c60a5457e30ce51b1ec9037e 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/.openapi-generator/FILES +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/.openapi-generator/FILES @@ -16,7 +16,9 @@ capif_acl/models/access_control_policy_list.py capif_acl/models/api_invoker_policy.py capif_acl/models/base_model.py capif_acl/models/invalid_param.py +capif_acl/models/net_slice_id.py capif_acl/models/problem_details.py +capif_acl/models/snssai.py capif_acl/models/time_range_list.py capif_acl/openapi/openapi.yaml capif_acl/test/__init__.py diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/app.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/app.py index 0841c2d21eb13453a6401e5669d55363302473dd..bb3dc3f367d844a195cb747f90e56983faad9201 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/app.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/app.py @@ -14,13 +14,15 @@ from flask_executor import Executor from flask_jwt_extended import JWTManager from fluent import sender from opentelemetry import trace -from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter +from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import \ + OTLPSpanExporter from opentelemetry.instrumentation.flask import FlaskInstrumentor from opentelemetry.instrumentation.redis import RedisInstrumentor from opentelemetry.sdk.resources import Resource from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import BatchSpanProcessor -from opentelemetry.trace.propagation.tracecontext import TraceContextTextMapPropagator +from opentelemetry.trace.propagation.tracecontext import \ + TraceContextTextMapPropagator NAME = "Acl-Service" diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/controllers/default_controller.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/controllers/default_controller.py index 6c201ea4dff83012f9cfd67558f2b11cbab3e510..ed6cb97b22246d8dc9dd3527b468931367549d10 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/controllers/default_controller.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/controllers/default_controller.py @@ -1,9 +1,14 @@ from functools import wraps +from capif_acl.models.access_control_policy_list import \ + AccessControlPolicyList # noqa: E501 +from capif_acl.models.problem_details import ProblemDetails # noqa: E501 from cryptography import x509 from cryptography.hazmat.backends import default_backend from flask import current_app, request +from ..core.responses import unauthorized_error + from ..core.accesscontrolpolicyapi import accessControlPolicyApi @@ -13,7 +18,11 @@ def cert_validation(): def __cert_validation(*args, **kwargs): request.view_args - cert_tmp = request.headers['X-Ssl-Client-Cert'] + cert_tmp = request.headers.get('X-Ssl-Client-Cert') + + if not cert_tmp: + return unauthorized_error("Client certificate required", "X-Ssl-Client-Cert header is missing") + cert_raw = cert_tmp.replace('\t', '') x509.load_pem_x509_certificate(str.encode(cert_raw), default_backend()) @@ -43,3 +52,4 @@ def access_control_policy_list_service_api_id_get(service_api_id, aef_id, api_in """ current_app.logger.debug("Obtaining service ACLs") return accessControlPolicyApi().get_acl(service_api_id, aef_id, api_invoker_id, supported_features) + diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/core/responses.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/core/responses.py index 8f975cbf426c304c4ae0681f65af67fcad9abca5..8ba055f9295f90258ff39547a9f4af1b22a75a30 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/core/responses.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/core/responses.py @@ -33,11 +33,18 @@ def bad_request_error(detail, cause, invalid_params): prob = ProblemDetails(title="Bad Request", status=400, detail=detail, cause=cause, invalid_params=invalid_params) prob = serialize_clean_camel_case(prob) - return Response(json.dumps(prob, cls=CustomJSONEncoder), status=400, mimetype=cause) + return Response(json.dumps(prob, cls=CustomJSONEncoder), status=400, mimetype=mimetype) def not_found_error(detail, cause): prob = ProblemDetails(title="Not Found", status=404, detail=detail, cause=cause) prob = serialize_clean_camel_case(prob) - return Response(json.dumps(prob, cls=CustomJSONEncoder), status=404, mimetype=mimetype) \ No newline at end of file + return Response(json.dumps(prob, cls=CustomJSONEncoder), status=404, mimetype=mimetype) + + +def unauthorized_error(detail, cause): + prob = ProblemDetails(title="Unauthorized", status=401, detail=detail, cause=cause) + prob = serialize_clean_camel_case(prob) + + return Response(json.dumps(prob, cls=CustomJSONEncoder), status=401, mimetype=mimetype) \ No newline at end of file diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/encoder.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/encoder.py index 627a7bd72b3c9c9072df158b7418c530d89b0a3f..9afbbe1de7d3bb358283f2bed1f0ab090aff349b 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/encoder.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/encoder.py @@ -15,4 +15,4 @@ class CustomJSONEncoder(JSONEncoder): attr = o.attribute_map[attr] dikt[attr] = value return dikt - return JSONEncoder.default(self, o) \ No newline at end of file + return JSONEncoder.default(self, o) diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/api_invoker_policy.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/api_invoker_policy.py index cdd35e29e0f34322e5f46591ae9cf591551d3fcb..456a6925ee3d025429ae1702da16725d9b5f0989 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/api_invoker_policy.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/api_invoker_policy.py @@ -3,6 +3,7 @@ from typing import Dict, List # noqa: F401 from capif_acl import util from capif_acl.models.base_model import Model +from capif_acl.models.net_slice_id import NetSliceId # noqa: E501 from capif_acl.models.time_range_list import TimeRangeList # noqa: E501 @@ -12,7 +13,7 @@ class ApiInvokerPolicy(Model): Do not edit the class manually. """ - def __init__(self, api_invoker_id=None, allowed_total_invocations=None, allowed_invocations_per_second=None, allowed_invocation_time_range_list=None): # noqa: E501 + def __init__(self, api_invoker_id=None, allowed_total_invocations=None, allowed_invocations_per_second=None, allowed_invocation_time_range_list=None, net_slice_info=None): # noqa: E501 """ApiInvokerPolicy - a model defined in OpenAPI :param api_invoker_id: The api_invoker_id of this ApiInvokerPolicy. # noqa: E501 @@ -23,25 +24,30 @@ class ApiInvokerPolicy(Model): :type allowed_invocations_per_second: int :param allowed_invocation_time_range_list: The allowed_invocation_time_range_list of this ApiInvokerPolicy. # noqa: E501 :type allowed_invocation_time_range_list: List[TimeRangeList] + :param net_slice_info: The net_slice_info of this ApiInvokerPolicy. # noqa: E501 + :type net_slice_info: List[NetSliceId] """ self.openapi_types = { 'api_invoker_id': str, 'allowed_total_invocations': int, 'allowed_invocations_per_second': int, - 'allowed_invocation_time_range_list': List[TimeRangeList] + 'allowed_invocation_time_range_list': List[TimeRangeList], + 'net_slice_info': List[NetSliceId] } self.attribute_map = { 'api_invoker_id': 'apiInvokerId', 'allowed_total_invocations': 'allowedTotalInvocations', 'allowed_invocations_per_second': 'allowedInvocationsPerSecond', - 'allowed_invocation_time_range_list': 'allowedInvocationTimeRangeList' + 'allowed_invocation_time_range_list': 'allowedInvocationTimeRangeList', + 'net_slice_info': 'netSliceInfo' } self._api_invoker_id = api_invoker_id self._allowed_total_invocations = allowed_total_invocations self._allowed_invocations_per_second = allowed_invocations_per_second self._allowed_invocation_time_range_list = allowed_invocation_time_range_list + self._net_slice_info = net_slice_info @classmethod def from_dict(cls, dikt) -> 'ApiInvokerPolicy': @@ -149,3 +155,26 @@ class ApiInvokerPolicy(Model): raise ValueError("Invalid value for `allowed_invocation_time_range_list`, number of items must be greater than or equal to `0`") # noqa: E501 self._allowed_invocation_time_range_list = allowed_invocation_time_range_list + + @property + def net_slice_info(self) -> List[NetSliceId]: + """Gets the net_slice_info of this ApiInvokerPolicy. + + + :return: The net_slice_info of this ApiInvokerPolicy. + :rtype: List[NetSliceId] + """ + return self._net_slice_info + + @net_slice_info.setter + def net_slice_info(self, net_slice_info: List[NetSliceId]): + """Sets the net_slice_info of this ApiInvokerPolicy. + + + :param net_slice_info: The net_slice_info of this ApiInvokerPolicy. + :type net_slice_info: List[NetSliceId] + """ + if net_slice_info is not None and len(net_slice_info) < 1: + raise ValueError("Invalid value for `net_slice_info`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._net_slice_info = net_slice_info diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/net_slice_id.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/net_slice_id.py new file mode 100644 index 0000000000000000000000000000000000000000..47db47d3b6788f18f1d952fb3af0cd619b60c4ba --- /dev/null +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/net_slice_id.py @@ -0,0 +1,117 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from capif_acl import util +from capif_acl.models.base_model import Model +from capif_acl.models.snssai import Snssai # noqa: E501 + + +class NetSliceId(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, snssai=None, nsi_id=None, ensi=None): # noqa: E501 + """NetSliceId - a model defined in OpenAPI + + :param snssai: The snssai of this NetSliceId. # noqa: E501 + :type snssai: Snssai + :param nsi_id: The nsi_id of this NetSliceId. # noqa: E501 + :type nsi_id: str + :param ensi: The ensi of this NetSliceId. # noqa: E501 + :type ensi: str + """ + self.openapi_types = { + 'snssai': Snssai, + 'nsi_id': str, + 'ensi': str + } + + self.attribute_map = { + 'snssai': 'snssai', + 'nsi_id': 'nsiId', + 'ensi': 'ensi' + } + + self._snssai = snssai + self._nsi_id = nsi_id + self._ensi = ensi + + @classmethod + def from_dict(cls, dikt) -> 'NetSliceId': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The NetSliceId of this NetSliceId. # noqa: E501 + :rtype: NetSliceId + """ + return util.deserialize_model(dikt, cls) + + @property + def snssai(self) -> Snssai: + """Gets the snssai of this NetSliceId. + + + :return: The snssai of this NetSliceId. + :rtype: Snssai + """ + return self._snssai + + @snssai.setter + def snssai(self, snssai: Snssai): + """Sets the snssai of this NetSliceId. + + + :param snssai: The snssai of this NetSliceId. + :type snssai: Snssai + """ + + self._snssai = snssai + + @property + def nsi_id(self) -> str: + """Gets the nsi_id of this NetSliceId. + + Contains the Identifier of the selected Network Slice instance # noqa: E501 + + :return: The nsi_id of this NetSliceId. + :rtype: str + """ + return self._nsi_id + + @nsi_id.setter + def nsi_id(self, nsi_id: str): + """Sets the nsi_id of this NetSliceId. + + Contains the Identifier of the selected Network Slice instance # noqa: E501 + + :param nsi_id: The nsi_id of this NetSliceId. + :type nsi_id: str + """ + + self._nsi_id = nsi_id + + @property + def ensi(self) -> str: + """Gets the ensi of this NetSliceId. + + Represents the External Network Slice Information that is used to identify a network slice, as specified in 3GPP TS 33.501. # noqa: E501 + + :return: The ensi of this NetSliceId. + :rtype: str + """ + return self._ensi + + @ensi.setter + def ensi(self, ensi: str): + """Sets the ensi of this NetSliceId. + + Represents the External Network Slice Information that is used to identify a network slice, as specified in 3GPP TS 33.501. # noqa: E501 + + :param ensi: The ensi of this NetSliceId. + :type ensi: str + """ + + self._ensi = ensi diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/snssai.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/snssai.py new file mode 100644 index 0000000000000000000000000000000000000000..357adbbd65608dea25b381a4209796a4850cb5cb --- /dev/null +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/snssai.py @@ -0,0 +1,99 @@ +import re # noqa: E501 +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from capif_acl import util +from capif_acl.models.base_model import Model + + +class Snssai(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, sst=None, sd=None): # noqa: E501 + """Snssai - a model defined in OpenAPI + + :param sst: The sst of this Snssai. # noqa: E501 + :type sst: int + :param sd: The sd of this Snssai. # noqa: E501 + :type sd: str + """ + self.openapi_types = { + 'sst': int, + 'sd': str + } + + self.attribute_map = { + 'sst': 'sst', + 'sd': 'sd' + } + + self._sst = sst + self._sd = sd + + @classmethod + def from_dict(cls, dikt) -> 'Snssai': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The Snssai of this Snssai. # noqa: E501 + :rtype: Snssai + """ + return util.deserialize_model(dikt, cls) + + @property + def sst(self) -> int: + """Gets the sst of this Snssai. + + Unsigned integer, within the range 0 to 255, representing the Slice/Service Type. It indicates the expected Network Slice behaviour in terms of features and services. Values 0 to 127 correspond to the standardized SST range. Values 128 to 255 correspond to the Operator-specific range. See clause 28.4.2 of 3GPP TS 23.003. Standardized values are defined in clause 5.15.2.2 of 3GPP TS 23.501. # noqa: E501 + + :return: The sst of this Snssai. + :rtype: int + """ + return self._sst + + @sst.setter + def sst(self, sst: int): + """Sets the sst of this Snssai. + + Unsigned integer, within the range 0 to 255, representing the Slice/Service Type. It indicates the expected Network Slice behaviour in terms of features and services. Values 0 to 127 correspond to the standardized SST range. Values 128 to 255 correspond to the Operator-specific range. See clause 28.4.2 of 3GPP TS 23.003. Standardized values are defined in clause 5.15.2.2 of 3GPP TS 23.501. # noqa: E501 + + :param sst: The sst of this Snssai. + :type sst: int + """ + if sst is None: + raise ValueError("Invalid value for `sst`, must not be `None`") # noqa: E501 + if sst is not None and sst > 255: # noqa: E501 + raise ValueError("Invalid value for `sst`, must be a value less than or equal to `255`") # noqa: E501 + if sst is not None and sst < 0: # noqa: E501 + raise ValueError("Invalid value for `sst`, must be a value greater than or equal to `0`") # noqa: E501 + + self._sst = sst + + @property + def sd(self) -> str: + """Gets the sd of this Snssai. + + 3-octet string, representing the Slice Differentiator, in hexadecimal representation. Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent 4 bits. The most significant character representing the 4 most significant bits of the SD shall appear first in the string, and the character representing the 4 least significant bit of the SD shall appear last in the string. This is an optional parameter that complements the Slice/Service type(s) to allow to differentiate amongst multiple Network Slices of the same Slice/Service type. This IE shall be absent if no SD value is associated with the SST. # noqa: E501 + + :return: The sd of this Snssai. + :rtype: str + """ + return self._sd + + @sd.setter + def sd(self, sd: str): + """Sets the sd of this Snssai. + + 3-octet string, representing the Slice Differentiator, in hexadecimal representation. Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent 4 bits. The most significant character representing the 4 most significant bits of the SD shall appear first in the string, and the character representing the 4 least significant bit of the SD shall appear last in the string. This is an optional parameter that complements the Slice/Service type(s) to allow to differentiate amongst multiple Network Slices of the same Slice/Service type. This IE shall be absent if no SD value is associated with the SST. # noqa: E501 + + :param sd: The sd of this Snssai. + :type sd: str + """ + if sd is not None and not re.search(r'^[A-Fa-f0-9]{6}$', sd): # noqa: E501 + raise ValueError(r"Invalid value for `sd`, must be a follow pattern or equal to `/^[A-Fa-f0-9]{6}$/`") # noqa: E501 + + self._sd = sd diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/openapi/openapi.yaml b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/openapi/openapi.yaml index eebcdfe38e6189bf1be5e764034840e2ec2883cf..d3c40009aab53dd660684bc4db276f37da00e24f 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/openapi/openapi.yaml +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/openapi/openapi.yaml @@ -1,11 +1,11 @@ openapi: 3.0.0 info: - description: "API for access control policy. \n© 2024, 3GPP Organizational Partners\ + description: "API for access control policy. \n© 2025, 3GPP Organizational Partners\ \ (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). \nAll rights reserved.\n" title: CAPIF_Access_Control_Policy_API - version: 1.3.0 + version: 1.4.0-alpha.1 externalDocs: - description: 3GPP TS 29.222 V18.6.0 Common API Framework for 3GPP Northbound APIs + description: 3GPP TS 29.222 V19.4.0 Common API Framework for 3GPP Northbound APIs url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.222/ servers: - url: "{apiRoot}/access-control-policy/v1" @@ -213,6 +213,17 @@ components: apiInvokerPolicies: - apiInvokerId: apiInvokerId allowedTotalInvocations: 0 + netSliceInfo: + - ensi: ensi + snssai: + sd: sd + sst: 37 + nsiId: nsiId + - ensi: ensi + snssai: + sd: sd + sst: 37 + nsiId: nsiId allowedInvocationTimeRangeList: - startTime: 2000-01-23T04:56:07.000+00:00 stopTime: 2000-01-23T04:56:07.000+00:00 @@ -221,6 +232,17 @@ components: allowedInvocationsPerSecond: 6 - apiInvokerId: apiInvokerId allowedTotalInvocations: 0 + netSliceInfo: + - ensi: ensi + snssai: + sd: sd + sst: 37 + nsiId: nsiId + - ensi: ensi + snssai: + sd: sd + sst: 37 + nsiId: nsiId allowedInvocationTimeRangeList: - startTime: 2000-01-23T04:56:07.000+00:00 stopTime: 2000-01-23T04:56:07.000+00:00 @@ -242,6 +264,17 @@ components: example: apiInvokerId: apiInvokerId allowedTotalInvocations: 0 + netSliceInfo: + - ensi: ensi + snssai: + sd: sd + sst: 37 + nsiId: nsiId + - ensi: ensi + snssai: + sd: sd + sst: 37 + nsiId: nsiId allowedInvocationTimeRangeList: - startTime: 2000-01-23T04:56:07.000+00:00 stopTime: 2000-01-23T04:56:07.000+00:00 @@ -271,6 +304,12 @@ components: minItems: 0 title: allowedInvocationTimeRangeList type: array + netSliceInfo: + items: + $ref: '#/components/schemas/NetSliceId' + minItems: 1 + title: netSliceInfo + type: array required: - apiInvokerId title: ApiInvokerPolicy @@ -367,8 +406,73 @@ components: - param title: InvalidParam type: object + NetSliceId: + description: | + Represents the network slice identification information. + example: + ensi: ensi + snssai: + sd: sd + sst: 37 + nsiId: nsiId + nullable: true + oneOf: + - required: [snssai] + - required: [nsiId] + - required: [ensi] + properties: + snssai: + $ref: '#/components/schemas/Snssai' + nsiId: + description: Contains the Identifier of the selected Network Slice instance + title: NsiId + type: string + ensi: + description: | + Represents the External Network Slice Information that is used to identify a network slice, as specified in 3GPP TS 33.501. + title: Ensi + type: string + title: NetSliceId + type: object + Ensi: + description: | + Represents the External Network Slice Information that is used to identify a network slice, as specified in 3GPP TS 33.501. + title: Ensi + type: string DateTime: description: string with format "date-time" as defined in OpenAPI. format: date-time title: DateTime type: string + Snssai: + description: | + When Snssai needs to be converted to string (e.g. when used in maps as key), the string shall be composed of one to three digits "sst" optionally followed by "-" and 6 hexadecimal digits "sd". + example: + sd: sd + sst: 37 + properties: + sst: + description: "Unsigned integer, within the range 0 to 255, representing\ + \ the Slice/Service Type. It indicates the expected Network Slice behaviour\ + \ in terms of features and services. Values 0 to 127 correspond to the\ + \ standardized SST range. Values 128 to 255 correspond to the Operator-specific\ + \ range. See clause 28.4.2 of 3GPP TS 23.003. Standardized values are\ + \ defined in clause 5.15.2.2 of 3GPP TS 23.501. \n" + maximum: 255 + minimum: 0 + title: sst + type: integer + sd: + description: | + 3-octet string, representing the Slice Differentiator, in hexadecimal representation. Each character in the string shall take a value of "0" to "9", "a" to "f" or "A" to "F" and shall represent 4 bits. The most significant character representing the 4 most significant bits of the SD shall appear first in the string, and the character representing the 4 least significant bit of the SD shall appear last in the string. This is an optional parameter that complements the Slice/Service type(s) to allow to differentiate amongst multiple Network Slices of the same Slice/Service type. This IE shall be absent if no SD value is associated with the SST. + pattern: "^[A-Fa-f0-9]{6}$" + title: sd + type: string + required: + - sst + title: Snssai + type: object + NsiId: + description: Contains the Identifier of the selected Network Slice instance + title: NsiId + type: string diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/test/test_default_controller.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/test/test_default_controller.py index f7ba5ceeee3f78f43743e3d8aef094d009850ae6..c4d6419544038532954713ffd3b9fdc8484bcb2a 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/test/test_default_controller.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/test/test_default_controller.py @@ -1,5 +1,8 @@ import unittest +from capif_acl.models.access_control_policy_list import \ + AccessControlPolicyList # noqa: E501 +from capif_acl.models.problem_details import ProblemDetails # noqa: E501 from capif_acl.test import BaseTestCase diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/requirements.txt b/services/TS29222_CAPIF_Access_Control_Policy_API/requirements.txt index 9524b428474a65994a73415e09f64870c3aa64fe..b8e474bead55344df34757f23663ebeb612c3ca7 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/requirements.txt +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/requirements.txt @@ -1,22 +1,22 @@ connexion[flask, swagger-ui, uvicorn] == 3.1.0; python_version>="3.6" swagger-ui-bundle >= 0.0.2 python_dateutil >= 2.6.0 -setuptools == 74.0.0 +setuptools == 80.9.0 Flask == 3.0.3 pymongo == 4.7.3 redis == 4.5.4 flask_jwt_extended == 4.6.0 -cryptography == 42.0.8 -opentelemetry-instrumentation == 0.40b0 -opentelemetry-instrumentation-flask == 0.40b0 -opentelemetry-instrumentation-redis == 0.40b0 -opentelemetry-instrumentation-pymongo == 0.40b0 -opentelemetry-exporter-otlp == 1.19.0 -opentelemetry-exporter-jaeger == 1.19.0 +cryptography == 46.0.1 +opentelemetry-instrumentation == 0.41b0 +opentelemetry-instrumentation-flask == 0.41b0 +opentelemetry-instrumentation-redis == 0.41b0 +opentelemetry-instrumentation-pymongo == 0.41b0 +opentelemetry-exporter-otlp == 1.20.0 +opentelemetry-exporter-jaeger == 1.21.0 fluent == 0.10.0 fluent-logger == 0.10.0 -opentelemetry-api == 1.19.0 -opentelemetry-sdk == 1.19.0 +opentelemetry-api == 1.20.0 +opentelemetry-sdk == 1.20.0 flask_executor == 1.0.0 Flask-APScheduler == 1.13.1 Flask-Script == 2.0.6 diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/setup.py b/services/TS29222_CAPIF_Access_Control_Policy_API/setup.py index 276b24f96e8f7cf5b0dcb2e2704f438437242702..77f4fffb6fbba96e7fb4fe9c269ce24c08b95e35 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/setup.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/setup.py @@ -1,3 +1,4 @@ + from setuptools import find_packages, setup NAME = "capif_acl" @@ -30,7 +31,7 @@ setup( entry_points={ 'console_scripts': ['capif_acl=capif_acl.__main__:main']}, long_description="""\ - API for access control policy. © 2024, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. + API for access control policy. © 2025, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. """ ) diff --git a/services/TS29222_CAPIF_Auditing_API/.openapi-generator/FILES b/services/TS29222_CAPIF_Auditing_API/.openapi-generator/FILES index bd1da3346cdaf61b7947732cc2288758d4950728..b335347f7a45b9dca7d9747527a6c5c56f87c834 100644 --- a/services/TS29222_CAPIF_Auditing_API/.openapi-generator/FILES +++ b/services/TS29222_CAPIF_Auditing_API/.openapi-generator/FILES @@ -19,11 +19,13 @@ logs/models/invocation_log.py logs/models/invocation_logs.py logs/models/invocation_logs_retrieve_res.py logs/models/log.py +logs/models/net_slice_id.py logs/models/o_auth_grant_type.py logs/models/operation.py logs/models/problem_details.py logs/models/protocol.py logs/models/security_method.py +logs/models/snssai.py logs/openapi/openapi.yaml logs/test/__init__.py logs/test/test_default_controller.py diff --git a/services/TS29222_CAPIF_Auditing_API/logs/app.py b/services/TS29222_CAPIF_Auditing_API/logs/app.py index 83fd706eb66ad2736ecd727d06964ae6acd5bc5e..803b3cb3a95aebf75c7211a88dab783a02d8d882 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/app.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/app.py @@ -9,12 +9,14 @@ import encoder from config import Config from fluent import sender from opentelemetry import trace -from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter +from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import \ + OTLPSpanExporter from opentelemetry.instrumentation.flask import FlaskInstrumentor from opentelemetry.sdk.resources import Resource from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import BatchSpanProcessor -from opentelemetry.trace.propagation.tracecontext import TraceContextTextMapPropagator +from opentelemetry.trace.propagation.tracecontext import \ + TraceContextTextMapPropagator NAME = "Logs-Service" diff --git a/services/TS29222_CAPIF_Auditing_API/logs/controllers/default_controller.py b/services/TS29222_CAPIF_Auditing_API/logs/controllers/default_controller.py index 0f2866e5066a67cf500c31fb5310897acbb5ef73..e5ac1ef79690f9b3930b8233f736b3ae5617b759 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/controllers/default_controller.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/controllers/default_controller.py @@ -1,11 +1,19 @@ +from functools import wraps + +from cryptography import x509 +from cryptography.hazmat.backends import default_backend from flask import current_app, request + +from ..core.responses import bad_request_error, unauthorized_error from logs import util -from logs.models.interface_description import InterfaceDescription # noqa: E501 +from logs.models.interface_description import \ + InterfaceDescription # noqa: E501 +from logs.models.invocation_logs_retrieve_res import \ + InvocationLogsRetrieveRes # noqa: E501 +from logs.models.net_slice_id import NetSliceId # noqa: E501 from logs.models.operation import Operation # noqa: E501 +from logs.models.problem_details import ProblemDetails # noqa: E501 from logs.models.protocol import Protocol # noqa: E501 -from functools import wraps -from cryptography import x509 -from cryptography.hazmat.backends import default_backend from ..core.auditoperations import AuditOperations from ..core.responses import bad_request_error @@ -20,8 +28,12 @@ def cert_validation(): @wraps(f) def __cert_validation(*args, **kwargs): - args = request.view_args - cert_tmp = request.headers['X-Ssl-Client-Cert'] + request.view_args + cert_tmp = request.headers.get('X-Ssl-Client-Cert') + + if not cert_tmp: + return unauthorized_error("Client certificate required", "X-Ssl-Client-Cert header is missing") + cert_raw = cert_tmp.replace('\t', '') cert = x509.load_pem_x509_certificate(str.encode(cert_raw), default_backend()) @@ -40,9 +52,8 @@ def cert_validation(): return __cert_validation return _cert_validation - @cert_validation() -def api_invocation_logs_get(aef_id=None, api_invoker_id=None, time_range_start=None, time_range_end=None, api_id=None, api_name=None, api_version=None, protocol=None, operation=None, result=None, resource_name=None, src_interface=None, dest_interface=None, supported_features=None): # noqa: E501 +def api_invocation_logs_get(aef_id=None, api_invoker_id=None, time_range_start=None, time_range_end=None, api_id=None, api_name=None, api_version=None, protocol=None, operation=None, result=None, resource_name=None, src_interface=None, dest_interface=None, supported_features=None, net_slice_info=None): # noqa: E501 """api_invocation_logs_get Query and retrieve service API invocation logs stored on the CAPIF core function. # noqa: E501 @@ -57,7 +68,7 @@ def api_invocation_logs_get(aef_id=None, api_invoker_id=None, time_range_start=N :type time_range_end: str :param api_id: String identifying the API invoked. :type api_id: str - :param api_name: API name, it is set as {apiName} part of the URI structure as defined in clause 5.2.4 of 3GPP TS 29.122. + :param api_name: Contains the API name set to the value of the \"<apiName>\" placeholder of the API URI as defined in clause 5.2.4 of 3GPP TS 29.122 [14]. :type api_name: str :param api_version: Version of the API which was invoked. :type api_version: str @@ -75,6 +86,8 @@ def api_invocation_logs_get(aef_id=None, api_invoker_id=None, time_range_start=N :type dest_interface: dict | bytes :param supported_features: To filter irrelevant responses related to unsupported features :type supported_features: str + :param net_slice_info: Contains the identifier(s) of the network slice(s) within which the API shall be available. + :type net_slice_info: list | bytes :rtype: Union[InvocationLogsRetrieveRes, Tuple[InvocationLogsRetrieveRes, int], Tuple[InvocationLogsRetrieveRes, int, Dict[str, str]] """ @@ -96,7 +109,9 @@ def api_invocation_logs_get(aef_id=None, api_invoker_id=None, time_range_start=N src_interface = InterfaceDescription.from_dict(request.get_json()) # noqa: E501 if request.is_json: dest_interface = InterfaceDescription.from_dict(request.get_json()) # noqa: E501 - + if request.is_json: + net_slice_info = [NetSliceId.from_dict(d) for d in request.get_json()] # noqa: E501 + query_params = {"aef_id": aef_id, "api_invoker_id": api_invoker_id, "time_range_start": time_range_start, diff --git a/services/TS29222_CAPIF_Auditing_API/logs/controllers/security_controller.py b/services/TS29222_CAPIF_Auditing_API/logs/controllers/security_controller.py index 139597f9cb07c5d48bed18984ec4747f4b4f3438..8b137891791fe96927ad78e64b0aad7bded08bdc 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/controllers/security_controller.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/controllers/security_controller.py @@ -1,2 +1 @@ - diff --git a/services/TS29222_CAPIF_Auditing_API/logs/core/auditoperations.py b/services/TS29222_CAPIF_Auditing_API/logs/core/auditoperations.py index 6d41cf70cca99b0ff97bebb7b223b1007292dc84..101cbb6a96ba70f35ad9ebbae4969ce3729dab85 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/core/auditoperations.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/core/auditoperations.py @@ -6,8 +6,8 @@ from flask import current_app from ..models.invocation_log import InvocationLog from ..util import serialize_clean_camel_case from .resources import Resource -from .responses import bad_request_error, internal_server_error, make_response, not_found_error - +from .responses import (bad_request_error, internal_server_error, + make_response, not_found_error) TOTAL_FEATURES = 2 SUPPORTED_FEATURES_HEX = "1" diff --git a/services/TS29222_CAPIF_Auditing_API/logs/core/responses.py b/services/TS29222_CAPIF_Auditing_API/logs/core/responses.py index 8f975cbf426c304c4ae0681f65af67fcad9abca5..8ba055f9295f90258ff39547a9f4af1b22a75a30 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/core/responses.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/core/responses.py @@ -33,11 +33,18 @@ def bad_request_error(detail, cause, invalid_params): prob = ProblemDetails(title="Bad Request", status=400, detail=detail, cause=cause, invalid_params=invalid_params) prob = serialize_clean_camel_case(prob) - return Response(json.dumps(prob, cls=CustomJSONEncoder), status=400, mimetype=cause) + return Response(json.dumps(prob, cls=CustomJSONEncoder), status=400, mimetype=mimetype) def not_found_error(detail, cause): prob = ProblemDetails(title="Not Found", status=404, detail=detail, cause=cause) prob = serialize_clean_camel_case(prob) - return Response(json.dumps(prob, cls=CustomJSONEncoder), status=404, mimetype=mimetype) \ No newline at end of file + return Response(json.dumps(prob, cls=CustomJSONEncoder), status=404, mimetype=mimetype) + + +def unauthorized_error(detail, cause): + prob = ProblemDetails(title="Unauthorized", status=401, detail=detail, cause=cause) + prob = serialize_clean_camel_case(prob) + + return Response(json.dumps(prob, cls=CustomJSONEncoder), status=401, mimetype=mimetype) \ No newline at end of file diff --git a/services/TS29222_CAPIF_Auditing_API/logs/encoder.py b/services/TS29222_CAPIF_Auditing_API/logs/encoder.py index f9d89aae1a1b66b91d9a0d0f20a2dc183c6797c4..763c2b5ccca5abccbcc6a695aec063ea6b9d1a1d 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/encoder.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/encoder.py @@ -15,4 +15,4 @@ class CustomJSONEncoder(JSONEncoder): attr = o.attribute_map[attr] dikt[attr] = value return dikt - return JSONEncoder.default(self, o) \ No newline at end of file + return JSONEncoder.default(self, o) diff --git a/services/TS29222_CAPIF_Auditing_API/logs/models/log.py b/services/TS29222_CAPIF_Auditing_API/logs/models/log.py index a3c965eed702014df5b6331483c309157fa5aa38..719cbb5a1aa757ceeac2e3cdcc1f7d29f0983390 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/models/log.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/models/log.py @@ -3,7 +3,9 @@ from typing import Dict, List # noqa: F401 from logs import util from logs.models.base_model import Model -from logs.models.interface_description import InterfaceDescription # noqa: E501 +from logs.models.interface_description import \ + InterfaceDescription # noqa: E501 +from logs.models.net_slice_id import NetSliceId # noqa: E501 from logs.models.operation import Operation # noqa: E501 from logs.models.protocol import Protocol # noqa: E501 @@ -14,7 +16,7 @@ class Log(Model): Do not edit the class manually. """ - def __init__(self, api_id=None, api_name=None, api_version=None, resource_name=None, uri=None, protocol=None, operation=None, result=None, invocation_time=None, invocation_latency=None, input_parameters=None, output_parameters=None, src_interface=None, dest_interface=None, fwd_interface=None): # noqa: E501 + def __init__(self, api_id=None, api_name=None, api_version=None, resource_name=None, uri=None, protocol=None, operation=None, result=None, invocation_time=None, invocation_latency=None, input_parameters=None, output_parameters=None, src_interface=None, dest_interface=None, fwd_interface=None, net_slice_info=None): # noqa: E501 """Log - a model defined in OpenAPI :param api_id: The api_id of this Log. # noqa: E501 @@ -47,6 +49,8 @@ class Log(Model): :type dest_interface: InterfaceDescription :param fwd_interface: The fwd_interface of this Log. # noqa: E501 :type fwd_interface: str + :param net_slice_info: The net_slice_info of this Log. # noqa: E501 + :type net_slice_info: NetSliceId """ self.openapi_types = { 'api_id': str, @@ -63,7 +67,8 @@ class Log(Model): 'output_parameters': object, 'src_interface': InterfaceDescription, 'dest_interface': InterfaceDescription, - 'fwd_interface': str + 'fwd_interface': str, + 'net_slice_info': NetSliceId } self.attribute_map = { @@ -81,7 +86,8 @@ class Log(Model): 'output_parameters': 'outputParameters', 'src_interface': 'srcInterface', 'dest_interface': 'destInterface', - 'fwd_interface': 'fwdInterface' + 'fwd_interface': 'fwdInterface', + 'net_slice_info': 'netSliceInfo' } self._api_id = api_id @@ -99,6 +105,7 @@ class Log(Model): self._src_interface = src_interface self._dest_interface = dest_interface self._fwd_interface = fwd_interface + self._net_slice_info = net_slice_info @classmethod def from_dict(cls, dikt) -> 'Log': @@ -140,7 +147,7 @@ class Log(Model): def api_name(self) -> str: """Gets the api_name of this Log. - Name of the API which was invoked, it is set as {apiName} part of the URI structure as defined in clause 5.2.4 of 3GPP TS 29.122. # noqa: E501 + Contains the invoked API name set to the value of the \"\" placeholder of the API URI as defined in clause 5.2.4 of 3GPP TS 29.122 [14]. # noqa: E501 :return: The api_name of this Log. :rtype: str @@ -151,7 +158,7 @@ class Log(Model): def api_name(self, api_name: str): """Sets the api_name of this Log. - Name of the API which was invoked, it is set as {apiName} part of the URI structure as defined in clause 5.2.4 of 3GPP TS 29.122. # noqa: E501 + Contains the invoked API name set to the value of the \"\" placeholder of the API URI as defined in clause 5.2.4 of 3GPP TS 29.122 [14]. # noqa: E501 :param api_name: The api_name of this Log. :type api_name: str @@ -461,3 +468,24 @@ class Log(Model): """ self._fwd_interface = fwd_interface + + @property + def net_slice_info(self) -> NetSliceId: + """Gets the net_slice_info of this Log. + + + :return: The net_slice_info of this Log. + :rtype: NetSliceId + """ + return self._net_slice_info + + @net_slice_info.setter + def net_slice_info(self, net_slice_info: NetSliceId): + """Sets the net_slice_info of this Log. + + + :param net_slice_info: The net_slice_info of this Log. + :type net_slice_info: NetSliceId + """ + + self._net_slice_info = net_slice_info diff --git a/services/TS29222_CAPIF_Auditing_API/logs/models/net_slice_id.py b/services/TS29222_CAPIF_Auditing_API/logs/models/net_slice_id.py new file mode 100644 index 0000000000000000000000000000000000000000..2db6ba6ccc27eff94ce76de1146f1fa7148a63a0 --- /dev/null +++ b/services/TS29222_CAPIF_Auditing_API/logs/models/net_slice_id.py @@ -0,0 +1,117 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from logs import util +from logs.models.base_model import Model +from logs.models.snssai import Snssai # noqa: E501 + + +class NetSliceId(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, snssai=None, nsi_id=None, ensi=None): # noqa: E501 + """NetSliceId - a model defined in OpenAPI + + :param snssai: The snssai of this NetSliceId. # noqa: E501 + :type snssai: Snssai + :param nsi_id: The nsi_id of this NetSliceId. # noqa: E501 + :type nsi_id: str + :param ensi: The ensi of this NetSliceId. # noqa: E501 + :type ensi: str + """ + self.openapi_types = { + 'snssai': Snssai, + 'nsi_id': str, + 'ensi': str + } + + self.attribute_map = { + 'snssai': 'snssai', + 'nsi_id': 'nsiId', + 'ensi': 'ensi' + } + + self._snssai = snssai + self._nsi_id = nsi_id + self._ensi = ensi + + @classmethod + def from_dict(cls, dikt) -> 'NetSliceId': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The NetSliceId of this NetSliceId. # noqa: E501 + :rtype: NetSliceId + """ + return util.deserialize_model(dikt, cls) + + @property + def snssai(self) -> Snssai: + """Gets the snssai of this NetSliceId. + + + :return: The snssai of this NetSliceId. + :rtype: Snssai + """ + return self._snssai + + @snssai.setter + def snssai(self, snssai: Snssai): + """Sets the snssai of this NetSliceId. + + + :param snssai: The snssai of this NetSliceId. + :type snssai: Snssai + """ + + self._snssai = snssai + + @property + def nsi_id(self) -> str: + """Gets the nsi_id of this NetSliceId. + + Contains the Identifier of the selected Network Slice instance # noqa: E501 + + :return: The nsi_id of this NetSliceId. + :rtype: str + """ + return self._nsi_id + + @nsi_id.setter + def nsi_id(self, nsi_id: str): + """Sets the nsi_id of this NetSliceId. + + Contains the Identifier of the selected Network Slice instance # noqa: E501 + + :param nsi_id: The nsi_id of this NetSliceId. + :type nsi_id: str + """ + + self._nsi_id = nsi_id + + @property + def ensi(self) -> str: + """Gets the ensi of this NetSliceId. + + Represents the External Network Slice Information that is used to identify a network slice, as specified in 3GPP TS 33.501. # noqa: E501 + + :return: The ensi of this NetSliceId. + :rtype: str + """ + return self._ensi + + @ensi.setter + def ensi(self, ensi: str): + """Sets the ensi of this NetSliceId. + + Represents the External Network Slice Information that is used to identify a network slice, as specified in 3GPP TS 33.501. # noqa: E501 + + :param ensi: The ensi of this NetSliceId. + :type ensi: str + """ + + self._ensi = ensi diff --git a/services/TS29222_CAPIF_Auditing_API/logs/models/snssai.py b/services/TS29222_CAPIF_Auditing_API/logs/models/snssai.py new file mode 100644 index 0000000000000000000000000000000000000000..9fa77af6f3493c8fe6e81daf2b0273867d000223 --- /dev/null +++ b/services/TS29222_CAPIF_Auditing_API/logs/models/snssai.py @@ -0,0 +1,99 @@ +import re # noqa: E501 +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from logs import util +from logs.models.base_model import Model + + +class Snssai(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, sst=None, sd=None): # noqa: E501 + """Snssai - a model defined in OpenAPI + + :param sst: The sst of this Snssai. # noqa: E501 + :type sst: int + :param sd: The sd of this Snssai. # noqa: E501 + :type sd: str + """ + self.openapi_types = { + 'sst': int, + 'sd': str + } + + self.attribute_map = { + 'sst': 'sst', + 'sd': 'sd' + } + + self._sst = sst + self._sd = sd + + @classmethod + def from_dict(cls, dikt) -> 'Snssai': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The Snssai of this Snssai. # noqa: E501 + :rtype: Snssai + """ + return util.deserialize_model(dikt, cls) + + @property + def sst(self) -> int: + """Gets the sst of this Snssai. + + Unsigned integer, within the range 0 to 255, representing the Slice/Service Type. It indicates the expected Network Slice behaviour in terms of features and services. Values 0 to 127 correspond to the standardized SST range. Values 128 to 255 correspond to the Operator-specific range. See clause 28.4.2 of 3GPP TS 23.003. Standardized values are defined in clause 5.15.2.2 of 3GPP TS 23.501. # noqa: E501 + + :return: The sst of this Snssai. + :rtype: int + """ + return self._sst + + @sst.setter + def sst(self, sst: int): + """Sets the sst of this Snssai. + + Unsigned integer, within the range 0 to 255, representing the Slice/Service Type. It indicates the expected Network Slice behaviour in terms of features and services. Values 0 to 127 correspond to the standardized SST range. Values 128 to 255 correspond to the Operator-specific range. See clause 28.4.2 of 3GPP TS 23.003. Standardized values are defined in clause 5.15.2.2 of 3GPP TS 23.501. # noqa: E501 + + :param sst: The sst of this Snssai. + :type sst: int + """ + if sst is None: + raise ValueError("Invalid value for `sst`, must not be `None`") # noqa: E501 + if sst is not None and sst > 255: # noqa: E501 + raise ValueError("Invalid value for `sst`, must be a value less than or equal to `255`") # noqa: E501 + if sst is not None and sst < 0: # noqa: E501 + raise ValueError("Invalid value for `sst`, must be a value greater than or equal to `0`") # noqa: E501 + + self._sst = sst + + @property + def sd(self) -> str: + """Gets the sd of this Snssai. + + 3-octet string, representing the Slice Differentiator, in hexadecimal representation. Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent 4 bits. The most significant character representing the 4 most significant bits of the SD shall appear first in the string, and the character representing the 4 least significant bit of the SD shall appear last in the string. This is an optional parameter that complements the Slice/Service type(s) to allow to differentiate amongst multiple Network Slices of the same Slice/Service type. This IE shall be absent if no SD value is associated with the SST. # noqa: E501 + + :return: The sd of this Snssai. + :rtype: str + """ + return self._sd + + @sd.setter + def sd(self, sd: str): + """Sets the sd of this Snssai. + + 3-octet string, representing the Slice Differentiator, in hexadecimal representation. Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent 4 bits. The most significant character representing the 4 most significant bits of the SD shall appear first in the string, and the character representing the 4 least significant bit of the SD shall appear last in the string. This is an optional parameter that complements the Slice/Service type(s) to allow to differentiate amongst multiple Network Slices of the same Slice/Service type. This IE shall be absent if no SD value is associated with the SST. # noqa: E501 + + :param sd: The sd of this Snssai. + :type sd: str + """ + if sd is not None and not re.search(r'^[A-Fa-f0-9]{6}$', sd): # noqa: E501 + raise ValueError(r"Invalid value for `sd`, must be a follow pattern or equal to `/^[A-Fa-f0-9]{6}$/`") # noqa: E501 + + self._sd = sd diff --git a/services/TS29222_CAPIF_Auditing_API/logs/openapi/openapi.yaml b/services/TS29222_CAPIF_Auditing_API/logs/openapi/openapi.yaml index 8fb314aee31fdc301fd0b1e7e69c094ca78d7196..c1ed51ce890949f7f86b8d93ae288178803cfe73 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/openapi/openapi.yaml +++ b/services/TS29222_CAPIF_Auditing_API/logs/openapi/openapi.yaml @@ -1,11 +1,11 @@ openapi: 3.0.0 info: - description: "API for auditing. \n© 2024, 3GPP Organizational Partners (ARIB, ATIS,\ + description: "API for auditing. \n© 2025, 3GPP Organizational Partners (ARIB, ATIS,\ \ CCSA, ETSI, TSDSI, TTA, TTC). \nAll rights reserved.\n" title: CAPIF_Auditing_API - version: 1.3.0 + version: 1.4.0-alpha.2 externalDocs: - description: 3GPP TS 29.222 V18.6.0 Common API Framework for 3GPP Northbound APIs + description: 3GPP TS 29.222 V19.3.0 Common API Framework for 3GPP Northbound APIs url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.222/ servers: - url: "{apiRoot}/logs/v1" @@ -62,7 +62,7 @@ paths: type: string style: form - description: | - API name, it is set as {apiName} part of the URI structure as defined in clause 5.2.4 of 3GPP TS 29.122. + Contains the API name set to the value of the "" placeholder of the API URI as defined in clause 5.2.4 of 3GPP TS 29.122 [14]. explode: true in: query name: api-name @@ -134,6 +134,18 @@ paths: schema: $ref: '#/components/schemas/SupportedFeatures' style: form + - content: + application/json: + schema: + items: + $ref: '#/components/schemas/NetSliceId' + minItems: 1 + type: array + description: | + Contains the identifier(s) of the network slice(s) within which the API shall be available. + in: query + name: net-slice-info + required: false responses: "200": content: @@ -363,9 +375,9 @@ components: ipv4Addr: ipv4Addr nullable: true oneOf: - - required: ["fqdn"] - - required: ["ipv4Addr"] - - required: ["ipv6Addr"] + - required: ["ipv4Addr"] + - required: ["ipv6Addr"] + - required: ["fqdn"] properties: ipv4Addr: description: | @@ -429,6 +441,39 @@ components: pattern: "^[A-Fa-f0-9]*$" title: SupportedFeatures type: string + NetSliceId: + description: | + Represents the network slice identification information. + example: + ensi: ensi + snssai: + sd: sd + sst: 37 + nsiId: nsiId + nullable: true + oneOf: + - required: ["snssai"] + - required: ["nsiId"] + - required: ["ensi"] + properties: + snssai: + $ref: '#/components/schemas/Snssai' + nsiId: + description: Contains the Identifier of the selected Network Slice instance + title: NsiId + type: string + ensi: + description: | + Represents the External Network Slice Information that is used to identify a network slice, as specified in 3GPP TS 33.501. + title: Ensi + type: string + title: NetSliceId + type: object + Ensi: + description: | + Represents the External Network Slice Information that is used to identify a network slice, as specified in 3GPP TS 33.501. + title: Ensi + type: string ProblemDetails: description: Represents additional information and details on an error response. properties: @@ -526,6 +571,12 @@ components: result: result protocol: HTTP_1_1 apiVersion: apiVersion + netSliceInfo: + ensi: ensi + snssai: + sd: sd + sst: 37 + nsiId: nsiId destInterface: ipv6Addr: ipv6Addr grantTypes: @@ -563,6 +614,12 @@ components: result: result protocol: HTTP_1_1 apiVersion: apiVersion + netSliceInfo: + ensi: ensi + snssai: + sd: sd + sst: 37 + nsiId: nsiId destInterface: ipv6Addr: ipv6Addr grantTypes: @@ -632,6 +689,12 @@ components: result: result protocol: HTTP_1_1 apiVersion: apiVersion + netSliceInfo: + ensi: ensi + snssai: + sd: sd + sst: 37 + nsiId: nsiId destInterface: ipv6Addr: ipv6Addr grantTypes: @@ -654,7 +717,7 @@ components: type: string apiName: description: | - Name of the API which was invoked, it is set as {apiName} part of the URI structure as defined in clause 5.2.4 of 3GPP TS 29.122. + Contains the invoked API name set to the value of the "" placeholder of the API URI as defined in clause 5.2.4 of 3GPP TS 29.122 [14]. title: apiName type: string apiVersion: @@ -704,6 +767,8 @@ components: It includes the node identifier (as defined in IETF RFC 7239 of all forwarding entities between the API invoker and the AEF, concatenated with comma and space, e.g. 192.0.2.43:80, unknown:_OBFport, 203.0.113.60 title: fwdInterface type: string + netSliceInfo: + $ref: '#/components/schemas/NetSliceId' required: - apiId - apiName @@ -755,3 +820,35 @@ components: \ authorization code.\n- AUTHORIZATION_CODE_WITH_PKCE: Indicate that the grant\ \ type is authorization code with PKCE.\n" title: OAuthGrantType + Snssai: + description: | + When Snssai needs to be converted to string (e.g. when used in maps as key), the string shall be composed of one to three digits "sst" optionally followed by "-" and 6 hexadecimal digits "sd". + example: + sd: sd + sst: 37 + properties: + sst: + description: "Unsigned integer, within the range 0 to 255, representing\ + \ the Slice/Service Type. It indicates the expected Network Slice behaviour\ + \ in terms of features and services. Values 0 to 127 correspond to the\ + \ standardized SST range. Values 128 to 255 correspond to the Operator-specific\ + \ range. See clause 28.4.2 of 3GPP TS 23.003. Standardized values are\ + \ defined in clause 5.15.2.2 of 3GPP TS 23.501. \n" + maximum: 255 + minimum: 0 + title: sst + type: integer + sd: + description: | + 3-octet string, representing the Slice Differentiator, in hexadecimal representation. Each character in the string shall take a value of "0" to "9", "a" to "f" or "A" to "F" and shall represent 4 bits. The most significant character representing the 4 most significant bits of the SD shall appear first in the string, and the character representing the 4 least significant bit of the SD shall appear last in the string. This is an optional parameter that complements the Slice/Service type(s) to allow to differentiate amongst multiple Network Slices of the same Slice/Service type. This IE shall be absent if no SD value is associated with the SST. + pattern: "^[A-Fa-f0-9]{6}$" + title: sd + type: string + required: + - sst + title: Snssai + type: object + NsiId: + description: Contains the Identifier of the selected Network Slice instance + title: NsiId + type: string diff --git a/services/TS29222_CAPIF_Auditing_API/logs/test/test_default_controller.py b/services/TS29222_CAPIF_Auditing_API/logs/test/test_default_controller.py index 3e2153c698928b38b480f5515ee684aa2df07279..03d0643511e63345133e7f92a70bef0027c82e30 100644 --- a/services/TS29222_CAPIF_Auditing_API/logs/test/test_default_controller.py +++ b/services/TS29222_CAPIF_Auditing_API/logs/test/test_default_controller.py @@ -1,7 +1,10 @@ import unittest -from logs.models.interface_description import InterfaceDescription # noqa: E501 -from logs.models.invocation_logs_retrieve_res import InvocationLogsRetrieveRes # noqa: E501 +from logs.models.interface_description import \ + InterfaceDescription # noqa: E501 +from logs.models.invocation_logs_retrieve_res import \ + InvocationLogsRetrieveRes # noqa: E501 +from logs.models.net_slice_id import NetSliceId # noqa: E501 from logs.models.operation import Operation # noqa: E501 from logs.models.problem_details import ProblemDetails # noqa: E501 from logs.models.protocol import Protocol # noqa: E501 @@ -29,7 +32,8 @@ class TestDefaultController(BaseTestCase): ('resource-name', 'resource_name_example'), ('src-interface', openapi_server.InterfaceDescription()), ('dest-interface', openapi_server.InterfaceDescription()), - ('supported-features', 'supported_features_example')] + ('supported-features', 'supported_features_example'), + ('net-slice-info', [openapi_server.NetSliceId()])] headers = { 'Accept': 'application/json', } diff --git a/services/TS29222_CAPIF_Auditing_API/requirements.txt b/services/TS29222_CAPIF_Auditing_API/requirements.txt index 40ed48bc91701df99195001fb4fa7b034ce3485b..181b2507b026055721c649553c09ca7ad893b856 100644 --- a/services/TS29222_CAPIF_Auditing_API/requirements.txt +++ b/services/TS29222_CAPIF_Auditing_API/requirements.txt @@ -1,24 +1,24 @@ connexion[flask, swagger-ui, uvicorn] == 3.1.0; python_version>="3.6" swagger-ui-bundle >= 0.0.2 python_dateutil >= 2.6.0 -setuptools == 74.0.0 +setuptools == 80.9.0 Flask == 3.0.3 pymongo == 4.7.3 elasticsearch == 8.4.3 flask_jwt_extended == 4.6.0 -cryptography == 42.0.8 -opentelemetry-instrumentation == 0.40b0 -opentelemetry-instrumentation-flask == 0.40b0 -opentelemetry-instrumentation-redis == 0.40b0 -opentelemetry-instrumentation-pymongo == 0.40b0 -opentelemetry-exporter-otlp == 1.19.0 -opentelemetry-exporter-jaeger == 1.19.0 +cryptography == 46.0.1 +opentelemetry-instrumentation == 0.41b0 +opentelemetry-instrumentation-flask == 0.41b0 +opentelemetry-instrumentation-redis == 0.41b0 +opentelemetry-instrumentation-pymongo == 0.41b0 +opentelemetry-exporter-otlp == 1.20.0 +opentelemetry-exporter-jaeger == 1.21.0 fluent == 0.10.0 fluent-logger == 0.10.0 -opentelemetry-api == 1.19.0 -opentelemetry-sdk == 1.19.0 +opentelemetry-api == 1.20.0 +opentelemetry-sdk == 1.20.0 flask_executor == 1.0.0 -werkzeug == 3.0.4 -pyopenssl == 24.1.0 +werkzeug == 3.1.3 +pyopenssl == 25.3.0 gunicorn == 23.0.0 packaging == 24.0 diff --git a/services/TS29222_CAPIF_Auditing_API/setup.py b/services/TS29222_CAPIF_Auditing_API/setup.py index cbd1ece814a8385bc3e5a8736a78ef3059004677..ec28305f2d18d57e29b3f3a25ded6978b694376d 100644 --- a/services/TS29222_CAPIF_Auditing_API/setup.py +++ b/services/TS29222_CAPIF_Auditing_API/setup.py @@ -31,7 +31,7 @@ setup( entry_points={ 'console_scripts': ['logs=logs.__main__:main']}, long_description="""\ - API for auditing. © 2024, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. + API for auditing. © 2025, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. """ ) diff --git a/services/TS29222_CAPIF_Discover_Service_API/.openapi-generator/FILES b/services/TS29222_CAPIF_Discover_Service_API/.openapi-generator/FILES index 58bf048706ca533004614150810a464658968860..a2133fcf31c4858d48c37b896c191ff10364cb53 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/.openapi-generator/FILES +++ b/services/TS29222_CAPIF_Discover_Service_API/.openapi-generator/FILES @@ -35,6 +35,7 @@ service_apis/models/ipv6_address_range.py service_apis/models/local2d_point_uncertainty_ellipse.py service_apis/models/local3d_point_uncertainty_ellipsoid.py service_apis/models/local_origin.py +service_apis/models/net_slice_id.py service_apis/models/o_auth_grant_type.py service_apis/models/operation.py service_apis/models/point.py @@ -47,11 +48,13 @@ service_apis/models/problem_details.py service_apis/models/protocol.py service_apis/models/published_api_path.py service_apis/models/relative_cartesian_location.py +service_apis/models/res_oper_info.py service_apis/models/resource.py service_apis/models/security_method.py service_apis/models/service_api_description.py service_apis/models/service_kpis.py service_apis/models/shareable_information.py +service_apis/models/snssai.py service_apis/models/supported_gad_shapes.py service_apis/models/uncertainty_ellipse.py service_apis/models/uncertainty_ellipsoid.py diff --git a/services/TS29222_CAPIF_Discover_Service_API/requirements.txt b/services/TS29222_CAPIF_Discover_Service_API/requirements.txt index 04ff0c7747c9fdcea4fefc1f2f5d0b37eea3cd9e..c7aa3456d3a1806812593f4f394965b12a1be0da 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/requirements.txt +++ b/services/TS29222_CAPIF_Discover_Service_API/requirements.txt @@ -1,24 +1,24 @@ connexion[flask, swagger-ui, uvicorn] == 3.1.0; python_version>="3.6" swagger-ui-bundle >= 0.0.2 python_dateutil >= 2.6.0 -setuptools == 74.0.0 +setuptools == 80.9.0 Flask == 3.0.3 pymongo == 4.7.3 redis == 4.5.4 flask_jwt_extended == 4.6.0 -cryptography == 42.0.8 +cryptography == 46.0.1 rfc3987 == 1.3.8 -opentelemetry-instrumentation == 0.40b0 -opentelemetry-instrumentation-flask == 0.40b0 -opentelemetry-instrumentation-redis == 0.40b0 -opentelemetry-instrumentation-pymongo == 0.40b0 -opentelemetry-exporter-otlp == 1.19.0 -opentelemetry-exporter-jaeger == 1.19.0 +opentelemetry-instrumentation == 0.41b0 +opentelemetry-instrumentation-flask == 0.41b0 +opentelemetry-instrumentation-redis == 0.41b0 +opentelemetry-instrumentation-pymongo == 0.41b0 +opentelemetry-exporter-otlp == 1.20.0 +opentelemetry-exporter-jaeger == 1.21.0 fluent == 0.10.0 fluent-logger == 0.10.0 -opentelemetry-api == 1.19.0 -opentelemetry-sdk == 1.19.0 +opentelemetry-api == 1.20.0 +opentelemetry-sdk == 1.20.0 flask_executor == 1.0.0 -werkzeug == 3.0.4 +werkzeug == 3.1.3 gunicorn == 23.0.0 packaging == 24.0 diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/app.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/app.py index f84d18445767ff17e6407552dc42462383106854..cf7e60981b9c6971f1abb5690fcd1c75ec156cc8 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/app.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/app.py @@ -10,13 +10,15 @@ from config import Config from flask_jwt_extended import JWTManager from fluent import sender from opentelemetry import trace -from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter +from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import \ + OTLPSpanExporter from opentelemetry.instrumentation.flask import FlaskInstrumentor from opentelemetry.instrumentation.redis import RedisInstrumentor from opentelemetry.sdk.resources import Resource from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import BatchSpanProcessor -from opentelemetry.trace.propagation.tracecontext import TraceContextTextMapPropagator +from opentelemetry.trace.propagation.tracecontext import \ + TraceContextTextMapPropagator NAME = "Discover-Service" diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/default_controller.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/default_controller.py index f742f499500f488c5a78f871d9b98eb66e3edc77..457716d59b5d5df3dc1e2f7596f2ec41456aa5a2 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/default_controller.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/default_controller.py @@ -1,11 +1,26 @@ import json from functools import wraps + from cryptography import x509 from cryptography.hazmat.backends import default_backend from flask import current_app, request +from service_apis.models.aef_location import AefLocation # noqa: E501 +from service_apis.models.communication_type import \ + CommunicationType # noqa: E501 +from service_apis.models.data_format import DataFormat # noqa: E501 from service_apis.models.discovered_apis import DiscoveredAPIs # noqa: E501 - -from ..core.discoveredapis import DiscoverApisOperations, return_negotiated_supp_feat_dict +from service_apis.models.ip_addr_info import IpAddrInfo # noqa: E501 +from service_apis.models.net_slice_id import NetSliceId # noqa: E501 +from service_apis.models.o_auth_grant_type import OAuthGrantType # noqa: E501 +from service_apis.models.problem_details import ProblemDetails # noqa: E501 +from service_apis.models.protocol import Protocol # noqa: E501 + +from ..core.responses import unauthorized_error +from service_apis.models.res_oper_info import ResOperInfo # noqa: E501 +from service_apis.models.service_kpis import ServiceKpis # noqa: E501 + +from ..core.discoveredapis import (DiscoverApisOperations, + return_negotiated_supp_feat_dict) from ..core.validate_user import ControlAccess discover_apis = DiscoverApisOperations() @@ -16,8 +31,12 @@ def cert_validation(): @wraps(f) def __cert_validation(*args, **kwargs): - args = request.view_args - cert_tmp = request.headers['X-Ssl-Client-Cert'] + request.view_args + cert_tmp = request.headers.get('X-Ssl-Client-Cert') + + if not cert_tmp: + return unauthorized_error("Client certificate required", "X-Ssl-Client-Cert header is missing") + cert_raw = cert_tmp.replace('\t', '') cert = x509.load_pem_x509_certificate(str.encode(cert_raw), default_backend()) @@ -37,16 +56,15 @@ def cert_validation(): return __cert_validation return _cert_validation - @cert_validation() -def all_service_apis_get(api_invoker_id, api_name=None, api_version=None, comm_type=None, protocol=None, aef_id=None, data_format=None, api_cat=None, preferred_aef_loc=None, req_api_prov_name=None, supported_features=None, api_supported_features=None, ue_ip_addr=None, service_kpis=None, grant_types=None): # noqa: E501 +def all_service_apis_get(api_invoker_id, api_name=None, api_version=None, comm_type=None, protocol=None, aef_id=None, data_format=None, api_cat=None, preferred_aef_loc=None, req_api_prov_name=None, api_supported_features=None, ue_ip_addr=None, service_kpis=None, net_slice_info=None, grant_types=None, api_ids=None, res_ops=None, supported_features=None): # noqa: E501 """all_service_apis_get Discover published service APIs and retrieve a collection of APIs according to certain filter criteria. # noqa: E501 :param api_invoker_id: String identifying the API invoker assigned by the CAPIF core function. It also represents the CCF identifier in the CAPIF-6/6e interface. :type api_invoker_id: str - :param api_name: API name, it is set as {apiName} part of the URI structure as defined in clause 5.2.4 of 3GPP TS 29.122. + :param api_name: Contains the API name set to the value of the \"<apiName>\" placeholder of the API URI as defined in clause 5.2.4 of 3GPP TS 29.122 [14]. :type api_name: str :param api_version: API major version the URI (e.g. v1). :type api_version: str @@ -64,16 +82,22 @@ def all_service_apis_get(api_invoker_id, api_name=None, api_version=None, comm_t :type preferred_aef_loc: dict | bytes :param req_api_prov_name: Represents the required API provider name. :type req_api_prov_name: str - :param supported_features: Features supported by the NF consumer for the CAPIF Discover Service API. - :type supported_features: str :param api_supported_features: Features supported by the discovered service API indicated by api-name parameter. This may only be present if api-name query parameter is present. :type api_supported_features: str :param ue_ip_addr: Represents the UE IP address information. :type ue_ip_addr: dict | bytes :param service_kpis: Contains iInformation about service characteristics provided by the targeted service API(s). :type service_kpis: dict | bytes + :param net_slice_info: Contains the identifier(s) of the network slice(s) within which the API shall be available. + :type net_slice_info: list | bytes :param grant_types: Contains the OAuth grant types that need to be supported. :type grant_types: list | bytes + :param api_ids: Contains the identifier(s) of the targeted service APIs. When this query parameter is present, then all the other query parameters shall be absent except the supported-features and api-invoker-id query parameters. + :type api_ids: List[str] + :param res_ops: Contains the list of supported API resource(s) and service operation(s). + :type res_ops: list | bytes + :param supported_features: Features supported by the NF consumer for the CAPIF Discover Service API. + :type supported_features: str :rtype: Union[DiscoveredAPIs, Tuple[DiscoveredAPIs, int], Tuple[DiscoveredAPIs, int, Dict[str, str]] """ diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/security_controller.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/security_controller.py index 139597f9cb07c5d48bed18984ec4747f4b4f3438..8b137891791fe96927ad78e64b0aad7bded08bdc 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/security_controller.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/security_controller.py @@ -1,2 +1 @@ - diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/core/discoveredapis.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/core/discoveredapis.py index 394bad686021f3d075a36c6ab34fd3ed5baf0b84..6f9b0651c44e000b53cac0648634fe4661c0c22c 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/core/discoveredapis.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/core/discoveredapis.py @@ -4,14 +4,13 @@ import json from flask import current_app from ..core.resources import Resource -from ..core.responses import internal_server_error, make_response, not_found_error +from ..core.responses import (internal_server_error, make_response, + not_found_error) from ..models.discovered_apis import DiscoveredAPIs from ..util import serialize_clean_camel_case -from ..vendor_specific import ( - filter_apis_with_vendor_specific_params, - find_attribute_in_body, - remove_vendor_specific_fields -) +from ..vendor_specific import (filter_apis_with_vendor_specific_params, + find_attribute_in_body, + remove_vendor_specific_fields) TOTAL_FEATURES = 4 SUPPORTED_FEATURES_HEX = "2" diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/core/responses.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/core/responses.py index 0aafcc670abba4ff62f51e9c6feef77815589a1c..1de771cd973f52d9cdf47538c78b7ad8e12b83da 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/core/responses.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/core/responses.py @@ -33,11 +33,18 @@ def bad_request_error(detail, cause, invalid_params): prob = ProblemDetails(title="Bad Request", status=400, detail=detail, cause=cause, invalid_params=invalid_params) prob = serialize_clean_camel_case(prob) - return Response(json.dumps(prob, cls=CustomJSONEncoder), status=400, mimetype=cause) + return Response(json.dumps(prob, cls=CustomJSONEncoder), status=400, mimetype=mimetype) def not_found_error(detail, cause): prob = ProblemDetails(title="Not Found", status=404, detail=detail, cause=cause) prob = serialize_clean_camel_case(prob) - return Response(json.dumps(prob, cls=CustomJSONEncoder), status=404, mimetype=mimetype) \ No newline at end of file + return Response(json.dumps(prob, cls=CustomJSONEncoder), status=404, mimetype=mimetype) + + +def unauthorized_error(detail, cause): + prob = ProblemDetails(title="Unauthorized", status=401, detail=detail, cause=cause) + prob = serialize_clean_camel_case(prob) + + return Response(json.dumps(prob, cls=CustomJSONEncoder), status=401, mimetype=mimetype) \ No newline at end of file diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/aef_profile.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/aef_profile.py index 1196944181c6d50d1435945100f2f01bb369090f..ce8f77fcd16501791369a5ce56c1a758fe9486ba 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/aef_profile.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/aef_profile.py @@ -5,7 +5,8 @@ from service_apis import util from service_apis.models.aef_location import AefLocation # noqa: E501 from service_apis.models.base_model import Model from service_apis.models.data_format import DataFormat # noqa: E501 -from service_apis.models.interface_description import InterfaceDescription # noqa: E501 +from service_apis.models.interface_description import \ + InterfaceDescription # noqa: E501 from service_apis.models.ip_addr_range import IpAddrRange # noqa: E501 from service_apis.models.o_auth_grant_type import OAuthGrantType # noqa: E501 from service_apis.models.protocol import Protocol # noqa: E501 diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/api_status.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/api_status.py index eef94f955d0404ee74a77a80bc3539a975c8446d..35dcbf45a487cddd2073a97fae24182de1abb1c8 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/api_status.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/api_status.py @@ -42,7 +42,7 @@ class ApiStatus(Model): def aef_ids(self) -> List[str]: """Gets the aef_ids of this ApiStatus. - Indicates the list of AEF ID(s) where the API is active. If this attribute is omitted, the API is inactive at all AEF(s) defined in the \"aefProfiles\" attribute within the ServiceAPIDescription data structure. # noqa: E501 + Indicates the list of AEF ID(s) where the API is active. If an empty array is provided, it indicates that the API is inactive in all AEF(s). # noqa: E501 :return: The aef_ids of this ApiStatus. :rtype: List[str] @@ -53,7 +53,7 @@ class ApiStatus(Model): def aef_ids(self, aef_ids: List[str]): """Sets the aef_ids of this ApiStatus. - Indicates the list of AEF ID(s) where the API is active. If this attribute is omitted, the API is inactive at all AEF(s) defined in the \"aefProfiles\" attribute within the ServiceAPIDescription data structure. # noqa: E501 + Indicates the list of AEF ID(s) where the API is active. If an empty array is provided, it indicates that the API is inactive in all AEF(s). # noqa: E501 :param aef_ids: The aef_ids of this ApiStatus. :type aef_ids: List[str] diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/custom_operation.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/custom_operation.py index fed2a347858ea46bd47e385379120e8f60e8e0fa..0b02df2593ab81fc3571714e66ba67501c48ed8a 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/custom_operation.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/custom_operation.py @@ -3,7 +3,8 @@ from typing import Dict, List # noqa: F401 from service_apis import util from service_apis.models.base_model import Model -from service_apis.models.communication_type import CommunicationType # noqa: E501 +from service_apis.models.communication_type import \ + CommunicationType # noqa: E501 from service_apis.models.operation import Operation # noqa: E501 diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/discovered_apis.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/discovered_apis.py index a237756324106618552ca47476c59739c89626df..3930043c3dc599f938bc1eb3bdb4c28ea576090f 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/discovered_apis.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/discovered_apis.py @@ -4,7 +4,8 @@ from typing import Dict, List # noqa: F401 from service_apis import util from service_apis.models.base_model import Model -from service_apis.models.service_api_description import ServiceAPIDescription # noqa: E501 +from service_apis.models.service_api_description import \ + ServiceAPIDescription # noqa: E501 class DiscoveredAPIs(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ellipsoid_arc.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ellipsoid_arc.py index a5747b5e3fc9ea83ab85ad2b38f510a85eda761e..f939dce43f1c67342946a3311329febb3e07fe05 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ellipsoid_arc.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ellipsoid_arc.py @@ -4,8 +4,10 @@ from typing import Dict, List # noqa: F401 from service_apis import util from service_apis.models.base_model import Model from service_apis.models.gad_shape import GADShape # noqa: E501 -from service_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 -from service_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 +from service_apis.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from service_apis.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 class EllipsoidArc(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/gad_shape.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/gad_shape.py index dfc5dedb02331b769bb85e5a8a56423640c4bafb..a70544320545bc7b47db29a42f50ff492438851a 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/gad_shape.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/gad_shape.py @@ -3,7 +3,8 @@ from typing import Dict, List # noqa: F401 from service_apis import util from service_apis.models.base_model import Model -from service_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 +from service_apis.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 class GADShape(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/geographic_area.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/geographic_area.py index 3c2d44c20cab166dbb1d40d1a999965c82e059bd..48e1523e9e916bafbcc2b0b200b2611cd7cc3163 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/geographic_area.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/geographic_area.py @@ -4,15 +4,21 @@ from typing import Dict, List # noqa: F401 from service_apis import util from service_apis.models.base_model import Model from service_apis.models.ellipsoid_arc import EllipsoidArc # noqa: E501 -from service_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 +from service_apis.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 from service_apis.models.point import Point # noqa: E501 from service_apis.models.point_altitude import PointAltitude # noqa: E501 -from service_apis.models.point_altitude_uncertainty import PointAltitudeUncertainty # noqa: E501 -from service_apis.models.point_uncertainty_circle import PointUncertaintyCircle # noqa: E501 -from service_apis.models.point_uncertainty_ellipse import PointUncertaintyEllipse # noqa: E501 +from service_apis.models.point_altitude_uncertainty import \ + PointAltitudeUncertainty # noqa: E501 +from service_apis.models.point_uncertainty_circle import \ + PointUncertaintyCircle # noqa: E501 +from service_apis.models.point_uncertainty_ellipse import \ + PointUncertaintyEllipse # noqa: E501 from service_apis.models.polygon import Polygon # noqa: E501 -from service_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 -from service_apis.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 +from service_apis.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 +from service_apis.models.uncertainty_ellipse import \ + UncertaintyEllipse # noqa: E501 class GeographicArea(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ip_addr_range.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ip_addr_range.py index b95a30bd03a0659993ce303cd1b1e02d7538fd2d..f743f4fa7701dd0e4da06be29004892356ea9c81 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ip_addr_range.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/ip_addr_range.py @@ -3,8 +3,10 @@ from typing import Dict, List # noqa: F401 from service_apis import util from service_apis.models.base_model import Model -from service_apis.models.ipv4_address_range import Ipv4AddressRange # noqa: E501 -from service_apis.models.ipv6_address_range import Ipv6AddressRange # noqa: E501 +from service_apis.models.ipv4_address_range import \ + Ipv4AddressRange # noqa: E501 +from service_apis.models.ipv6_address_range import \ + Ipv6AddressRange # noqa: E501 class IpAddrRange(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/local2d_point_uncertainty_ellipse.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/local2d_point_uncertainty_ellipse.py index 105c1408d0de95e89d5ff2861659a93ddc7338a4..ff528c7ccbc381359b83c4c9d216d2a8a2f22aa1 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/local2d_point_uncertainty_ellipse.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/local2d_point_uncertainty_ellipse.py @@ -5,9 +5,12 @@ from service_apis import util from service_apis.models.base_model import Model from service_apis.models.gad_shape import GADShape # noqa: E501 from service_apis.models.local_origin import LocalOrigin # noqa: E501 -from service_apis.models.relative_cartesian_location import RelativeCartesianLocation # noqa: E501 -from service_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 -from service_apis.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 +from service_apis.models.relative_cartesian_location import \ + RelativeCartesianLocation # noqa: E501 +from service_apis.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 +from service_apis.models.uncertainty_ellipse import \ + UncertaintyEllipse # noqa: E501 class Local2dPointUncertaintyEllipse(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/local3d_point_uncertainty_ellipsoid.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/local3d_point_uncertainty_ellipsoid.py index 68e561097af82903837c90da4a808ace9ec196f2..27d0153126b5811d3f5bddc6e25bb55b297ccaf1 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/local3d_point_uncertainty_ellipsoid.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/local3d_point_uncertainty_ellipsoid.py @@ -5,9 +5,12 @@ from service_apis import util from service_apis.models.base_model import Model from service_apis.models.gad_shape import GADShape # noqa: E501 from service_apis.models.local_origin import LocalOrigin # noqa: E501 -from service_apis.models.relative_cartesian_location import RelativeCartesianLocation # noqa: E501 -from service_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 -from service_apis.models.uncertainty_ellipsoid import UncertaintyEllipsoid # noqa: E501 +from service_apis.models.relative_cartesian_location import \ + RelativeCartesianLocation # noqa: E501 +from service_apis.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 +from service_apis.models.uncertainty_ellipsoid import \ + UncertaintyEllipsoid # noqa: E501 class Local3dPointUncertaintyEllipsoid(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/local_origin.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/local_origin.py index 880120dceef973d11f0e9dc0643b976f0faa01a4..20153e31ea85db50b5deb8b2eab799c8dd84ee85 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/local_origin.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/local_origin.py @@ -4,7 +4,8 @@ from typing import Dict, List # noqa: F401 from service_apis import util from service_apis.models.base_model import Model from service_apis.models.geographic_area import GeographicArea # noqa: E501 -from service_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 +from service_apis.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 class LocalOrigin(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/net_slice_id.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/net_slice_id.py new file mode 100644 index 0000000000000000000000000000000000000000..98ea2db9f7dd1401419b069fdb2a7b6d431ca145 --- /dev/null +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/net_slice_id.py @@ -0,0 +1,117 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from service_apis import util +from service_apis.models.base_model import Model +from service_apis.models.snssai import Snssai # noqa: E501 + + +class NetSliceId(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, snssai=None, nsi_id=None, ensi=None): # noqa: E501 + """NetSliceId - a model defined in OpenAPI + + :param snssai: The snssai of this NetSliceId. # noqa: E501 + :type snssai: Snssai + :param nsi_id: The nsi_id of this NetSliceId. # noqa: E501 + :type nsi_id: str + :param ensi: The ensi of this NetSliceId. # noqa: E501 + :type ensi: str + """ + self.openapi_types = { + 'snssai': Snssai, + 'nsi_id': str, + 'ensi': str + } + + self.attribute_map = { + 'snssai': 'snssai', + 'nsi_id': 'nsiId', + 'ensi': 'ensi' + } + + self._snssai = snssai + self._nsi_id = nsi_id + self._ensi = ensi + + @classmethod + def from_dict(cls, dikt) -> 'NetSliceId': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The NetSliceId of this NetSliceId. # noqa: E501 + :rtype: NetSliceId + """ + return util.deserialize_model(dikt, cls) + + @property + def snssai(self) -> Snssai: + """Gets the snssai of this NetSliceId. + + + :return: The snssai of this NetSliceId. + :rtype: Snssai + """ + return self._snssai + + @snssai.setter + def snssai(self, snssai: Snssai): + """Sets the snssai of this NetSliceId. + + + :param snssai: The snssai of this NetSliceId. + :type snssai: Snssai + """ + + self._snssai = snssai + + @property + def nsi_id(self) -> str: + """Gets the nsi_id of this NetSliceId. + + Contains the Identifier of the selected Network Slice instance # noqa: E501 + + :return: The nsi_id of this NetSliceId. + :rtype: str + """ + return self._nsi_id + + @nsi_id.setter + def nsi_id(self, nsi_id: str): + """Sets the nsi_id of this NetSliceId. + + Contains the Identifier of the selected Network Slice instance # noqa: E501 + + :param nsi_id: The nsi_id of this NetSliceId. + :type nsi_id: str + """ + + self._nsi_id = nsi_id + + @property + def ensi(self) -> str: + """Gets the ensi of this NetSliceId. + + Represents the External Network Slice Information that is used to identify a network slice, as specified in 3GPP TS 33.501. # noqa: E501 + + :return: The ensi of this NetSliceId. + :rtype: str + """ + return self._ensi + + @ensi.setter + def ensi(self, ensi: str): + """Sets the ensi of this NetSliceId. + + Represents the External Network Slice Information that is used to identify a network slice, as specified in 3GPP TS 33.501. # noqa: E501 + + :param ensi: The ensi of this NetSliceId. + :type ensi: str + """ + + self._ensi = ensi diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point.py index 802b8a3dc245b963ed89c56d928309aa3477e130..d4aeee09e879cd8bb5e9c28a6fedbe0abbf939e0 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point.py @@ -4,8 +4,10 @@ from typing import Dict, List # noqa: F401 from service_apis import util from service_apis.models.base_model import Model from service_apis.models.gad_shape import GADShape # noqa: E501 -from service_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 -from service_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 +from service_apis.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from service_apis.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 class Point(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_altitude.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_altitude.py index 32b8233fb715db426d96b1b2ebd6c2a5bbfe0adf..a0ef2ace372abae818e5995fa012aaaf1082cb84 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_altitude.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_altitude.py @@ -4,8 +4,10 @@ from typing import Dict, List # noqa: F401 from service_apis import util from service_apis.models.base_model import Model from service_apis.models.gad_shape import GADShape # noqa: E501 -from service_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 -from service_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 +from service_apis.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from service_apis.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 class PointAltitude(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_altitude_uncertainty.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_altitude_uncertainty.py index 9a70de0b37cb3d01e5eeb779006a0d81d7f7fa3a..ac5b783a543a3ae3777c1394c69971750ca7d1a2 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_altitude_uncertainty.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_altitude_uncertainty.py @@ -4,9 +4,12 @@ from typing import Dict, List # noqa: F401 from service_apis import util from service_apis.models.base_model import Model from service_apis.models.gad_shape import GADShape # noqa: E501 -from service_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 -from service_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 -from service_apis.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 +from service_apis.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from service_apis.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 +from service_apis.models.uncertainty_ellipse import \ + UncertaintyEllipse # noqa: E501 class PointAltitudeUncertainty(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_uncertainty_circle.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_uncertainty_circle.py index 2870ddf91c0357305b00faeb06b83d62e8284768..659b16ae595b7d5311c00af612a024f715d9220d 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_uncertainty_circle.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_uncertainty_circle.py @@ -4,8 +4,10 @@ from typing import Dict, List # noqa: F401 from service_apis import util from service_apis.models.base_model import Model from service_apis.models.gad_shape import GADShape # noqa: E501 -from service_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 -from service_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 +from service_apis.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from service_apis.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 class PointUncertaintyCircle(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_uncertainty_ellipse.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_uncertainty_ellipse.py index 32f2ab66d1063741479dcc700504d132fd798e2d..15c3d1244ff7c0f702ccbcc8b1808ec912520e87 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_uncertainty_ellipse.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/point_uncertainty_ellipse.py @@ -4,9 +4,12 @@ from typing import Dict, List # noqa: F401 from service_apis import util from service_apis.models.base_model import Model from service_apis.models.gad_shape import GADShape # noqa: E501 -from service_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 -from service_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 -from service_apis.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 +from service_apis.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from service_apis.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 +from service_apis.models.uncertainty_ellipse import \ + UncertaintyEllipse # noqa: E501 class PointUncertaintyEllipse(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/polygon.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/polygon.py index b3374e3f335aef9f85323621271875c7a0cb50d2..bf12245d50f793214862584364f8ce32decc96a6 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/polygon.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/polygon.py @@ -4,8 +4,10 @@ from typing import Dict, List # noqa: F401 from service_apis import util from service_apis.models.base_model import Model from service_apis.models.gad_shape import GADShape # noqa: E501 -from service_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 -from service_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 +from service_apis.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from service_apis.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 class Polygon(Model): diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/res_oper_info.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/res_oper_info.py new file mode 100644 index 0000000000000000000000000000000000000000..ed963f04eb4bb118ac03039dad3df605efed5d64 --- /dev/null +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/res_oper_info.py @@ -0,0 +1,119 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from service_apis import util +from service_apis.models.base_model import Model +from service_apis.models.operation import Operation # noqa: E501 + + +class ResOperInfo(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, resource=None, operations=None, custom_serv_opers=None): # noqa: E501 + """ResOperInfo - a model defined in OpenAPI + + :param resource: The resource of this ResOperInfo. # noqa: E501 + :type resource: str + :param operations: The operations of this ResOperInfo. # noqa: E501 + :type operations: List[Operation] + :param custom_serv_opers: The custom_serv_opers of this ResOperInfo. # noqa: E501 + :type custom_serv_opers: List[str] + """ + self.openapi_types = { + 'resource': str, + 'operations': List[Operation], + 'custom_serv_opers': List[str] + } + + self.attribute_map = { + 'resource': 'resource', + 'operations': 'operations', + 'custom_serv_opers': 'customServOpers' + } + + self._resource = resource + self._operations = operations + self._custom_serv_opers = custom_serv_opers + + @classmethod + def from_dict(cls, dikt) -> 'ResOperInfo': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The ResOperInfo of this ResOperInfo. # noqa: E501 + :rtype: ResOperInfo + """ + return util.deserialize_model(dikt, cls) + + @property + def resource(self) -> str: + """Gets the resource of this ResOperInfo. + + string providing an URI formatted according to IETF RFC 3986. # noqa: E501 + + :return: The resource of this ResOperInfo. + :rtype: str + """ + return self._resource + + @resource.setter + def resource(self, resource: str): + """Sets the resource of this ResOperInfo. + + string providing an URI formatted according to IETF RFC 3986. # noqa: E501 + + :param resource: The resource of this ResOperInfo. + :type resource: str + """ + + self._resource = resource + + @property + def operations(self) -> List[Operation]: + """Gets the operations of this ResOperInfo. + + + :return: The operations of this ResOperInfo. + :rtype: List[Operation] + """ + return self._operations + + @operations.setter + def operations(self, operations: List[Operation]): + """Sets the operations of this ResOperInfo. + + + :param operations: The operations of this ResOperInfo. + :type operations: List[Operation] + """ + if operations is not None and len(operations) < 1: + raise ValueError("Invalid value for `operations`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._operations = operations + + @property + def custom_serv_opers(self) -> List[str]: + """Gets the custom_serv_opers of this ResOperInfo. + + + :return: The custom_serv_opers of this ResOperInfo. + :rtype: List[str] + """ + return self._custom_serv_opers + + @custom_serv_opers.setter + def custom_serv_opers(self, custom_serv_opers: List[str]): + """Sets the custom_serv_opers of this ResOperInfo. + + + :param custom_serv_opers: The custom_serv_opers of this ResOperInfo. + :type custom_serv_opers: List[str] + """ + if custom_serv_opers is not None and len(custom_serv_opers) < 1: + raise ValueError("Invalid value for `custom_serv_opers`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._custom_serv_opers = custom_serv_opers diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/resource.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/resource.py index 0f340dfe4edfe90d5106e4105836a9063e56ec99..1c21606cc71e933e930220af856742fd09bbaa98 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/resource.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/resource.py @@ -3,7 +3,8 @@ from typing import Dict, List # noqa: F401 from service_apis import util from service_apis.models.base_model import Model -from service_apis.models.communication_type import CommunicationType # noqa: E501 +from service_apis.models.communication_type import \ + CommunicationType # noqa: E501 from service_apis.models.custom_operation import CustomOperation # noqa: E501 from service_apis.models.operation import Operation # noqa: E501 diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/service_api_description.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/service_api_description.py index b81515a9307a3f5a21cd184e5093e16bcfc05d91..62e05928f02fdbf0b223f08ef7f891fdae1d6f7f 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/service_api_description.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/service_api_description.py @@ -6,8 +6,11 @@ from service_apis import util from service_apis.models.aef_profile import AefProfile # noqa: E501 from service_apis.models.api_status import ApiStatus # noqa: E501 from service_apis.models.base_model import Model -from service_apis.models.published_api_path import PublishedApiPath # noqa: E501 -from service_apis.models.shareable_information import ShareableInformation # noqa: E501 +from service_apis.models.net_slice_id import NetSliceId # noqa: E501 +from service_apis.models.published_api_path import \ + PublishedApiPath # noqa: E501 +from service_apis.models.shareable_information import \ + ShareableInformation # noqa: E501 class ServiceAPIDescription(Model): @@ -16,7 +19,7 @@ class ServiceAPIDescription(Model): Do not edit the class manually. """ - def __init__(self, api_name=None, api_id=None, api_status=None, aef_profiles=None, description=None, supported_features=None, shareable_info=None, service_api_category=None, api_supp_feats=None, pub_api_path=None, ccf_id=None, api_prov_name=None): # noqa: E501 + def __init__(self, api_name=None, api_id=None, api_status=None, aef_profiles=None, description=None, supported_features=None, shareable_info=None, service_api_category=None, api_supp_feats=None, pub_api_path=None, ccf_id=None, api_prov_name=None, net_slice_info=None): # noqa: E501 """ServiceAPIDescription - a model defined in OpenAPI :param api_name: The api_name of this ServiceAPIDescription. # noqa: E501 @@ -43,6 +46,8 @@ class ServiceAPIDescription(Model): :type ccf_id: str :param api_prov_name: The api_prov_name of this ServiceAPIDescription. # noqa: E501 :type api_prov_name: str + :param net_slice_info: The net_slice_info of this ServiceAPIDescription. # noqa: E501 + :type net_slice_info: List[NetSliceId] """ self.openapi_types = { 'api_name': str, @@ -56,7 +61,8 @@ class ServiceAPIDescription(Model): 'api_supp_feats': str, 'pub_api_path': PublishedApiPath, 'ccf_id': str, - 'api_prov_name': str + 'api_prov_name': str, + 'net_slice_info': List[NetSliceId] } self.attribute_map = { @@ -71,7 +77,8 @@ class ServiceAPIDescription(Model): 'api_supp_feats': 'apiSuppFeats', 'pub_api_path': 'pubApiPath', 'ccf_id': 'ccfId', - 'api_prov_name': 'apiProvName' + 'api_prov_name': 'apiProvName', + 'net_slice_info': 'netSliceInfo' } self._api_name = api_name @@ -86,6 +93,7 @@ class ServiceAPIDescription(Model): self._pub_api_path = pub_api_path self._ccf_id = ccf_id self._api_prov_name = api_prov_name + self._net_slice_info = net_slice_info @classmethod def from_dict(cls, dikt) -> 'ServiceAPIDescription': @@ -102,7 +110,7 @@ class ServiceAPIDescription(Model): def api_name(self) -> str: """Gets the api_name of this ServiceAPIDescription. - API name, it is set as {apiName} part of the URI structure as defined in clause 5.2.4 of 3GPP TS 29.122. # noqa: E501 + Contains the API name set to the value of the \"\" placeholder of the API URI as defined in clause 5.2.4 of 3GPP TS 29.122 [14]. # noqa: E501 :return: The api_name of this ServiceAPIDescription. :rtype: str @@ -113,7 +121,7 @@ class ServiceAPIDescription(Model): def api_name(self, api_name: str): """Sets the api_name of this ServiceAPIDescription. - API name, it is set as {apiName} part of the URI structure as defined in clause 5.2.4 of 3GPP TS 29.122. # noqa: E501 + Contains the API name set to the value of the \"\" placeholder of the API URI as defined in clause 5.2.4 of 3GPP TS 29.122 [14]. # noqa: E501 :param api_name: The api_name of this ServiceAPIDescription. :type api_name: str @@ -375,3 +383,28 @@ class ServiceAPIDescription(Model): """ self._api_prov_name = api_prov_name + + @property + def net_slice_info(self) -> List[NetSliceId]: + """Gets the net_slice_info of this ServiceAPIDescription. + + Represents the applicable network slice identifiers. # noqa: E501 + + :return: The net_slice_info of this ServiceAPIDescription. + :rtype: List[NetSliceId] + """ + return self._net_slice_info + + @net_slice_info.setter + def net_slice_info(self, net_slice_info: List[NetSliceId]): + """Sets the net_slice_info of this ServiceAPIDescription. + + Represents the applicable network slice identifiers. # noqa: E501 + + :param net_slice_info: The net_slice_info of this ServiceAPIDescription. + :type net_slice_info: List[NetSliceId] + """ + if net_slice_info is not None and len(net_slice_info) < 1: + raise ValueError("Invalid value for `net_slice_info`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._net_slice_info = net_slice_info diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/shareable_information.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/shareable_information.py index 0f0c7b02cf1b06f23a73821067a572b9bf58c234..31dc2a02669b7b2df5bcef7ff9ced1f47913f5f2 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/shareable_information.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/shareable_information.py @@ -47,7 +47,7 @@ class ShareableInformation(Model): def is_shareable(self) -> bool: """Gets the is_shareable of this ShareableInformation. - Set to \"true\" indicates that the service API and/or the service API category can be shared to the list of CAPIF provider domain information. Otherwise set to \"false\". # noqa: E501 + Indicates whether the service API and/or the service API category can be shared to the list of CAPIF provider domain information. true indicates that the service API and/or the service API category can be shared to the list of CAPIF provider domain information. false indicates that the service API and/or the service API category can not be shared to the list of CAPIF provider domain information. # noqa: E501 :return: The is_shareable of this ShareableInformation. :rtype: bool @@ -58,7 +58,7 @@ class ShareableInformation(Model): def is_shareable(self, is_shareable: bool): """Sets the is_shareable of this ShareableInformation. - Set to \"true\" indicates that the service API and/or the service API category can be shared to the list of CAPIF provider domain information. Otherwise set to \"false\". # noqa: E501 + Indicates whether the service API and/or the service API category can be shared to the list of CAPIF provider domain information. true indicates that the service API and/or the service API category can be shared to the list of CAPIF provider domain information. false indicates that the service API and/or the service API category can not be shared to the list of CAPIF provider domain information. # noqa: E501 :param is_shareable: The is_shareable of this ShareableInformation. :type is_shareable: bool diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/snssai.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/snssai.py new file mode 100644 index 0000000000000000000000000000000000000000..5cef8fc1dc75f77067cb2a6f314eb521ef90f0aa --- /dev/null +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/models/snssai.py @@ -0,0 +1,99 @@ +import re # noqa: E501 +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from service_apis import util +from service_apis.models.base_model import Model + + +class Snssai(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, sst=None, sd=None): # noqa: E501 + """Snssai - a model defined in OpenAPI + + :param sst: The sst of this Snssai. # noqa: E501 + :type sst: int + :param sd: The sd of this Snssai. # noqa: E501 + :type sd: str + """ + self.openapi_types = { + 'sst': int, + 'sd': str + } + + self.attribute_map = { + 'sst': 'sst', + 'sd': 'sd' + } + + self._sst = sst + self._sd = sd + + @classmethod + def from_dict(cls, dikt) -> 'Snssai': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The Snssai of this Snssai. # noqa: E501 + :rtype: Snssai + """ + return util.deserialize_model(dikt, cls) + + @property + def sst(self) -> int: + """Gets the sst of this Snssai. + + Unsigned integer, within the range 0 to 255, representing the Slice/Service Type. It indicates the expected Network Slice behaviour in terms of features and services. Values 0 to 127 correspond to the standardized SST range. Values 128 to 255 correspond to the Operator-specific range. See clause 28.4.2 of 3GPP TS 23.003. Standardized values are defined in clause 5.15.2.2 of 3GPP TS 23.501. # noqa: E501 + + :return: The sst of this Snssai. + :rtype: int + """ + return self._sst + + @sst.setter + def sst(self, sst: int): + """Sets the sst of this Snssai. + + Unsigned integer, within the range 0 to 255, representing the Slice/Service Type. It indicates the expected Network Slice behaviour in terms of features and services. Values 0 to 127 correspond to the standardized SST range. Values 128 to 255 correspond to the Operator-specific range. See clause 28.4.2 of 3GPP TS 23.003. Standardized values are defined in clause 5.15.2.2 of 3GPP TS 23.501. # noqa: E501 + + :param sst: The sst of this Snssai. + :type sst: int + """ + if sst is None: + raise ValueError("Invalid value for `sst`, must not be `None`") # noqa: E501 + if sst is not None and sst > 255: # noqa: E501 + raise ValueError("Invalid value for `sst`, must be a value less than or equal to `255`") # noqa: E501 + if sst is not None and sst < 0: # noqa: E501 + raise ValueError("Invalid value for `sst`, must be a value greater than or equal to `0`") # noqa: E501 + + self._sst = sst + + @property + def sd(self) -> str: + """Gets the sd of this Snssai. + + 3-octet string, representing the Slice Differentiator, in hexadecimal representation. Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent 4 bits. The most significant character representing the 4 most significant bits of the SD shall appear first in the string, and the character representing the 4 least significant bit of the SD shall appear last in the string. This is an optional parameter that complements the Slice/Service type(s) to allow to differentiate amongst multiple Network Slices of the same Slice/Service type. This IE shall be absent if no SD value is associated with the SST. # noqa: E501 + + :return: The sd of this Snssai. + :rtype: str + """ + return self._sd + + @sd.setter + def sd(self, sd: str): + """Sets the sd of this Snssai. + + 3-octet string, representing the Slice Differentiator, in hexadecimal representation. Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent 4 bits. The most significant character representing the 4 most significant bits of the SD shall appear first in the string, and the character representing the 4 least significant bit of the SD shall appear last in the string. This is an optional parameter that complements the Slice/Service type(s) to allow to differentiate amongst multiple Network Slices of the same Slice/Service type. This IE shall be absent if no SD value is associated with the SST. # noqa: E501 + + :param sd: The sd of this Snssai. + :type sd: str + """ + if sd is not None and not re.search(r'^[A-Fa-f0-9]{6}$', sd): # noqa: E501 + raise ValueError(r"Invalid value for `sd`, must be a follow pattern or equal to `/^[A-Fa-f0-9]{6}$/`") # noqa: E501 + + self._sd = sd diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/openapi/openapi.yaml b/services/TS29222_CAPIF_Discover_Service_API/service_apis/openapi/openapi.yaml index bcdeb091ca021ece59f5e92382b419a7b12068e4..32ba56406a77cf2ac84ea7300ec51ae9477295e7 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/openapi/openapi.yaml +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/openapi/openapi.yaml @@ -1,11 +1,11 @@ openapi: 3.0.0 info: - description: "API for discovering service APIs. \n© 2024, 3GPP Organizational Partners\ + description: "API for discovering service APIs. \n© 2025, 3GPP Organizational Partners\ \ (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). \nAll rights reserved.\n" title: CAPIF_Discover_Service_API - version: 1.3.1 + version: 1.4.0-alpha.4 externalDocs: - description: 3GPP TS 29.222 V18.7.0 Common API Framework for 3GPP Northbound APIs + description: 3GPP TS 29.222 V19.4.0 Common API Framework for 3GPP Northbound APIs url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.222/ servers: - url: "{apiRoot}/service-apis/v1" @@ -30,7 +30,7 @@ paths: type: string style: form - description: | - API name, it is set as {apiName} part of the URI structure as defined in clause 5.2.4 of 3GPP TS 29.122. + Contains the API name set to the value of the "" placeholder of the API URI as defined in clause 5.2.4 of 3GPP TS 29.122 [14]. explode: true in: query name: api-name @@ -103,15 +103,6 @@ paths: schema: type: string style: form - - description: Features supported by the NF consumer for the CAPIF Discover - Service API. - explode: true - in: query - name: supported-features - required: false - schema: - $ref: '#/components/schemas/SupportedFeatures' - style: form - description: | Features supported by the discovered service API indicated by api-name parameter. This may only be present if api-name query parameter is present. explode: true @@ -121,23 +112,35 @@ paths: schema: $ref: '#/components/schemas/SupportedFeatures' style: form - - description: Represents the UE IP address information. - explode: true + - content: + application/json: + schema: + $ref: '#/components/schemas/IpAddrInfo' + description: Represents the UE IP address information. in: query name: ue-ip-addr required: false - schema: - $ref: '#/components/schemas/IpAddrInfo' - style: form - - description: | + - content: + application/json: + schema: + $ref: '#/components/schemas/ServiceKpis' + description: | Contains iInformation about service characteristics provided by the targeted service API(s). - explode: true in: query name: service-kpis required: false - schema: - $ref: '#/components/schemas/ServiceKpis' - style: form + - content: + application/json: + schema: + items: + $ref: '#/components/schemas/NetSliceId' + minItems: 1 + type: array + description: | + Contains the identifier(s) of the network slice(s) within which the API shall be available. + in: query + name: net-slice-info + required: false - content: application/json: schema: @@ -149,6 +152,39 @@ paths: in: query name: grant-types required: false + - description: | + Contains the identifier(s) of the targeted service APIs. When this query parameter is present, then all the other query parameters shall be absent except the supported-features and api-invoker-id query parameters. + explode: false + in: query + name: api-ids + required: false + schema: + items: + type: string + minItems: 1 + type: array + style: form + - description: | + Contains the list of supported API resource(s) and service operation(s). + explode: false + in: query + name: res-ops + required: false + schema: + items: + $ref: '#/components/schemas/ResOperInfo' + minItems: 1 + type: array + style: form + - description: Features supported by the NF consumer for the CAPIF Discover + Service API. + explode: true + in: query + name: supported-features + required: false + schema: + $ref: '#/components/schemas/SupportedFeatures' + style: form responses: "200": content: @@ -313,20 +349,9 @@ components: - serviceAPICategory: serviceAPICategory ccfId: ccfId apiName: apiName - shareableInfo: - capifProvDoms: - - capifProvDoms - - capifProvDoms - isShareable: true apiProvName: apiProvName supportedFeatures: supportedFeatures description: description - apiSuppFeats: apiSuppFeats - apiId: apiId - apiStatus: - aefIds: - - aefIds - - aefIds aefProfiles: - protocol: HTTP_1_1 grantTypes: @@ -752,27 +777,38 @@ components: availability: 0 maxReqRate: 0 avalGraComp: avalGraComp - pubApiPath: - ccfIds: - - ccfIds - - ccfIds - - serviceAPICategory: serviceAPICategory - ccfId: ccfId - apiName: apiName shareableInfo: capifProvDoms: - capifProvDoms - capifProvDoms isShareable: true - apiProvName: apiProvName - supportedFeatures: supportedFeatures - description: description + netSliceInfo: + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId apiSuppFeats: apiSuppFeats apiId: apiId apiStatus: aefIds: - aefIds - aefIds + pubApiPath: + ccfIds: + - ccfIds + - ccfIds + - serviceAPICategory: serviceAPICategory + ccfId: ccfId + apiName: apiName + apiProvName: apiProvName + supportedFeatures: supportedFeatures + description: description aefProfiles: - protocol: HTTP_1_1 grantTypes: @@ -1198,6 +1234,28 @@ components: availability: 0 maxReqRate: 0 avalGraComp: avalGraComp + shareableInfo: + capifProvDoms: + - capifProvDoms + - capifProvDoms + isShareable: true + netSliceInfo: + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + apiSuppFeats: apiSuppFeats + apiId: apiId + apiStatus: + aefIds: + - aefIds + - aefIds pubApiPath: ccfIds: - ccfIds @@ -1237,24 +1295,47 @@ components: string identifying a Ipv6 address formatted according to clause 4 in IETF RFC 5952. The mixed Ipv4 Ipv6 notation according to clause 5 of IETF RFC 5952 shall not be used. title: Ipv6Addr type: string + title: IpAddrInfo + type: object + ResOperInfo: + description: | + Represents the resourse and/or service operation. + properties: + resource: + description: string providing an URI formatted according to IETF RFC 3986. + title: type + type: string + operations: + items: + $ref: '#/components/schemas/Operation' + minItems: 1 + title: operations + type: array + customServOpers: + items: + type: string + minItems: 1 + title: customServOpers + type: array + title: ResOperInfo type: object CommunicationType: - type: string enum: - REQUEST_RESPONSE - SUBSCRIBE_NOTIFY + type: string description: "Indicates a communication type of the resource or the custom operation.\ \ \nPossible values are:\n- REQUEST_RESPONSE: The communication is of the\ \ type request-response.\n- SUBSCRIBE_NOTIFY: The communication is of the\ \ type subscribe-notify.\n" title: CommunicationType Protocol: - type: string enum: - HTTP_1_1 - HTTP_2 - MQTT - WEBSOCKET + type: string description: "Indicates a protocol and protocol version used by the API. \n\ Possible values are:\n- HTTP_1_1: Indicates that the protocol is HTTP version\ \ 1.1.\n- HTTP_2: Indicates that the protocol is HTTP version 2.\n- MQTT:\ @@ -1262,11 +1343,11 @@ components: \ Indicates that the protocol is Websocket.\n" title: Protocol DataFormat: - type: string enum: - JSON - XML - PROTOBUF3 + type: string description: "Indicates a data format. \nPossible values are:\n- JSON: Indicates\ \ that the data format is JSON.\n- XML: Indicates that the data format is\ \ Extensible Markup Language.\n- PROTOBUF3: Indicates that the data format\ @@ -1397,6 +1478,39 @@ components: type: integer title: ServiceKpis type: object + NetSliceId: + description: | + Represents the network slice identification information. + example: + ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + nullable: true + oneOf: + - required: ["snssai"] + - required: ["nsiId"] + - required: ["ensi"] + properties: + snssai: + $ref: '#/components/schemas/Snssai' + nsiId: + description: Contains the Identifier of the selected Network Slice instance + title: NsiId + type: string + ensi: + description: | + Represents the External Network Slice Information that is used to identify a network slice, as specified in 3GPP TS 33.501. + title: Ensi + type: string + title: NetSliceId + type: object + Ensi: + description: | + Represents the External Network Slice Information that is used to identify a network slice, as specified in 3GPP TS 33.501. + title: Ensi + type: string OAuthGrantType: enum: - CLIENT_CREDENTIALS @@ -1484,20 +1598,9 @@ components: serviceAPICategory: serviceAPICategory ccfId: ccfId apiName: apiName - shareableInfo: - capifProvDoms: - - capifProvDoms - - capifProvDoms - isShareable: true apiProvName: apiProvName supportedFeatures: supportedFeatures description: description - apiSuppFeats: apiSuppFeats - apiId: apiId - apiStatus: - aefIds: - - aefIds - - aefIds aefProfiles: - protocol: HTTP_1_1 grantTypes: @@ -1923,6 +2026,28 @@ components: availability: 0 maxReqRate: 0 avalGraComp: avalGraComp + shareableInfo: + capifProvDoms: + - capifProvDoms + - capifProvDoms + isShareable: true + netSliceInfo: + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + apiSuppFeats: apiSuppFeats + apiId: apiId + apiStatus: + aefIds: + - aefIds + - aefIds pubApiPath: ccfIds: - ccfIds @@ -1930,7 +2055,7 @@ components: properties: apiName: description: | - API name, it is set as {apiName} part of the URI structure as defined in clause 5.2.4 of 3GPP TS 29.122. + Contains the API name set to the value of the "" placeholder of the API URI as defined in clause 5.2.4 of 3GPP TS 29.122 [14]. title: apiName type: string apiId: @@ -1980,6 +2105,13 @@ components: description: Represents the API provider name. title: apiProvName type: string + netSliceInfo: + description: Represents the applicable network slice identifiers. + items: + $ref: '#/components/schemas/NetSliceId' + minItems: 1 + title: netSliceInfo + type: array required: - apiName title: ServiceAPIDescription @@ -1993,8 +2125,9 @@ components: - aefIds properties: aefIds: - description: | - Indicates the list of AEF ID(s) where the API is active. If this attribute is omitted, the API is inactive at all AEF(s) defined in the "aefProfiles" attribute within the ServiceAPIDescription data structure. + description: "Indicates the list of AEF ID(s) where the API is active. If\ + \ an empty array is provided, it indicates that the API is inactive in\ + \ all AEF(s). \n" items: type: string title: aefIds @@ -2597,7 +2730,7 @@ components: properties: isShareable: description: | - Set to "true" indicates that the service API and/or the service API category can be shared to the list of CAPIF provider domain information. Otherwise set to "false". + Indicates whether the service API and/or the service API category can be shared to the list of CAPIF provider domain information. true indicates that the service API and/or the service API category can be shared to the list of CAPIF provider domain information. false indicates that the service API and/or the service API category can not be shared to the list of CAPIF provider domain information. title: isShareable type: boolean capifProvDoms: @@ -3180,6 +3313,38 @@ components: minimum: 0 title: DurationSec type: integer + Snssai: + description: | + When Snssai needs to be converted to string (e.g. when used in maps as key), the string shall be composed of one to three digits "sst" optionally followed by "-" and 6 hexadecimal digits "sd". + example: + sd: sd + sst: 237 + properties: + sst: + description: "Unsigned integer, within the range 0 to 255, representing\ + \ the Slice/Service Type. It indicates the expected Network Slice behaviour\ + \ in terms of features and services. Values 0 to 127 correspond to the\ + \ standardized SST range. Values 128 to 255 correspond to the Operator-specific\ + \ range. See clause 28.4.2 of 3GPP TS 23.003. Standardized values are\ + \ defined in clause 5.15.2.2 of 3GPP TS 23.501. \n" + maximum: 255 + minimum: 0 + title: sst + type: integer + sd: + description: | + 3-octet string, representing the Slice Differentiator, in hexadecimal representation. Each character in the string shall take a value of "0" to "9", "a" to "f" or "A" to "F" and shall represent 4 bits. The most significant character representing the 4 most significant bits of the SD shall appear first in the string, and the character representing the 4 least significant bit of the SD shall appear last in the string. This is an optional parameter that complements the Slice/Service type(s) to allow to differentiate amongst multiple Network Slices of the same Slice/Service type. This IE shall be absent if no SD value is associated with the SST. + pattern: "^[A-Fa-f0-9]{6}$" + title: sd + type: string + required: + - sst + title: Snssai + type: object + NsiId: + description: Contains the Identifier of the selected Network Slice instance + title: NsiId + type: string DateTime: description: string with format "date-time" as defined in OpenAPI. format: date-time diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/test/test_default_controller.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/test/test_default_controller.py index 6e626023ebcfcaee0f98fe9cd06891af45c6f272..3aaecdd03dabd1ceebd5bf2dd85c54cadc4e6049 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/test/test_default_controller.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/test/test_default_controller.py @@ -1,13 +1,16 @@ import unittest from service_apis.models.aef_location import AefLocation # noqa: E501 -from service_apis.models.communication_type import CommunicationType # noqa: E501 +from service_apis.models.communication_type import \ + CommunicationType # noqa: E501 from service_apis.models.data_format import DataFormat # noqa: E501 from service_apis.models.discovered_apis import DiscoveredAPIs # noqa: E501 from service_apis.models.ip_addr_info import IpAddrInfo # noqa: E501 +from service_apis.models.net_slice_id import NetSliceId # noqa: E501 from service_apis.models.o_auth_grant_type import OAuthGrantType # noqa: E501 from service_apis.models.problem_details import ProblemDetails # noqa: E501 from service_apis.models.protocol import Protocol # noqa: E501 +from service_apis.models.res_oper_info import ResOperInfo # noqa: E501 from service_apis.models.service_kpis import ServiceKpis # noqa: E501 from service_apis.test import BaseTestCase @@ -30,11 +33,14 @@ class TestDefaultController(BaseTestCase): ('api-cat', 'api_cat_example'), ('preferred-aef-loc', openapi_server.AefLocation()), ('req-api-prov-name', 'req_api_prov_name_example'), - ('supported-features', 'supported_features_example'), ('api-supported-features', 'api_supported_features_example'), ('ue-ip-addr', openapi_server.IpAddrInfo()), ('service-kpis', openapi_server.ServiceKpis()), - ('grant-types', [openapi_server.OAuthGrantType()])] + ('net-slice-info', [openapi_server.NetSliceId()]), + ('grant-types', [openapi_server.OAuthGrantType()]), + ('api-ids', ['api_ids_example']), + ('res-ops', [openapi_server.ResOperInfo()]), + ('supported-features', 'supported_features_example')] headers = { 'Accept': 'application/json', } diff --git a/services/TS29222_CAPIF_Discover_Service_API/setup.py b/services/TS29222_CAPIF_Discover_Service_API/setup.py index da11c500f9628c9c553fd7ea54e06c77d5c35753..64e0688f3bd03050b9f0c888781fa2d9b9a36924 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/setup.py +++ b/services/TS29222_CAPIF_Discover_Service_API/setup.py @@ -31,7 +31,7 @@ setup( entry_points={ 'console_scripts': ['service_apis=service_apis.__main__:main']}, long_description="""\ - API for discovering service APIs. © 2024, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. + API for discovering service APIs. © 2025, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. """ ) diff --git a/services/TS29222_CAPIF_Events_API/.openapi-generator/FILES b/services/TS29222_CAPIF_Events_API/.openapi-generator/FILES index 2bcc916b8c380d71db69b02312855cd91383d4f2..2b3745e662b3ae4e05438e37b57b759955ac96c3 100644 --- a/services/TS29222_CAPIF_Events_API/.openapi-generator/FILES +++ b/services/TS29222_CAPIF_Events_API/.openapi-generator/FILES @@ -8,7 +8,8 @@ git_push.sh capif_events/__init__.py capif_events/__main__.py capif_events/controllers/__init__.py -capif_events/controllers/default_controller.py +capif_events/controllers/capifs_events_subscriptions_collection_controller.py +capif_events/controllers/individual_capifs_events_subscription_document_controller.py capif_events/controllers/security_controller.py capif_events/encoder.py capif_events/models/__init__.py @@ -16,6 +17,8 @@ capif_events/models/access_control_policy_list.py capif_events/models/access_control_policy_list_ext.py capif_events/models/aef_location.py capif_events/models/aef_profile.py +capif_events/models/api_info.py +capif_events/models/api_invoker_count.py capif_events/models/api_invoker_policy.py capif_events/models/api_status.py capif_events/models/base_model.py @@ -27,6 +30,7 @@ capif_events/models/civic_address.py capif_events/models/communication_type.py capif_events/models/custom_operation.py capif_events/models/data_format.py +capif_events/models/discovery_count.py capif_events/models/ellipsoid_arc.py capif_events/models/event_notification.py capif_events/models/event_subscription.py @@ -49,9 +53,11 @@ capif_events/models/local_origin.py capif_events/models/log.py capif_events/models/muting_exception_instructions.py capif_events/models/muting_notifications_settings.py +capif_events/models/net_slice_id.py capif_events/models/notification_flag.py capif_events/models/notification_method.py capif_events/models/o_auth_grant_type.py +capif_events/models/onboarding_criteria.py capif_events/models/operation.py capif_events/models/partitioning_criteria.py capif_events/models/point.py @@ -63,6 +69,7 @@ capif_events/models/polygon.py capif_events/models/problem_details.py capif_events/models/protocol.py capif_events/models/published_api_path.py +capif_events/models/related_criteria.py capif_events/models/relative_cartesian_location.py capif_events/models/reporting_information.py capif_events/models/resource.py @@ -71,6 +78,7 @@ capif_events/models/security_method.py capif_events/models/service_api_description.py capif_events/models/service_kpis.py capif_events/models/shareable_information.py +capif_events/models/snssai.py capif_events/models/subscription_action.py capif_events/models/supported_gad_shapes.py capif_events/models/time_range_list.py @@ -81,7 +89,8 @@ capif_events/models/version.py capif_events/models/websock_notif_config.py capif_events/openapi/openapi.yaml capif_events/test/__init__.py -capif_events/test/test_default_controller.py +capif_events/test/test_capifs_events_subscriptions_collection_controller.py +capif_events/test/test_individual_capifs_events_subscription_document_controller.py capif_events/typing_utils.py capif_events/util.py requirements.txt diff --git a/services/TS29222_CAPIF_Events_API/capif_events/app.py b/services/TS29222_CAPIF_Events_API/capif_events/app.py index b9f0bd9bc7436db9bb1895c07ec024984a7994a5..30bcccb4c2ffe9b0f2ea371ce72c7dc9c6066b41 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/app.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/app.py @@ -15,13 +15,15 @@ from flask_executor import Executor from flask_jwt_extended import JWTManager from fluent import sender from opentelemetry import trace -from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter +from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import \ + OTLPSpanExporter from opentelemetry.instrumentation.flask import FlaskInstrumentor from opentelemetry.instrumentation.redis import RedisInstrumentor from opentelemetry.sdk.resources import Resource from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import BatchSpanProcessor -from opentelemetry.trace.propagation.tracecontext import TraceContextTextMapPropagator +from opentelemetry.trace.propagation.tracecontext import \ + TraceContextTextMapPropagator NAME = "Events-Service" diff --git a/services/TS29222_CAPIF_Events_API/capif_events/controllers/capifs_events_subscriptions_collection_controller.py b/services/TS29222_CAPIF_Events_API/capif_events/controllers/capifs_events_subscriptions_collection_controller.py new file mode 100644 index 0000000000000000000000000000000000000000..d4fc1c3a23e9755744935aa308b786f4900f0785 --- /dev/null +++ b/services/TS29222_CAPIF_Events_API/capif_events/controllers/capifs_events_subscriptions_collection_controller.py @@ -0,0 +1,69 @@ +from functools import wraps + +from capif_events.models.event_subscription import \ + EventSubscription # noqa: E501 +from capif_events.models.problem_details import ProblemDetails # noqa: E501 +from cryptography import x509 +from cryptography.hazmat.backends import default_backend +from flask import current_app, request + +from ..core.responses import unauthorized_error + +from ..core.events_apis import EventSubscriptionsOperations +from ..core.validate_user import ControlAccess + +events_ops = EventSubscriptionsOperations() +valid_user = ControlAccess() + +def cert_validation(): + def _cert_validation(f): + @wraps(f) + def __cert_validation(*args, **kwargs): + + args = request.view_args + cert_tmp = request.headers.get('X-Ssl-Client-Cert') + + if not cert_tmp: + return unauthorized_error("Client certificate required", "X-Ssl-Client-Cert header is missing") + + cert_raw = cert_tmp.replace('\t', '') + + cert = x509.load_pem_x509_certificate(str.encode(cert_raw), default_backend()) + + cn = cert.subject.get_attributes_for_oid(x509.OID_COMMON_NAME)[0].value.strip() + + if cn != "superadmin": + cert_signature = cert.signature.hex() + if request.method != 'POST': + result = valid_user.validate_user_cert(args["subscriptionId"], args["subscriberId"], cert_signature) + else: + result = valid_user.validate_user_cert(None, args["subscriberId"], cert_signature) + + if result is not None: + return result + + result = f(**kwargs) + return result + return __cert_validation + return _cert_validation + +@cert_validation() +def create_event_subsc(subscriber_id, body): # noqa: E501 + """Create a new CAPIFs Event Subscription. + + # noqa: E501 + + :param subscriber_id: Identifier of the Subscriber + :type subscriber_id: str + :param event_subscription: + :type event_subscription: dict | bytes + + :rtype: Union[EventSubscription, Tuple[EventSubscription, int], Tuple[EventSubscription, int, Dict[str, str]] + """ + current_app.logger.info("Creating event subscription") + if request.is_json: + body = EventSubscription.from_dict(request.get_json()) # noqa: E501 + + res = events_ops.create_event(subscriber_id, body) + + return res diff --git a/services/TS29222_CAPIF_Events_API/capif_events/controllers/default_controller.py b/services/TS29222_CAPIF_Events_API/capif_events/controllers/individual_capifs_events_subscription_document_controller.py similarity index 64% rename from services/TS29222_CAPIF_Events_API/capif_events/controllers/default_controller.py rename to services/TS29222_CAPIF_Events_API/capif_events/controllers/individual_capifs_events_subscription_document_controller.py index 5e6cba2d4dbfe35e3d36889516257fe31105ca98..3339992a87b58cb41eab39e7bed546b1409665e5 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/controllers/default_controller.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/controllers/individual_capifs_events_subscription_document_controller.py @@ -1,11 +1,16 @@ from functools import wraps -from capif_events.models.event_subscription import EventSubscription # noqa: E501 -from capif_events.models.event_subscription_patch import EventSubscriptionPatch # noqa: E501 +from capif_events.models.event_subscription import \ + EventSubscription # noqa: E501 +from capif_events.models.event_subscription_patch import \ + EventSubscriptionPatch # noqa: E501 +from capif_events.models.problem_details import ProblemDetails # noqa: E501 from cryptography import x509 from cryptography.hazmat.backends import default_backend from flask import current_app, request +from ..core.responses import unauthorized_error + from ..core.events_apis import EventSubscriptionsOperations from ..core.validate_user import ControlAccess @@ -18,7 +23,11 @@ def cert_validation(): def __cert_validation(*args, **kwargs): args = request.view_args - cert_tmp = request.headers['X-Ssl-Client-Cert'] + cert_tmp = request.headers.get('X-Ssl-Client-Cert') + + if not cert_tmp: + return unauthorized_error("Client certificate required", "X-Ssl-Client-Cert header is missing") + cert_raw = cert_tmp.replace('\t', '') cert = x509.load_pem_x509_certificate(str.encode(cert_raw), default_backend()) @@ -40,33 +49,11 @@ def cert_validation(): return __cert_validation return _cert_validation - -@cert_validation() -def subscriber_id_subscriptions_post(subscriber_id, body): # noqa: E501 - """subscriber_id_subscriptions_post - - Creates a new individual CAPIF Event Subscription. # noqa: E501 - - :param subscriber_id: Identifier of the Subscriber - :type subscriber_id: str - :param event_subscription: - :type event_subscription: dict | bytes - - :rtype: Union[EventSubscription, Tuple[EventSubscription, int], Tuple[EventSubscription, int, Dict[str, str]] - """ - current_app.logger.info("Creating event subscription") - if request.is_json: - body = EventSubscription.from_dict(request.get_json()) # noqa: E501 - - res = events_ops.create_event(subscriber_id, body) - - return res - @cert_validation() -def subscriber_id_subscriptions_subscription_id_delete(subscriber_id, subscription_id): # noqa: E501 - """subscriber_id_subscriptions_subscription_id_delete +def delete_ind_event_subsc(subscriber_id, subscription_id): # noqa: E501 + """Delete an existing Individual CAPIF Events Subscription resource. - Deletes an individual CAPIF Event Subscription. # noqa: E501 + # noqa: E501 :param subscriber_id: Identifier of the Subscriber :type subscriber_id: str @@ -82,10 +69,10 @@ def subscriber_id_subscriptions_subscription_id_delete(subscriber_id, subscripti return res @cert_validation() -def subscriber_id_subscriptions_subscription_id_patch(subscriber_id, subscription_id, body): # noqa: E501 - """subscriber_id_subscriptions_subscription_id_patch +def modify_ind_event_subsc(subscriber_id, subscription_id, body): # noqa: E501 + """Modify an existing Individual CAPIF Events Subscription resource. - Modification of an existing individual CAPIF Event Subscription. # noqa: E501 + # noqa: E501 :param subscriber_id: Identifier of the Subscriber :type subscriber_id: str @@ -103,10 +90,10 @@ def subscriber_id_subscriptions_subscription_id_patch(subscriber_id, subscriptio return res @cert_validation() -def subscriber_id_subscriptions_subscription_id_put(subscriber_id, subscription_id, body): # noqa: E501 - """subscriber_id_subscriptions_subscription_id_put +def update_ind_event_subsc(subscriber_id, subscription_id, body): # noqa: E501 + """Update an existing Individual CAPIF Events Subscription resource. - Update of an existing individual CAPIF Event Subscription. # noqa: E501 + # noqa: E501 :param subscriber_id: Identifier of the Subscriber :type subscriber_id: str diff --git a/services/TS29222_CAPIF_Events_API/capif_events/controllers/security_controller.py b/services/TS29222_CAPIF_Events_API/capif_events/controllers/security_controller.py index 139597f9cb07c5d48bed18984ec4747f4b4f3438..8b137891791fe96927ad78e64b0aad7bded08bdc 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/controllers/security_controller.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/controllers/security_controller.py @@ -1,2 +1 @@ - diff --git a/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py b/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py index 1f9acaf3e4ff5c26e5aea1c729b1c02968960b2c..ae4674e7e2f76162828647bbe89ce770ab1caaf7 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/core/events_apis.py @@ -1,18 +1,19 @@ +import asyncio import os import secrets +from datetime import datetime, timezone import rfc3987 -from capif_events.models.event_subscription import EventSubscription # noqa: E501 -from flask import current_app, Response -from datetime import datetime, timezone -import asyncio +from capif_events.models.event_subscription import \ + EventSubscription # noqa: E501 +from flask import Response, current_app from ..util import clean_empty, dict_to_camel_case, serialize_clean_camel_case from .auth_manager import AuthManager -from .resources import Resource -from .responses import internal_server_error, not_found_error, make_response, bad_request_error -from ..util import serialize_clean_camel_case, clean_empty, dict_to_camel_case from .notifications import Notifications +from .resources import Resource +from .responses import (bad_request_error, internal_server_error, + make_response, not_found_error) TOTAL_FEATURES = 4 SUPPORTED_FEATURES_HEX = "c" diff --git a/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py b/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py index 0bd895575b416ae813f0828099c0895f54d433f8..ab1aafbd455f5f7f1f3b4ef88f85e75ddb9b41c0 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/core/notifications.py @@ -2,6 +2,7 @@ import asyncio import json import os +from datetime import datetime, timedelta, timezone import aiohttp import requests @@ -9,7 +10,6 @@ from encoder import CustomJSONEncoder from flask import current_app from models.event_notification import EventNotification from util import serialize_clean_camel_case -from datetime import datetime, timedelta, timezone from .internal_event_ops import InternalEventOperations diff --git a/services/TS29222_CAPIF_Events_API/capif_events/core/responses.py b/services/TS29222_CAPIF_Events_API/capif_events/core/responses.py index 8f975cbf426c304c4ae0681f65af67fcad9abca5..8ba055f9295f90258ff39547a9f4af1b22a75a30 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/core/responses.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/core/responses.py @@ -33,11 +33,18 @@ def bad_request_error(detail, cause, invalid_params): prob = ProblemDetails(title="Bad Request", status=400, detail=detail, cause=cause, invalid_params=invalid_params) prob = serialize_clean_camel_case(prob) - return Response(json.dumps(prob, cls=CustomJSONEncoder), status=400, mimetype=cause) + return Response(json.dumps(prob, cls=CustomJSONEncoder), status=400, mimetype=mimetype) def not_found_error(detail, cause): prob = ProblemDetails(title="Not Found", status=404, detail=detail, cause=cause) prob = serialize_clean_camel_case(prob) - return Response(json.dumps(prob, cls=CustomJSONEncoder), status=404, mimetype=mimetype) \ No newline at end of file + return Response(json.dumps(prob, cls=CustomJSONEncoder), status=404, mimetype=mimetype) + + +def unauthorized_error(detail, cause): + prob = ProblemDetails(title="Unauthorized", status=401, detail=detail, cause=cause) + prob = serialize_clean_camel_case(prob) + + return Response(json.dumps(prob, cls=CustomJSONEncoder), status=401, mimetype=mimetype) \ No newline at end of file diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/access_control_policy_list.py b/services/TS29222_CAPIF_Events_API/capif_events/models/access_control_policy_list.py index 42b98fed0c60768af1cdd6067eb5c0e655126814..b7f6ef08d62389da55159910f5020ce78a16fd81 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/access_control_policy_list.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/access_control_policy_list.py @@ -2,7 +2,8 @@ from datetime import date, datetime # noqa: F401 from typing import Dict, List # noqa: F401 from capif_events import util -from capif_events.models.api_invoker_policy import ApiInvokerPolicy # noqa: E501 +from capif_events.models.api_invoker_policy import \ + ApiInvokerPolicy # noqa: E501 from capif_events.models.base_model import Model diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/access_control_policy_list_ext.py b/services/TS29222_CAPIF_Events_API/capif_events/models/access_control_policy_list_ext.py index 5cdc5543c7499fed73c7be30b3b49d10d0c47d86..302bece0030f37d63239b2b68ff99b66febc4d78 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/access_control_policy_list_ext.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/access_control_policy_list_ext.py @@ -2,7 +2,8 @@ from datetime import date, datetime # noqa: F401 from typing import Dict, List # noqa: F401 from capif_events import util -from capif_events.models.api_invoker_policy import ApiInvokerPolicy # noqa: E501 +from capif_events.models.api_invoker_policy import \ + ApiInvokerPolicy # noqa: E501 from capif_events.models.base_model import Model diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/aef_profile.py b/services/TS29222_CAPIF_Events_API/capif_events/models/aef_profile.py index c29502c6a0e1c02996fc9dd2bc7be56d223c7662..b448336b1fc9da6a16de5c523e8755ea485dae9b 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/aef_profile.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/aef_profile.py @@ -5,7 +5,8 @@ from capif_events import util from capif_events.models.aef_location import AefLocation # noqa: E501 from capif_events.models.base_model import Model from capif_events.models.data_format import DataFormat # noqa: E501 -from capif_events.models.interface_description import InterfaceDescription # noqa: E501 +from capif_events.models.interface_description import \ + InterfaceDescription # noqa: E501 from capif_events.models.ip_addr_range import IpAddrRange # noqa: E501 from capif_events.models.o_auth_grant_type import OAuthGrantType # noqa: E501 from capif_events.models.protocol import Protocol # noqa: E501 diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/api_info.py b/services/TS29222_CAPIF_Events_API/capif_events/models/api_info.py new file mode 100644 index 0000000000000000000000000000000000000000..b4d74320639d6da015b0ea499f88e145479840bc --- /dev/null +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/api_info.py @@ -0,0 +1,90 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from capif_events import util +from capif_events.models.base_model import Model + + +class ApiInfo(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, api_name=None, supported_api_versions=None): # noqa: E501 + """ApiInfo - a model defined in OpenAPI + + :param api_name: The api_name of this ApiInfo. # noqa: E501 + :type api_name: str + :param supported_api_versions: The supported_api_versions of this ApiInfo. # noqa: E501 + :type supported_api_versions: List[str] + """ + self.openapi_types = { + 'api_name': str, + 'supported_api_versions': List[str] + } + + self.attribute_map = { + 'api_name': 'apiName', + 'supported_api_versions': 'supportedApiVersions' + } + + self._api_name = api_name + self._supported_api_versions = supported_api_versions + + @classmethod + def from_dict(cls, dikt) -> 'ApiInfo': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The ApiInfo of this ApiInfo. # noqa: E501 + :rtype: ApiInfo + """ + return util.deserialize_model(dikt, cls) + + @property + def api_name(self) -> str: + """Gets the api_name of this ApiInfo. + + + :return: The api_name of this ApiInfo. + :rtype: str + """ + return self._api_name + + @api_name.setter + def api_name(self, api_name: str): + """Sets the api_name of this ApiInfo. + + + :param api_name: The api_name of this ApiInfo. + :type api_name: str + """ + if api_name is None: + raise ValueError("Invalid value for `api_name`, must not be `None`") # noqa: E501 + + self._api_name = api_name + + @property + def supported_api_versions(self) -> List[str]: + """Gets the supported_api_versions of this ApiInfo. + + + :return: The supported_api_versions of this ApiInfo. + :rtype: List[str] + """ + return self._supported_api_versions + + @supported_api_versions.setter + def supported_api_versions(self, supported_api_versions: List[str]): + """Sets the supported_api_versions of this ApiInfo. + + + :param supported_api_versions: The supported_api_versions of this ApiInfo. + :type supported_api_versions: List[str] + """ + if supported_api_versions is not None and len(supported_api_versions) < 1: + raise ValueError("Invalid value for `supported_api_versions`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._supported_api_versions = supported_api_versions diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/api_invoker_count.py b/services/TS29222_CAPIF_Events_API/capif_events/models/api_invoker_count.py new file mode 100644 index 0000000000000000000000000000000000000000..4d958202bea1a613f46e9d7c9c377e990cf6e39c --- /dev/null +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/api_invoker_count.py @@ -0,0 +1,92 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from capif_events import util +from capif_events.models.base_model import Model + + +class ApiInvokerCount(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, api_id=None, count=None): # noqa: E501 + """ApiInvokerCount - a model defined in OpenAPI + + :param api_id: The api_id of this ApiInvokerCount. # noqa: E501 + :type api_id: str + :param count: The count of this ApiInvokerCount. # noqa: E501 + :type count: int + """ + self.openapi_types = { + 'api_id': str, + 'count': int + } + + self.attribute_map = { + 'api_id': 'apiId', + 'count': 'count' + } + + self._api_id = api_id + self._count = count + + @classmethod + def from_dict(cls, dikt) -> 'ApiInvokerCount': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The ApiInvokerCount of this ApiInvokerCount. # noqa: E501 + :rtype: ApiInvokerCount + """ + return util.deserialize_model(dikt, cls) + + @property + def api_id(self) -> str: + """Gets the api_id of this ApiInvokerCount. + + + :return: The api_id of this ApiInvokerCount. + :rtype: str + """ + return self._api_id + + @api_id.setter + def api_id(self, api_id: str): + """Sets the api_id of this ApiInvokerCount. + + + :param api_id: The api_id of this ApiInvokerCount. + :type api_id: str + """ + if api_id is None: + raise ValueError("Invalid value for `api_id`, must not be `None`") # noqa: E501 + + self._api_id = api_id + + @property + def count(self) -> int: + """Gets the count of this ApiInvokerCount. + + Contains the number of times the API Invokers requested to onboard the service API(s) API. # noqa: E501 + + :return: The count of this ApiInvokerCount. + :rtype: int + """ + return self._count + + @count.setter + def count(self, count: int): + """Sets the count of this ApiInvokerCount. + + Contains the number of times the API Invokers requested to onboard the service API(s) API. # noqa: E501 + + :param count: The count of this ApiInvokerCount. + :type count: int + """ + if count is None: + raise ValueError("Invalid value for `count`, must not be `None`") # noqa: E501 + + self._count = count diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/api_invoker_policy.py b/services/TS29222_CAPIF_Events_API/capif_events/models/api_invoker_policy.py index a627518b753ec9912f07a0b888c361aa20dc4b37..a73c2b9a52ee720b3c935e859bfb713054e8b01c 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/api_invoker_policy.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/api_invoker_policy.py @@ -3,6 +3,7 @@ from typing import Dict, List # noqa: F401 from capif_events import util from capif_events.models.base_model import Model +from capif_events.models.net_slice_id import NetSliceId # noqa: E501 from capif_events.models.time_range_list import TimeRangeList # noqa: E501 @@ -12,7 +13,7 @@ class ApiInvokerPolicy(Model): Do not edit the class manually. """ - def __init__(self, api_invoker_id=None, allowed_total_invocations=None, allowed_invocations_per_second=None, allowed_invocation_time_range_list=None): # noqa: E501 + def __init__(self, api_invoker_id=None, allowed_total_invocations=None, allowed_invocations_per_second=None, allowed_invocation_time_range_list=None, net_slice_info=None): # noqa: E501 """ApiInvokerPolicy - a model defined in OpenAPI :param api_invoker_id: The api_invoker_id of this ApiInvokerPolicy. # noqa: E501 @@ -23,25 +24,30 @@ class ApiInvokerPolicy(Model): :type allowed_invocations_per_second: int :param allowed_invocation_time_range_list: The allowed_invocation_time_range_list of this ApiInvokerPolicy. # noqa: E501 :type allowed_invocation_time_range_list: List[TimeRangeList] + :param net_slice_info: The net_slice_info of this ApiInvokerPolicy. # noqa: E501 + :type net_slice_info: List[NetSliceId] """ self.openapi_types = { 'api_invoker_id': str, 'allowed_total_invocations': int, 'allowed_invocations_per_second': int, - 'allowed_invocation_time_range_list': List[TimeRangeList] + 'allowed_invocation_time_range_list': List[TimeRangeList], + 'net_slice_info': List[NetSliceId] } self.attribute_map = { 'api_invoker_id': 'apiInvokerId', 'allowed_total_invocations': 'allowedTotalInvocations', 'allowed_invocations_per_second': 'allowedInvocationsPerSecond', - 'allowed_invocation_time_range_list': 'allowedInvocationTimeRangeList' + 'allowed_invocation_time_range_list': 'allowedInvocationTimeRangeList', + 'net_slice_info': 'netSliceInfo' } self._api_invoker_id = api_invoker_id self._allowed_total_invocations = allowed_total_invocations self._allowed_invocations_per_second = allowed_invocations_per_second self._allowed_invocation_time_range_list = allowed_invocation_time_range_list + self._net_slice_info = net_slice_info @classmethod def from_dict(cls, dikt) -> 'ApiInvokerPolicy': @@ -149,3 +155,26 @@ class ApiInvokerPolicy(Model): raise ValueError("Invalid value for `allowed_invocation_time_range_list`, number of items must be greater than or equal to `0`") # noqa: E501 self._allowed_invocation_time_range_list = allowed_invocation_time_range_list + + @property + def net_slice_info(self) -> List[NetSliceId]: + """Gets the net_slice_info of this ApiInvokerPolicy. + + + :return: The net_slice_info of this ApiInvokerPolicy. + :rtype: List[NetSliceId] + """ + return self._net_slice_info + + @net_slice_info.setter + def net_slice_info(self, net_slice_info: List[NetSliceId]): + """Sets the net_slice_info of this ApiInvokerPolicy. + + + :param net_slice_info: The net_slice_info of this ApiInvokerPolicy. + :type net_slice_info: List[NetSliceId] + """ + if net_slice_info is not None and len(net_slice_info) < 1: + raise ValueError("Invalid value for `net_slice_info`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._net_slice_info = net_slice_info diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/api_status.py b/services/TS29222_CAPIF_Events_API/capif_events/models/api_status.py index 25b8d95c8679095bd13d713386cc5b4ac4cedbb3..52251b9606b9220942b28291793453b5e7241bef 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/api_status.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/api_status.py @@ -42,7 +42,7 @@ class ApiStatus(Model): def aef_ids(self) -> List[str]: """Gets the aef_ids of this ApiStatus. - Indicates the list of AEF ID(s) where the API is active. If this attribute is omitted, the API is inactive at all AEF(s) defined in the \"aefProfiles\" attribute within the ServiceAPIDescription data structure. # noqa: E501 + Indicates the list of AEF ID(s) where the API is active. If an empty array is provided, it indicates that the API is inactive in all AEF(s). # noqa: E501 :return: The aef_ids of this ApiStatus. :rtype: List[str] @@ -53,7 +53,7 @@ class ApiStatus(Model): def aef_ids(self, aef_ids: List[str]): """Sets the aef_ids of this ApiStatus. - Indicates the list of AEF ID(s) where the API is active. If this attribute is omitted, the API is inactive at all AEF(s) defined in the \"aefProfiles\" attribute within the ServiceAPIDescription data structure. # noqa: E501 + Indicates the list of AEF ID(s) where the API is active. If an empty array is provided, it indicates that the API is inactive in all AEF(s). # noqa: E501 :param aef_ids: The aef_ids of this ApiStatus. :type aef_ids: List[str] diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/capif_event_detail.py b/services/TS29222_CAPIF_Events_API/capif_events/models/capif_event_detail.py index 6dcc6c7fdbd607c07b7c47e9f21761e9f547c997..69d13e3b4490c4ac834b35ebee3c6f06639019b8 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/capif_event_detail.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/capif_event_detail.py @@ -2,10 +2,16 @@ from datetime import date, datetime # noqa: F401 from typing import Dict, List # noqa: F401 from capif_events import util -from capif_events.models.access_control_policy_list_ext import AccessControlPolicyListExt # noqa: E501 +from capif_events.models.access_control_policy_list_ext import \ + AccessControlPolicyListExt # noqa: E501 +from capif_events.models.api_invoker_count import ApiInvokerCount # noqa: E501 from capif_events.models.base_model import Model +from capif_events.models.discovery_count import DiscoveryCount # noqa: E501 from capif_events.models.invocation_log import InvocationLog # noqa: E501 -from capif_events.models.service_api_description import ServiceAPIDescription # noqa: E501 +from capif_events.models.onboarding_criteria import \ + OnboardingCriteria # noqa: E501 +from capif_events.models.service_api_description import \ + ServiceAPIDescription # noqa: E501 from capif_events.models.topology_hiding import TopologyHiding # noqa: E501 @@ -15,7 +21,7 @@ class CAPIFEventDetail(Model): Do not edit the class manually. """ - def __init__(self, service_api_descriptions=None, api_ids=None, api_invoker_ids=None, acc_ctrl_pol_list=None, invocation_logs=None, api_topo_hide=None): # noqa: E501 + def __init__(self, service_api_descriptions=None, api_ids=None, api_invoker_ids=None, acc_ctrl_pol_list=None, invocation_logs=None, api_topo_hide=None, onboarding_criteria=None, onboarded_count=None, discovery_count=None): # noqa: E501 """CAPIFEventDetail - a model defined in OpenAPI :param service_api_descriptions: The service_api_descriptions of this CAPIFEventDetail. # noqa: E501 @@ -30,6 +36,12 @@ class CAPIFEventDetail(Model): :type invocation_logs: List[InvocationLog] :param api_topo_hide: The api_topo_hide of this CAPIFEventDetail. # noqa: E501 :type api_topo_hide: TopologyHiding + :param onboarding_criteria: The onboarding_criteria of this CAPIFEventDetail. # noqa: E501 + :type onboarding_criteria: List[OnboardingCriteria] + :param onboarded_count: The onboarded_count of this CAPIFEventDetail. # noqa: E501 + :type onboarded_count: List[ApiInvokerCount] + :param discovery_count: The discovery_count of this CAPIFEventDetail. # noqa: E501 + :type discovery_count: List[DiscoveryCount] """ self.openapi_types = { 'service_api_descriptions': List[ServiceAPIDescription], @@ -37,7 +49,10 @@ class CAPIFEventDetail(Model): 'api_invoker_ids': List[str], 'acc_ctrl_pol_list': AccessControlPolicyListExt, 'invocation_logs': List[InvocationLog], - 'api_topo_hide': TopologyHiding + 'api_topo_hide': TopologyHiding, + 'onboarding_criteria': List[OnboardingCriteria], + 'onboarded_count': List[ApiInvokerCount], + 'discovery_count': List[DiscoveryCount] } self.attribute_map = { @@ -46,7 +61,10 @@ class CAPIFEventDetail(Model): 'api_invoker_ids': 'apiInvokerIds', 'acc_ctrl_pol_list': 'accCtrlPolList', 'invocation_logs': 'invocationLogs', - 'api_topo_hide': 'apiTopoHide' + 'api_topo_hide': 'apiTopoHide', + 'onboarding_criteria': 'onboardingCriteria', + 'onboarded_count': 'onboardedCount', + 'discovery_count': 'discoveryCount' } self._service_api_descriptions = service_api_descriptions @@ -55,6 +73,9 @@ class CAPIFEventDetail(Model): self._acc_ctrl_pol_list = acc_ctrl_pol_list self._invocation_logs = invocation_logs self._api_topo_hide = api_topo_hide + self._onboarding_criteria = onboarding_criteria + self._onboarded_count = onboarded_count + self._discovery_count = discovery_count @classmethod def from_dict(cls, dikt) -> 'CAPIFEventDetail': @@ -96,7 +117,7 @@ class CAPIFEventDetail(Model): def api_ids(self) -> List[str]: """Gets the api_ids of this CAPIFEventDetail. - Identifier of the service API # noqa: E501 + Identifier of the service API. # noqa: E501 :return: The api_ids of this CAPIFEventDetail. :rtype: List[str] @@ -107,7 +128,7 @@ class CAPIFEventDetail(Model): def api_ids(self, api_ids: List[str]): """Sets the api_ids of this CAPIFEventDetail. - Identifier of the service API # noqa: E501 + Identifier of the service API. # noqa: E501 :param api_ids: The api_ids of this CAPIFEventDetail. :type api_ids: List[str] @@ -121,7 +142,7 @@ class CAPIFEventDetail(Model): def api_invoker_ids(self) -> List[str]: """Gets the api_invoker_ids of this CAPIFEventDetail. - Identity of the API invoker # noqa: E501 + Identity of the API invoker. # noqa: E501 :return: The api_invoker_ids of this CAPIFEventDetail. :rtype: List[str] @@ -132,7 +153,7 @@ class CAPIFEventDetail(Model): def api_invoker_ids(self, api_invoker_ids: List[str]): """Sets the api_invoker_ids of this CAPIFEventDetail. - Identity of the API invoker # noqa: E501 + Identity of the API invoker. # noqa: E501 :param api_invoker_ids: The api_invoker_ids of this CAPIFEventDetail. :type api_invoker_ids: List[str] @@ -208,3 +229,72 @@ class CAPIFEventDetail(Model): """ self._api_topo_hide = api_topo_hide + + @property + def onboarding_criteria(self) -> List[OnboardingCriteria]: + """Gets the onboarding_criteria of this CAPIFEventDetail. + + + :return: The onboarding_criteria of this CAPIFEventDetail. + :rtype: List[OnboardingCriteria] + """ + return self._onboarding_criteria + + @onboarding_criteria.setter + def onboarding_criteria(self, onboarding_criteria: List[OnboardingCriteria]): + """Sets the onboarding_criteria of this CAPIFEventDetail. + + + :param onboarding_criteria: The onboarding_criteria of this CAPIFEventDetail. + :type onboarding_criteria: List[OnboardingCriteria] + """ + if onboarding_criteria is not None and len(onboarding_criteria) < 1: + raise ValueError("Invalid value for `onboarding_criteria`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._onboarding_criteria = onboarding_criteria + + @property + def onboarded_count(self) -> List[ApiInvokerCount]: + """Gets the onboarded_count of this CAPIFEventDetail. + + + :return: The onboarded_count of this CAPIFEventDetail. + :rtype: List[ApiInvokerCount] + """ + return self._onboarded_count + + @onboarded_count.setter + def onboarded_count(self, onboarded_count: List[ApiInvokerCount]): + """Sets the onboarded_count of this CAPIFEventDetail. + + + :param onboarded_count: The onboarded_count of this CAPIFEventDetail. + :type onboarded_count: List[ApiInvokerCount] + """ + if onboarded_count is not None and len(onboarded_count) < 1: + raise ValueError("Invalid value for `onboarded_count`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._onboarded_count = onboarded_count + + @property + def discovery_count(self) -> List[DiscoveryCount]: + """Gets the discovery_count of this CAPIFEventDetail. + + + :return: The discovery_count of this CAPIFEventDetail. + :rtype: List[DiscoveryCount] + """ + return self._discovery_count + + @discovery_count.setter + def discovery_count(self, discovery_count: List[DiscoveryCount]): + """Sets the discovery_count of this CAPIFEventDetail. + + + :param discovery_count: The discovery_count of this CAPIFEventDetail. + :type discovery_count: List[DiscoveryCount] + """ + if discovery_count is not None and len(discovery_count) < 1: + raise ValueError("Invalid value for `discovery_count`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._discovery_count = discovery_count diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/capif_event_filter.py b/services/TS29222_CAPIF_Events_API/capif_events/models/capif_event_filter.py index dd7c2d7c9bd803cba5c89cd426e72198ac303e41..bb04cc83a4b03778c8bc949be3a70f0488eac78e 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/capif_event_filter.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/capif_event_filter.py @@ -52,7 +52,7 @@ class CAPIFEventFilter(Model): def api_ids(self) -> List[str]: """Gets the api_ids of this CAPIFEventFilter. - Identifier of the service API # noqa: E501 + Identifier of the service API. # noqa: E501 :return: The api_ids of this CAPIFEventFilter. :rtype: List[str] @@ -63,7 +63,7 @@ class CAPIFEventFilter(Model): def api_ids(self, api_ids: List[str]): """Sets the api_ids of this CAPIFEventFilter. - Identifier of the service API # noqa: E501 + Identifier of the service API. # noqa: E501 :param api_ids: The api_ids of this CAPIFEventFilter. :type api_ids: List[str] @@ -77,7 +77,7 @@ class CAPIFEventFilter(Model): def api_invoker_ids(self) -> List[str]: """Gets the api_invoker_ids of this CAPIFEventFilter. - Identity of the API invoker # noqa: E501 + Identity of the API invoker. # noqa: E501 :return: The api_invoker_ids of this CAPIFEventFilter. :rtype: List[str] @@ -88,7 +88,7 @@ class CAPIFEventFilter(Model): def api_invoker_ids(self, api_invoker_ids: List[str]): """Sets the api_invoker_ids of this CAPIFEventFilter. - Identity of the API invoker # noqa: E501 + Identity of the API invoker. # noqa: E501 :param api_invoker_ids: The api_invoker_ids of this CAPIFEventFilter. :type api_invoker_ids: List[str] @@ -102,7 +102,7 @@ class CAPIFEventFilter(Model): def aef_ids(self) -> List[str]: """Gets the aef_ids of this CAPIFEventFilter. - Identifier of the API exposing function # noqa: E501 + Identifier of the API exposing function. # noqa: E501 :return: The aef_ids of this CAPIFEventFilter. :rtype: List[str] @@ -113,7 +113,7 @@ class CAPIFEventFilter(Model): def aef_ids(self, aef_ids: List[str]): """Sets the aef_ids of this CAPIFEventFilter. - Identifier of the API exposing function # noqa: E501 + Identifier of the API exposing function. # noqa: E501 :param aef_ids: The aef_ids of this CAPIFEventFilter. :type aef_ids: List[str] diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/custom_operation.py b/services/TS29222_CAPIF_Events_API/capif_events/models/custom_operation.py index 4b20ff1e3a13e1f0e365787d542913d634afe3ac..c3f39de6c99eae07d0fdc5103e4f0a514f72585c 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/custom_operation.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/custom_operation.py @@ -3,7 +3,8 @@ from typing import Dict, List # noqa: F401 from capif_events import util from capif_events.models.base_model import Model -from capif_events.models.communication_type import CommunicationType # noqa: E501 +from capif_events.models.communication_type import \ + CommunicationType # noqa: E501 from capif_events.models.operation import Operation # noqa: E501 diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/discovery_count.py b/services/TS29222_CAPIF_Events_API/capif_events/models/discovery_count.py new file mode 100644 index 0000000000000000000000000000000000000000..e279ab8e5480167a2c4d5cb7486c8bf56f752ed8 --- /dev/null +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/discovery_count.py @@ -0,0 +1,120 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from capif_events import util +from capif_events.models.base_model import Model + + +class DiscoveryCount(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, api_ids=None, discovery_req_count=None, discovery_rsp_count=None): # noqa: E501 + """DiscoveryCount - a model defined in OpenAPI + + :param api_ids: The api_ids of this DiscoveryCount. # noqa: E501 + :type api_ids: List[str] + :param discovery_req_count: The discovery_req_count of this DiscoveryCount. # noqa: E501 + :type discovery_req_count: List[int] + :param discovery_rsp_count: The discovery_rsp_count of this DiscoveryCount. # noqa: E501 + :type discovery_rsp_count: List[int] + """ + self.openapi_types = { + 'api_ids': List[str], + 'discovery_req_count': List[int], + 'discovery_rsp_count': List[int] + } + + self.attribute_map = { + 'api_ids': 'apiIds', + 'discovery_req_count': 'discoveryReqCount', + 'discovery_rsp_count': 'discoveryRspCount' + } + + self._api_ids = api_ids + self._discovery_req_count = discovery_req_count + self._discovery_rsp_count = discovery_rsp_count + + @classmethod + def from_dict(cls, dikt) -> 'DiscoveryCount': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The DiscoveryCount of this DiscoveryCount. # noqa: E501 + :rtype: DiscoveryCount + """ + return util.deserialize_model(dikt, cls) + + @property + def api_ids(self) -> List[str]: + """Gets the api_ids of this DiscoveryCount. + + + :return: The api_ids of this DiscoveryCount. + :rtype: List[str] + """ + return self._api_ids + + @api_ids.setter + def api_ids(self, api_ids: List[str]): + """Sets the api_ids of this DiscoveryCount. + + + :param api_ids: The api_ids of this DiscoveryCount. + :type api_ids: List[str] + """ + if api_ids is None: + raise ValueError("Invalid value for `api_ids`, must not be `None`") # noqa: E501 + if api_ids is not None and len(api_ids) < 1: + raise ValueError("Invalid value for `api_ids`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._api_ids = api_ids + + @property + def discovery_req_count(self) -> List[int]: + """Gets the discovery_req_count of this DiscoveryCount. + + + :return: The discovery_req_count of this DiscoveryCount. + :rtype: List[int] + """ + return self._discovery_req_count + + @discovery_req_count.setter + def discovery_req_count(self, discovery_req_count: List[int]): + """Sets the discovery_req_count of this DiscoveryCount. + + + :param discovery_req_count: The discovery_req_count of this DiscoveryCount. + :type discovery_req_count: List[int] + """ + if discovery_req_count is not None and len(discovery_req_count) < 1: + raise ValueError("Invalid value for `discovery_req_count`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._discovery_req_count = discovery_req_count + + @property + def discovery_rsp_count(self) -> List[int]: + """Gets the discovery_rsp_count of this DiscoveryCount. + + + :return: The discovery_rsp_count of this DiscoveryCount. + :rtype: List[int] + """ + return self._discovery_rsp_count + + @discovery_rsp_count.setter + def discovery_rsp_count(self, discovery_rsp_count: List[int]): + """Sets the discovery_rsp_count of this DiscoveryCount. + + + :param discovery_rsp_count: The discovery_rsp_count of this DiscoveryCount. + :type discovery_rsp_count: List[int] + """ + if discovery_rsp_count is not None and len(discovery_rsp_count) < 1: + raise ValueError("Invalid value for `discovery_rsp_count`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._discovery_rsp_count = discovery_rsp_count diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/ellipsoid_arc.py b/services/TS29222_CAPIF_Events_API/capif_events/models/ellipsoid_arc.py index 928435e920ac7a14957e517255761d332108254e..200bb7adb2170bae7836264f947cc63ac7be8c2e 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/ellipsoid_arc.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/ellipsoid_arc.py @@ -4,8 +4,10 @@ from typing import Dict, List # noqa: F401 from capif_events import util from capif_events.models.base_model import Model from capif_events.models.gad_shape import GADShape # noqa: E501 -from capif_events.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 -from capif_events.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 +from capif_events.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from capif_events.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 class EllipsoidArc(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/event_notification.py b/services/TS29222_CAPIF_Events_API/capif_events/models/event_notification.py index a77a357e1abf68cf57f15d8ab3b5031c7cf87b6a..a15182a12c31253d9d5471b86abc3db9cf9d2238 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/event_notification.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/event_notification.py @@ -4,7 +4,8 @@ from typing import Dict, List # noqa: F401 from capif_events import util from capif_events.models.base_model import Model from capif_events.models.capif_event import CAPIFEvent # noqa: E501 -from capif_events.models.capif_event_detail import CAPIFEventDetail # noqa: E501 +from capif_events.models.capif_event_detail import \ + CAPIFEventDetail # noqa: E501 class EventNotification(Model): @@ -54,7 +55,7 @@ class EventNotification(Model): def subscription_id(self) -> str: """Gets the subscription_id of this EventNotification. - Identifier of the subscription resource to which the notification is related – CAPIF resource identifier # noqa: E501 + Identifier of the subscription resource to which the notification is related. # noqa: E501 :return: The subscription_id of this EventNotification. :rtype: str @@ -65,7 +66,7 @@ class EventNotification(Model): def subscription_id(self, subscription_id: str): """Sets the subscription_id of this EventNotification. - Identifier of the subscription resource to which the notification is related – CAPIF resource identifier # noqa: E501 + Identifier of the subscription resource to which the notification is related. # noqa: E501 :param subscription_id: The subscription_id of this EventNotification. :type subscription_id: str diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/event_subscription.py b/services/TS29222_CAPIF_Events_API/capif_events/models/event_subscription.py index 0470f4e68343a62cff358f070463eb8afe871109..c07245d79dbdbf27d604c5d18b428b8767752bf0 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/event_subscription.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/event_subscription.py @@ -5,9 +5,12 @@ from typing import Dict, List # noqa: F401 from capif_events import util from capif_events.models.base_model import Model from capif_events.models.capif_event import CAPIFEvent # noqa: E501 -from capif_events.models.capif_event_filter import CAPIFEventFilter # noqa: E501 -from capif_events.models.reporting_information import ReportingInformation # noqa: E501 -from capif_events.models.websock_notif_config import WebsockNotifConfig # noqa: E501 +from capif_events.models.capif_event_filter import \ + CAPIFEventFilter # noqa: E501 +from capif_events.models.reporting_information import \ + ReportingInformation # noqa: E501 +from capif_events.models.websock_notif_config import \ + WebsockNotifConfig # noqa: E501 class EventSubscription(Model): @@ -62,7 +65,6 @@ class EventSubscription(Model): self._websock_notif_config = websock_notif_config self._supported_features = supported_features - @classmethod def from_dict(cls, dikt) -> 'EventSubscription': """Returns the dict as a model @@ -78,7 +80,7 @@ class EventSubscription(Model): def events(self) -> List[CAPIFEvent]: """Gets the events of this EventSubscription. - Subscribed events # noqa: E501 + Subscribed events. # noqa: E501 :return: The events of this EventSubscription. :rtype: List[CAPIFEvent] @@ -89,7 +91,7 @@ class EventSubscription(Model): def events(self, events: List[CAPIFEvent]): """Sets the events of this EventSubscription. - Subscribed events # noqa: E501 + Subscribed events. # noqa: E501 :param events: The events of this EventSubscription. :type events: List[CAPIFEvent] @@ -105,7 +107,7 @@ class EventSubscription(Model): def event_filters(self) -> List[CAPIFEventFilter]: """Gets the event_filters of this EventSubscription. - Subscribed event filters # noqa: E501 + Subscribed event filters. # noqa: E501 :return: The event_filters of this EventSubscription. :rtype: List[CAPIFEventFilter] @@ -116,7 +118,7 @@ class EventSubscription(Model): def event_filters(self, event_filters: List[CAPIFEventFilter]): """Sets the event_filters of this EventSubscription. - Subscribed event filters # noqa: E501 + Subscribed event filters. # noqa: E501 :param event_filters: The event_filters of this EventSubscription. :type event_filters: List[CAPIFEventFilter] diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/event_subscription_patch.py b/services/TS29222_CAPIF_Events_API/capif_events/models/event_subscription_patch.py index 437e372d7337e9115faeea54e3ce633317b94bbe..09d0a556622547cac62361c1a45836f3d885de2c 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/event_subscription_patch.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/event_subscription_patch.py @@ -4,8 +4,10 @@ from typing import Dict, List # noqa: F401 from capif_events import util from capif_events.models.base_model import Model from capif_events.models.capif_event import CAPIFEvent # noqa: E501 -from capif_events.models.capif_event_filter import CAPIFEventFilter # noqa: E501 -from capif_events.models.reporting_information import ReportingInformation # noqa: E501 +from capif_events.models.capif_event_filter import \ + CAPIFEventFilter # noqa: E501 +from capif_events.models.reporting_information import \ + ReportingInformation # noqa: E501 class EventSubscriptionPatch(Model): @@ -60,7 +62,7 @@ class EventSubscriptionPatch(Model): def events(self) -> List[CAPIFEvent]: """Gets the events of this EventSubscriptionPatch. - Subscribed events # noqa: E501 + Subscribed events. # noqa: E501 :return: The events of this EventSubscriptionPatch. :rtype: List[CAPIFEvent] @@ -71,7 +73,7 @@ class EventSubscriptionPatch(Model): def events(self, events: List[CAPIFEvent]): """Sets the events of this EventSubscriptionPatch. - Subscribed events # noqa: E501 + Subscribed events. # noqa: E501 :param events: The events of this EventSubscriptionPatch. :type events: List[CAPIFEvent] @@ -85,7 +87,7 @@ class EventSubscriptionPatch(Model): def event_filters(self) -> List[CAPIFEventFilter]: """Gets the event_filters of this EventSubscriptionPatch. - Subscribed event filters # noqa: E501 + Subscribed event filters. # noqa: E501 :return: The event_filters of this EventSubscriptionPatch. :rtype: List[CAPIFEventFilter] @@ -96,7 +98,7 @@ class EventSubscriptionPatch(Model): def event_filters(self, event_filters: List[CAPIFEventFilter]): """Sets the event_filters of this EventSubscriptionPatch. - Subscribed event filters # noqa: E501 + Subscribed event filters. # noqa: E501 :param event_filters: The event_filters of this EventSubscriptionPatch. :type event_filters: List[CAPIFEventFilter] diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/gad_shape.py b/services/TS29222_CAPIF_Events_API/capif_events/models/gad_shape.py index 4ff103ebce6ff1a8bdacba50c6a97089b144d3dc..35eb2267b246f01de9074f31671926ac188e45a0 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/gad_shape.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/gad_shape.py @@ -3,7 +3,8 @@ from typing import Dict, List # noqa: F401 from capif_events import util from capif_events.models.base_model import Model -from capif_events.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 +from capif_events.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 class GADShape(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/geographic_area.py b/services/TS29222_CAPIF_Events_API/capif_events/models/geographic_area.py index f09f9422ef661d84c6c0fd1dc14e7cbc53e8c996..f8887e8d2ae46b2e7f2394539f098ac3773a24e1 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/geographic_area.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/geographic_area.py @@ -4,15 +4,21 @@ from typing import Dict, List # noqa: F401 from capif_events import util from capif_events.models.base_model import Model from capif_events.models.ellipsoid_arc import EllipsoidArc # noqa: E501 -from capif_events.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 +from capif_events.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 from capif_events.models.point import Point # noqa: E501 from capif_events.models.point_altitude import PointAltitude # noqa: E501 -from capif_events.models.point_altitude_uncertainty import PointAltitudeUncertainty # noqa: E501 -from capif_events.models.point_uncertainty_circle import PointUncertaintyCircle # noqa: E501 -from capif_events.models.point_uncertainty_ellipse import PointUncertaintyEllipse # noqa: E501 +from capif_events.models.point_altitude_uncertainty import \ + PointAltitudeUncertainty # noqa: E501 +from capif_events.models.point_uncertainty_circle import \ + PointUncertaintyCircle # noqa: E501 +from capif_events.models.point_uncertainty_ellipse import \ + PointUncertaintyEllipse # noqa: E501 from capif_events.models.polygon import Polygon # noqa: E501 -from capif_events.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 -from capif_events.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 +from capif_events.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 +from capif_events.models.uncertainty_ellipse import \ + UncertaintyEllipse # noqa: E501 class GeographicArea(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/ip_addr_range.py b/services/TS29222_CAPIF_Events_API/capif_events/models/ip_addr_range.py index 0c43c0a4fa792bb1367566d624977ed9074f9f7e..1cabfe96f262397cdbf6292bf85aecbc8c0b9339 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/ip_addr_range.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/ip_addr_range.py @@ -3,8 +3,10 @@ from typing import Dict, List # noqa: F401 from capif_events import util from capif_events.models.base_model import Model -from capif_events.models.ipv4_address_range import Ipv4AddressRange # noqa: E501 -from capif_events.models.ipv6_address_range1 import Ipv6AddressRange1 # noqa: E501 +from capif_events.models.ipv4_address_range import \ + Ipv4AddressRange # noqa: E501 +from capif_events.models.ipv6_address_range1 import \ + Ipv6AddressRange1 # noqa: E501 class IpAddrRange(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/local2d_point_uncertainty_ellipse.py b/services/TS29222_CAPIF_Events_API/capif_events/models/local2d_point_uncertainty_ellipse.py index 3432c47665c645f6c81432f55ebc05de10809cf4..2090ae88bc21a7b9fef672d5d326a2cbd0b8a218 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/local2d_point_uncertainty_ellipse.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/local2d_point_uncertainty_ellipse.py @@ -5,9 +5,12 @@ from capif_events import util from capif_events.models.base_model import Model from capif_events.models.gad_shape import GADShape # noqa: E501 from capif_events.models.local_origin import LocalOrigin # noqa: E501 -from capif_events.models.relative_cartesian_location import RelativeCartesianLocation # noqa: E501 -from capif_events.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 -from capif_events.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 +from capif_events.models.relative_cartesian_location import \ + RelativeCartesianLocation # noqa: E501 +from capif_events.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 +from capif_events.models.uncertainty_ellipse import \ + UncertaintyEllipse # noqa: E501 class Local2dPointUncertaintyEllipse(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/local3d_point_uncertainty_ellipsoid.py b/services/TS29222_CAPIF_Events_API/capif_events/models/local3d_point_uncertainty_ellipsoid.py index 702a38e1c1c8dd565993b21be3f586362a19713f..871723359e9a308fcf74ec0a99b2fec04b2fe220 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/local3d_point_uncertainty_ellipsoid.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/local3d_point_uncertainty_ellipsoid.py @@ -5,9 +5,12 @@ from capif_events import util from capif_events.models.base_model import Model from capif_events.models.gad_shape import GADShape # noqa: E501 from capif_events.models.local_origin import LocalOrigin # noqa: E501 -from capif_events.models.relative_cartesian_location import RelativeCartesianLocation # noqa: E501 -from capif_events.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 -from capif_events.models.uncertainty_ellipsoid import UncertaintyEllipsoid # noqa: E501 +from capif_events.models.relative_cartesian_location import \ + RelativeCartesianLocation # noqa: E501 +from capif_events.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 +from capif_events.models.uncertainty_ellipsoid import \ + UncertaintyEllipsoid # noqa: E501 class Local3dPointUncertaintyEllipsoid(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/local_origin.py b/services/TS29222_CAPIF_Events_API/capif_events/models/local_origin.py index f11e9ffe08e9d3f873962e5f849d33d991dda4ca..d45844cc6abe49662d6f3c28c07ee492060d3451 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/local_origin.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/local_origin.py @@ -4,7 +4,8 @@ from typing import Dict, List # noqa: F401 from capif_events import util from capif_events.models.base_model import Model from capif_events.models.geographic_area import GeographicArea # noqa: E501 -from capif_events.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 +from capif_events.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 class LocalOrigin(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/log.py b/services/TS29222_CAPIF_Events_API/capif_events/models/log.py index 647a3c0807a971e1cd1c111417fae252741766e4..e4b2825789f8fc699ac052a23e28712ec9c90054 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/log.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/log.py @@ -3,7 +3,9 @@ from typing import Dict, List # noqa: F401 from capif_events import util from capif_events.models.base_model import Model -from capif_events.models.interface_description import InterfaceDescription # noqa: E501 +from capif_events.models.interface_description import \ + InterfaceDescription # noqa: E501 +from capif_events.models.net_slice_id import NetSliceId # noqa: E501 from capif_events.models.operation import Operation # noqa: E501 from capif_events.models.protocol import Protocol # noqa: E501 @@ -14,7 +16,7 @@ class Log(Model): Do not edit the class manually. """ - def __init__(self, api_id=None, api_name=None, api_version=None, resource_name=None, uri=None, protocol=None, operation=None, result=None, invocation_time=None, invocation_latency=None, input_parameters=None, output_parameters=None, src_interface=None, dest_interface=None, fwd_interface=None): # noqa: E501 + def __init__(self, api_id=None, api_name=None, api_version=None, resource_name=None, uri=None, protocol=None, operation=None, result=None, invocation_time=None, invocation_latency=None, input_parameters=None, output_parameters=None, src_interface=None, dest_interface=None, fwd_interface=None, net_slice_info=None): # noqa: E501 """Log - a model defined in OpenAPI :param api_id: The api_id of this Log. # noqa: E501 @@ -47,6 +49,8 @@ class Log(Model): :type dest_interface: InterfaceDescription :param fwd_interface: The fwd_interface of this Log. # noqa: E501 :type fwd_interface: str + :param net_slice_info: The net_slice_info of this Log. # noqa: E501 + :type net_slice_info: NetSliceId """ self.openapi_types = { 'api_id': str, @@ -63,7 +67,8 @@ class Log(Model): 'output_parameters': object, 'src_interface': InterfaceDescription, 'dest_interface': InterfaceDescription, - 'fwd_interface': str + 'fwd_interface': str, + 'net_slice_info': NetSliceId } self.attribute_map = { @@ -81,7 +86,8 @@ class Log(Model): 'output_parameters': 'outputParameters', 'src_interface': 'srcInterface', 'dest_interface': 'destInterface', - 'fwd_interface': 'fwdInterface' + 'fwd_interface': 'fwdInterface', + 'net_slice_info': 'netSliceInfo' } self._api_id = api_id @@ -99,6 +105,7 @@ class Log(Model): self._src_interface = src_interface self._dest_interface = dest_interface self._fwd_interface = fwd_interface + self._net_slice_info = net_slice_info @classmethod def from_dict(cls, dikt) -> 'Log': @@ -140,7 +147,7 @@ class Log(Model): def api_name(self) -> str: """Gets the api_name of this Log. - Name of the API which was invoked, it is set as {apiName} part of the URI structure as defined in clause 5.2.4 of 3GPP TS 29.122. # noqa: E501 + Contains the invoked API name set to the value of the \"\" placeholder of the API URI as defined in clause 5.2.4 of 3GPP TS 29.122 [14]. # noqa: E501 :return: The api_name of this Log. :rtype: str @@ -151,7 +158,7 @@ class Log(Model): def api_name(self, api_name: str): """Sets the api_name of this Log. - Name of the API which was invoked, it is set as {apiName} part of the URI structure as defined in clause 5.2.4 of 3GPP TS 29.122. # noqa: E501 + Contains the invoked API name set to the value of the \"\" placeholder of the API URI as defined in clause 5.2.4 of 3GPP TS 29.122 [14]. # noqa: E501 :param api_name: The api_name of this Log. :type api_name: str @@ -461,3 +468,24 @@ class Log(Model): """ self._fwd_interface = fwd_interface + + @property + def net_slice_info(self) -> NetSliceId: + """Gets the net_slice_info of this Log. + + + :return: The net_slice_info of this Log. + :rtype: NetSliceId + """ + return self._net_slice_info + + @net_slice_info.setter + def net_slice_info(self, net_slice_info: NetSliceId): + """Sets the net_slice_info of this Log. + + + :param net_slice_info: The net_slice_info of this Log. + :type net_slice_info: NetSliceId + """ + + self._net_slice_info = net_slice_info diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/muting_exception_instructions.py b/services/TS29222_CAPIF_Events_API/capif_events/models/muting_exception_instructions.py index a928f40f863e485b4ed3f6d0424379cf37be212f..083886c15d2d4fff92d607ed483ee625c883690a 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/muting_exception_instructions.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/muting_exception_instructions.py @@ -3,8 +3,10 @@ from typing import Dict, List # noqa: F401 from capif_events import util from capif_events.models.base_model import Model -from capif_events.models.buffered_notifications_action import BufferedNotificationsAction # noqa: E501 -from capif_events.models.subscription_action import SubscriptionAction # noqa: E501 +from capif_events.models.buffered_notifications_action import \ + BufferedNotificationsAction # noqa: E501 +from capif_events.models.subscription_action import \ + SubscriptionAction # noqa: E501 class MutingExceptionInstructions(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/net_slice_id.py b/services/TS29222_CAPIF_Events_API/capif_events/models/net_slice_id.py new file mode 100644 index 0000000000000000000000000000000000000000..de23e7b5b97865711d20c6a89bd533bf5a4e077f --- /dev/null +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/net_slice_id.py @@ -0,0 +1,117 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from capif_events import util +from capif_events.models.base_model import Model +from capif_events.models.snssai import Snssai # noqa: E501 + + +class NetSliceId(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, snssai=None, nsi_id=None, ensi=None): # noqa: E501 + """NetSliceId - a model defined in OpenAPI + + :param snssai: The snssai of this NetSliceId. # noqa: E501 + :type snssai: Snssai + :param nsi_id: The nsi_id of this NetSliceId. # noqa: E501 + :type nsi_id: str + :param ensi: The ensi of this NetSliceId. # noqa: E501 + :type ensi: str + """ + self.openapi_types = { + 'snssai': Snssai, + 'nsi_id': str, + 'ensi': str + } + + self.attribute_map = { + 'snssai': 'snssai', + 'nsi_id': 'nsiId', + 'ensi': 'ensi' + } + + self._snssai = snssai + self._nsi_id = nsi_id + self._ensi = ensi + + @classmethod + def from_dict(cls, dikt) -> 'NetSliceId': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The NetSliceId of this NetSliceId. # noqa: E501 + :rtype: NetSliceId + """ + return util.deserialize_model(dikt, cls) + + @property + def snssai(self) -> Snssai: + """Gets the snssai of this NetSliceId. + + + :return: The snssai of this NetSliceId. + :rtype: Snssai + """ + return self._snssai + + @snssai.setter + def snssai(self, snssai: Snssai): + """Sets the snssai of this NetSliceId. + + + :param snssai: The snssai of this NetSliceId. + :type snssai: Snssai + """ + + self._snssai = snssai + + @property + def nsi_id(self) -> str: + """Gets the nsi_id of this NetSliceId. + + Contains the Identifier of the selected Network Slice instance # noqa: E501 + + :return: The nsi_id of this NetSliceId. + :rtype: str + """ + return self._nsi_id + + @nsi_id.setter + def nsi_id(self, nsi_id: str): + """Sets the nsi_id of this NetSliceId. + + Contains the Identifier of the selected Network Slice instance # noqa: E501 + + :param nsi_id: The nsi_id of this NetSliceId. + :type nsi_id: str + """ + + self._nsi_id = nsi_id + + @property + def ensi(self) -> str: + """Gets the ensi of this NetSliceId. + + Represents the External Network Slice Information that is used to identify a network slice, as specified in 3GPP TS 33.501. # noqa: E501 + + :return: The ensi of this NetSliceId. + :rtype: str + """ + return self._ensi + + @ensi.setter + def ensi(self, ensi: str): + """Sets the ensi of this NetSliceId. + + Represents the External Network Slice Information that is used to identify a network slice, as specified in 3GPP TS 33.501. # noqa: E501 + + :param ensi: The ensi of this NetSliceId. + :type ensi: str + """ + + self._ensi = ensi diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/onboarding_criteria.py b/services/TS29222_CAPIF_Events_API/capif_events/models/onboarding_criteria.py new file mode 100644 index 0000000000000000000000000000000000000000..3b969cad844d5a137f693090c60c7ceae43327e6 --- /dev/null +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/onboarding_criteria.py @@ -0,0 +1,92 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from capif_events import util +from capif_events.models.base_model import Model +from capif_events.models.related_criteria import RelatedCriteria # noqa: E501 +from capif_events.models.security_method import SecurityMethod # noqa: E501 + + +class OnboardingCriteria(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, sec_methods=None, related_criteria=None): # noqa: E501 + """OnboardingCriteria - a model defined in OpenAPI + + :param sec_methods: The sec_methods of this OnboardingCriteria. # noqa: E501 + :type sec_methods: List[SecurityMethod] + :param related_criteria: The related_criteria of this OnboardingCriteria. # noqa: E501 + :type related_criteria: RelatedCriteria + """ + self.openapi_types = { + 'sec_methods': List[SecurityMethod], + 'related_criteria': RelatedCriteria + } + + self.attribute_map = { + 'sec_methods': 'secMethods', + 'related_criteria': 'relatedCriteria' + } + + self._sec_methods = sec_methods + self._related_criteria = related_criteria + + @classmethod + def from_dict(cls, dikt) -> 'OnboardingCriteria': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The OnboardingCriteria of this OnboardingCriteria. # noqa: E501 + :rtype: OnboardingCriteria + """ + return util.deserialize_model(dikt, cls) + + @property + def sec_methods(self) -> List[SecurityMethod]: + """Gets the sec_methods of this OnboardingCriteria. + + + :return: The sec_methods of this OnboardingCriteria. + :rtype: List[SecurityMethod] + """ + return self._sec_methods + + @sec_methods.setter + def sec_methods(self, sec_methods: List[SecurityMethod]): + """Sets the sec_methods of this OnboardingCriteria. + + + :param sec_methods: The sec_methods of this OnboardingCriteria. + :type sec_methods: List[SecurityMethod] + """ + if sec_methods is None: + raise ValueError("Invalid value for `sec_methods`, must not be `None`") # noqa: E501 + if sec_methods is not None and len(sec_methods) < 1: + raise ValueError("Invalid value for `sec_methods`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._sec_methods = sec_methods + + @property + def related_criteria(self) -> RelatedCriteria: + """Gets the related_criteria of this OnboardingCriteria. + + + :return: The related_criteria of this OnboardingCriteria. + :rtype: RelatedCriteria + """ + return self._related_criteria + + @related_criteria.setter + def related_criteria(self, related_criteria: RelatedCriteria): + """Sets the related_criteria of this OnboardingCriteria. + + + :param related_criteria: The related_criteria of this OnboardingCriteria. + :type related_criteria: RelatedCriteria + """ + + self._related_criteria = related_criteria diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/point.py b/services/TS29222_CAPIF_Events_API/capif_events/models/point.py index 68b096fbea1392e7bcecf40415ceb6c99d6e6152..c8f57a869db15ec9c041a6b67f3dcc69d554d7fb 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/point.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/point.py @@ -4,8 +4,10 @@ from typing import Dict, List # noqa: F401 from capif_events import util from capif_events.models.base_model import Model from capif_events.models.gad_shape import GADShape # noqa: E501 -from capif_events.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 -from capif_events.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 +from capif_events.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from capif_events.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 class Point(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/point_altitude.py b/services/TS29222_CAPIF_Events_API/capif_events/models/point_altitude.py index 637b2e254c45c29b7552ceb8d9c23e6de0a69617..d5e995f018ca67ef36f4cb038185436c83c6dd7d 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/point_altitude.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/point_altitude.py @@ -4,8 +4,10 @@ from typing import Dict, List # noqa: F401 from capif_events import util from capif_events.models.base_model import Model from capif_events.models.gad_shape import GADShape # noqa: E501 -from capif_events.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 -from capif_events.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 +from capif_events.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from capif_events.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 class PointAltitude(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/point_altitude_uncertainty.py b/services/TS29222_CAPIF_Events_API/capif_events/models/point_altitude_uncertainty.py index 81b375b6a6e845162fb6528967e1a4a354318c59..f3ba77456588954843b9a7a8bd7ae111ea9d40e7 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/point_altitude_uncertainty.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/point_altitude_uncertainty.py @@ -4,9 +4,12 @@ from typing import Dict, List # noqa: F401 from capif_events import util from capif_events.models.base_model import Model from capif_events.models.gad_shape import GADShape # noqa: E501 -from capif_events.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 -from capif_events.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 -from capif_events.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 +from capif_events.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from capif_events.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 +from capif_events.models.uncertainty_ellipse import \ + UncertaintyEllipse # noqa: E501 class PointAltitudeUncertainty(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/point_uncertainty_circle.py b/services/TS29222_CAPIF_Events_API/capif_events/models/point_uncertainty_circle.py index 55ac081d56aa5c25b6275d686037bdfbf6830cb1..8b5e6824baa7f740b3b16192fb68e4a58fd0c64d 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/point_uncertainty_circle.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/point_uncertainty_circle.py @@ -4,8 +4,10 @@ from typing import Dict, List # noqa: F401 from capif_events import util from capif_events.models.base_model import Model from capif_events.models.gad_shape import GADShape # noqa: E501 -from capif_events.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 -from capif_events.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 +from capif_events.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from capif_events.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 class PointUncertaintyCircle(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/point_uncertainty_ellipse.py b/services/TS29222_CAPIF_Events_API/capif_events/models/point_uncertainty_ellipse.py index 515a1d183326a9f8882ada63bcb51fe5faf12489..9e7439c0f2d8655ffb79aebcf8e214663c9b8d2c 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/point_uncertainty_ellipse.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/point_uncertainty_ellipse.py @@ -4,9 +4,12 @@ from typing import Dict, List # noqa: F401 from capif_events import util from capif_events.models.base_model import Model from capif_events.models.gad_shape import GADShape # noqa: E501 -from capif_events.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 -from capif_events.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 -from capif_events.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 +from capif_events.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from capif_events.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 +from capif_events.models.uncertainty_ellipse import \ + UncertaintyEllipse # noqa: E501 class PointUncertaintyEllipse(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/polygon.py b/services/TS29222_CAPIF_Events_API/capif_events/models/polygon.py index 8d8fe40566c6cbdb9b74e429c777c04686df5c73..da34119dc78a34ee53aee1a15f5e6819180824c1 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/polygon.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/polygon.py @@ -4,8 +4,10 @@ from typing import Dict, List # noqa: F401 from capif_events import util from capif_events.models.base_model import Model from capif_events.models.gad_shape import GADShape # noqa: E501 -from capif_events.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 -from capif_events.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 +from capif_events.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from capif_events.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 class Polygon(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/related_criteria.py b/services/TS29222_CAPIF_Events_API/capif_events/models/related_criteria.py new file mode 100644 index 0000000000000000000000000000000000000000..b0183fa2c4c93d273d2d26839c97c829786a1996 --- /dev/null +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/related_criteria.py @@ -0,0 +1,119 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from capif_events import util +from capif_events.models.api_info import ApiInfo # noqa: E501 +from capif_events.models.base_model import Model + + +class RelatedCriteria(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, aef_ids=None, apis=None, service_api_categories=None): # noqa: E501 + """RelatedCriteria - a model defined in OpenAPI + + :param aef_ids: The aef_ids of this RelatedCriteria. # noqa: E501 + :type aef_ids: List[str] + :param apis: The apis of this RelatedCriteria. # noqa: E501 + :type apis: List[ApiInfo] + :param service_api_categories: The service_api_categories of this RelatedCriteria. # noqa: E501 + :type service_api_categories: List[str] + """ + self.openapi_types = { + 'aef_ids': List[str], + 'apis': List[ApiInfo], + 'service_api_categories': List[str] + } + + self.attribute_map = { + 'aef_ids': 'aefIds', + 'apis': 'apis', + 'service_api_categories': 'serviceAPICategories' + } + + self._aef_ids = aef_ids + self._apis = apis + self._service_api_categories = service_api_categories + + @classmethod + def from_dict(cls, dikt) -> 'RelatedCriteria': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The RelatedCriteria of this RelatedCriteria. # noqa: E501 + :rtype: RelatedCriteria + """ + return util.deserialize_model(dikt, cls) + + @property + def aef_ids(self) -> List[str]: + """Gets the aef_ids of this RelatedCriteria. + + + :return: The aef_ids of this RelatedCriteria. + :rtype: List[str] + """ + return self._aef_ids + + @aef_ids.setter + def aef_ids(self, aef_ids: List[str]): + """Sets the aef_ids of this RelatedCriteria. + + + :param aef_ids: The aef_ids of this RelatedCriteria. + :type aef_ids: List[str] + """ + if aef_ids is not None and len(aef_ids) < 1: + raise ValueError("Invalid value for `aef_ids`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._aef_ids = aef_ids + + @property + def apis(self) -> List[ApiInfo]: + """Gets the apis of this RelatedCriteria. + + + :return: The apis of this RelatedCriteria. + :rtype: List[ApiInfo] + """ + return self._apis + + @apis.setter + def apis(self, apis: List[ApiInfo]): + """Sets the apis of this RelatedCriteria. + + + :param apis: The apis of this RelatedCriteria. + :type apis: List[ApiInfo] + """ + if apis is not None and len(apis) < 1: + raise ValueError("Invalid value for `apis`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._apis = apis + + @property + def service_api_categories(self) -> List[str]: + """Gets the service_api_categories of this RelatedCriteria. + + + :return: The service_api_categories of this RelatedCriteria. + :rtype: List[str] + """ + return self._service_api_categories + + @service_api_categories.setter + def service_api_categories(self, service_api_categories: List[str]): + """Sets the service_api_categories of this RelatedCriteria. + + + :param service_api_categories: The service_api_categories of this RelatedCriteria. + :type service_api_categories: List[str] + """ + if service_api_categories is not None and len(service_api_categories) < 1: + raise ValueError("Invalid value for `service_api_categories`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._service_api_categories = service_api_categories diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/reporting_information.py b/services/TS29222_CAPIF_Events_API/capif_events/models/reporting_information.py index ac8dde652e4b900e5e04654ab98f31b7b54a9e0b..dda856650194b7afe4bf458cc7ba68d9e94192be 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/reporting_information.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/reporting_information.py @@ -3,11 +3,16 @@ from typing import Dict, List # noqa: F401 from capif_events import util from capif_events.models.base_model import Model -from capif_events.models.muting_exception_instructions import MutingExceptionInstructions # noqa: E501 -from capif_events.models.muting_notifications_settings import MutingNotificationsSettings # noqa: E501 -from capif_events.models.notification_flag import NotificationFlag # noqa: E501 -from capif_events.models.notification_method import NotificationMethod # noqa: E501 -from capif_events.models.partitioning_criteria import PartitioningCriteria # noqa: E501 +from capif_events.models.muting_exception_instructions import \ + MutingExceptionInstructions # noqa: E501 +from capif_events.models.muting_notifications_settings import \ + MutingNotificationsSettings # noqa: E501 +from capif_events.models.notification_flag import \ + NotificationFlag # noqa: E501 +from capif_events.models.notification_method import \ + NotificationMethod # noqa: E501 +from capif_events.models.partitioning_criteria import \ + PartitioningCriteria # noqa: E501 class ReportingInformation(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/resource.py b/services/TS29222_CAPIF_Events_API/capif_events/models/resource.py index a675ea250bc1423893c4cfc40c79778f98da5508..5707778f4ba7b49fdf379ce6837fceee79319653 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/resource.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/resource.py @@ -3,7 +3,8 @@ from typing import Dict, List # noqa: F401 from capif_events import util from capif_events.models.base_model import Model -from capif_events.models.communication_type import CommunicationType # noqa: E501 +from capif_events.models.communication_type import \ + CommunicationType # noqa: E501 from capif_events.models.custom_operation import CustomOperation # noqa: E501 from capif_events.models.operation import Operation # noqa: E501 diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/routing_rule.py b/services/TS29222_CAPIF_Events_API/capif_events/models/routing_rule.py index abfb9e619824fe3b27de5285a501ef0db18fdeb5..f3d604f5c68ab2fec93d1d39966835adf49ab476 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/routing_rule.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/routing_rule.py @@ -4,8 +4,10 @@ from typing import Dict, List # noqa: F401 from capif_events import util from capif_events.models.aef_profile import AefProfile # noqa: E501 from capif_events.models.base_model import Model -from capif_events.models.ipv4_address_range1 import Ipv4AddressRange1 # noqa: E501 -from capif_events.models.ipv6_address_range import Ipv6AddressRange # noqa: E501 +from capif_events.models.ipv4_address_range1 import \ + Ipv4AddressRange1 # noqa: E501 +from capif_events.models.ipv6_address_range import \ + Ipv6AddressRange # noqa: E501 class RoutingRule(Model): diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/service_api_description.py b/services/TS29222_CAPIF_Events_API/capif_events/models/service_api_description.py index 88daceb2aed32d51798451878dd5f82b74c4be0e..cdb71d553b206db44108a8e4d95006103b057e41 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/service_api_description.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/service_api_description.py @@ -6,8 +6,11 @@ from capif_events import util from capif_events.models.aef_profile import AefProfile # noqa: E501 from capif_events.models.api_status import ApiStatus # noqa: E501 from capif_events.models.base_model import Model -from capif_events.models.published_api_path import PublishedApiPath # noqa: E501 -from capif_events.models.shareable_information import ShareableInformation # noqa: E501 +from capif_events.models.net_slice_id import NetSliceId # noqa: E501 +from capif_events.models.published_api_path import \ + PublishedApiPath # noqa: E501 +from capif_events.models.shareable_information import \ + ShareableInformation # noqa: E501 class ServiceAPIDescription(Model): @@ -16,7 +19,7 @@ class ServiceAPIDescription(Model): Do not edit the class manually. """ - def __init__(self, api_name=None, api_id=None, api_status=None, aef_profiles=None, description=None, supported_features=None, shareable_info=None, service_api_category=None, api_supp_feats=None, pub_api_path=None, ccf_id=None, api_prov_name=None): # noqa: E501 + def __init__(self, api_name=None, api_id=None, api_status=None, aef_profiles=None, description=None, supported_features=None, shareable_info=None, service_api_category=None, api_supp_feats=None, pub_api_path=None, ccf_id=None, api_prov_name=None, net_slice_info=None): # noqa: E501 """ServiceAPIDescription - a model defined in OpenAPI :param api_name: The api_name of this ServiceAPIDescription. # noqa: E501 @@ -43,6 +46,8 @@ class ServiceAPIDescription(Model): :type ccf_id: str :param api_prov_name: The api_prov_name of this ServiceAPIDescription. # noqa: E501 :type api_prov_name: str + :param net_slice_info: The net_slice_info of this ServiceAPIDescription. # noqa: E501 + :type net_slice_info: List[NetSliceId] """ self.openapi_types = { 'api_name': str, @@ -56,7 +61,8 @@ class ServiceAPIDescription(Model): 'api_supp_feats': str, 'pub_api_path': PublishedApiPath, 'ccf_id': str, - 'api_prov_name': str + 'api_prov_name': str, + 'net_slice_info': List[NetSliceId] } self.attribute_map = { @@ -71,7 +77,8 @@ class ServiceAPIDescription(Model): 'api_supp_feats': 'apiSuppFeats', 'pub_api_path': 'pubApiPath', 'ccf_id': 'ccfId', - 'api_prov_name': 'apiProvName' + 'api_prov_name': 'apiProvName', + 'net_slice_info': 'netSliceInfo' } self._api_name = api_name @@ -86,6 +93,7 @@ class ServiceAPIDescription(Model): self._pub_api_path = pub_api_path self._ccf_id = ccf_id self._api_prov_name = api_prov_name + self._net_slice_info = net_slice_info @classmethod def from_dict(cls, dikt) -> 'ServiceAPIDescription': @@ -102,7 +110,7 @@ class ServiceAPIDescription(Model): def api_name(self) -> str: """Gets the api_name of this ServiceAPIDescription. - API name, it is set as {apiName} part of the URI structure as defined in clause 5.2.4 of 3GPP TS 29.122. # noqa: E501 + Contains the API name set to the value of the \"\" placeholder of the API URI as defined in clause 5.2.4 of 3GPP TS 29.122 [14]. # noqa: E501 :return: The api_name of this ServiceAPIDescription. :rtype: str @@ -113,7 +121,7 @@ class ServiceAPIDescription(Model): def api_name(self, api_name: str): """Sets the api_name of this ServiceAPIDescription. - API name, it is set as {apiName} part of the URI structure as defined in clause 5.2.4 of 3GPP TS 29.122. # noqa: E501 + Contains the API name set to the value of the \"\" placeholder of the API URI as defined in clause 5.2.4 of 3GPP TS 29.122 [14]. # noqa: E501 :param api_name: The api_name of this ServiceAPIDescription. :type api_name: str @@ -375,3 +383,28 @@ class ServiceAPIDescription(Model): """ self._api_prov_name = api_prov_name + + @property + def net_slice_info(self) -> List[NetSliceId]: + """Gets the net_slice_info of this ServiceAPIDescription. + + Represents the applicable network slice identifiers. # noqa: E501 + + :return: The net_slice_info of this ServiceAPIDescription. + :rtype: List[NetSliceId] + """ + return self._net_slice_info + + @net_slice_info.setter + def net_slice_info(self, net_slice_info: List[NetSliceId]): + """Sets the net_slice_info of this ServiceAPIDescription. + + Represents the applicable network slice identifiers. # noqa: E501 + + :param net_slice_info: The net_slice_info of this ServiceAPIDescription. + :type net_slice_info: List[NetSliceId] + """ + if net_slice_info is not None and len(net_slice_info) < 1: + raise ValueError("Invalid value for `net_slice_info`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._net_slice_info = net_slice_info diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/shareable_information.py b/services/TS29222_CAPIF_Events_API/capif_events/models/shareable_information.py index c67425be677121c321cc247a168b860784bd40f4..5f4f42dd99e3b1fc3e52d9487997d96c13c8ff22 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/models/shareable_information.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/shareable_information.py @@ -47,7 +47,7 @@ class ShareableInformation(Model): def is_shareable(self) -> bool: """Gets the is_shareable of this ShareableInformation. - Set to \"true\" indicates that the service API and/or the service API category can be shared to the list of CAPIF provider domain information. Otherwise set to \"false\". # noqa: E501 + Indicates whether the service API and/or the service API category can be shared to the list of CAPIF provider domain information. true indicates that the service API and/or the service API category can be shared to the list of CAPIF provider domain information. false indicates that the service API and/or the service API category can not be shared to the list of CAPIF provider domain information. # noqa: E501 :return: The is_shareable of this ShareableInformation. :rtype: bool @@ -58,7 +58,7 @@ class ShareableInformation(Model): def is_shareable(self, is_shareable: bool): """Sets the is_shareable of this ShareableInformation. - Set to \"true\" indicates that the service API and/or the service API category can be shared to the list of CAPIF provider domain information. Otherwise set to \"false\". # noqa: E501 + Indicates whether the service API and/or the service API category can be shared to the list of CAPIF provider domain information. true indicates that the service API and/or the service API category can be shared to the list of CAPIF provider domain information. false indicates that the service API and/or the service API category can not be shared to the list of CAPIF provider domain information. # noqa: E501 :param is_shareable: The is_shareable of this ShareableInformation. :type is_shareable: bool diff --git a/services/TS29222_CAPIF_Events_API/capif_events/models/snssai.py b/services/TS29222_CAPIF_Events_API/capif_events/models/snssai.py new file mode 100644 index 0000000000000000000000000000000000000000..4cf7eb350af8201d9a8481f7bfd8e10418b32133 --- /dev/null +++ b/services/TS29222_CAPIF_Events_API/capif_events/models/snssai.py @@ -0,0 +1,99 @@ +import re # noqa: E501 +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from capif_events import util +from capif_events.models.base_model import Model + + +class Snssai(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, sst=None, sd=None): # noqa: E501 + """Snssai - a model defined in OpenAPI + + :param sst: The sst of this Snssai. # noqa: E501 + :type sst: int + :param sd: The sd of this Snssai. # noqa: E501 + :type sd: str + """ + self.openapi_types = { + 'sst': int, + 'sd': str + } + + self.attribute_map = { + 'sst': 'sst', + 'sd': 'sd' + } + + self._sst = sst + self._sd = sd + + @classmethod + def from_dict(cls, dikt) -> 'Snssai': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The Snssai of this Snssai. # noqa: E501 + :rtype: Snssai + """ + return util.deserialize_model(dikt, cls) + + @property + def sst(self) -> int: + """Gets the sst of this Snssai. + + Unsigned integer, within the range 0 to 255, representing the Slice/Service Type. It indicates the expected Network Slice behaviour in terms of features and services. Values 0 to 127 correspond to the standardized SST range. Values 128 to 255 correspond to the Operator-specific range. See clause 28.4.2 of 3GPP TS 23.003. Standardized values are defined in clause 5.15.2.2 of 3GPP TS 23.501. # noqa: E501 + + :return: The sst of this Snssai. + :rtype: int + """ + return self._sst + + @sst.setter + def sst(self, sst: int): + """Sets the sst of this Snssai. + + Unsigned integer, within the range 0 to 255, representing the Slice/Service Type. It indicates the expected Network Slice behaviour in terms of features and services. Values 0 to 127 correspond to the standardized SST range. Values 128 to 255 correspond to the Operator-specific range. See clause 28.4.2 of 3GPP TS 23.003. Standardized values are defined in clause 5.15.2.2 of 3GPP TS 23.501. # noqa: E501 + + :param sst: The sst of this Snssai. + :type sst: int + """ + if sst is None: + raise ValueError("Invalid value for `sst`, must not be `None`") # noqa: E501 + if sst is not None and sst > 255: # noqa: E501 + raise ValueError("Invalid value for `sst`, must be a value less than or equal to `255`") # noqa: E501 + if sst is not None and sst < 0: # noqa: E501 + raise ValueError("Invalid value for `sst`, must be a value greater than or equal to `0`") # noqa: E501 + + self._sst = sst + + @property + def sd(self) -> str: + """Gets the sd of this Snssai. + + 3-octet string, representing the Slice Differentiator, in hexadecimal representation. Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent 4 bits. The most significant character representing the 4 most significant bits of the SD shall appear first in the string, and the character representing the 4 least significant bit of the SD shall appear last in the string. This is an optional parameter that complements the Slice/Service type(s) to allow to differentiate amongst multiple Network Slices of the same Slice/Service type. This IE shall be absent if no SD value is associated with the SST. # noqa: E501 + + :return: The sd of this Snssai. + :rtype: str + """ + return self._sd + + @sd.setter + def sd(self, sd: str): + """Sets the sd of this Snssai. + + 3-octet string, representing the Slice Differentiator, in hexadecimal representation. Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent 4 bits. The most significant character representing the 4 most significant bits of the SD shall appear first in the string, and the character representing the 4 least significant bit of the SD shall appear last in the string. This is an optional parameter that complements the Slice/Service type(s) to allow to differentiate amongst multiple Network Slices of the same Slice/Service type. This IE shall be absent if no SD value is associated with the SST. # noqa: E501 + + :param sd: The sd of this Snssai. + :type sd: str + """ + if sd is not None and not re.search(r'^[A-Fa-f0-9]{6}$', sd): # noqa: E501 + raise ValueError(r"Invalid value for `sd`, must be a follow pattern or equal to `/^[A-Fa-f0-9]{6}$/`") # noqa: E501 + + self._sd = sd diff --git a/services/TS29222_CAPIF_Events_API/capif_events/openapi/openapi.yaml b/services/TS29222_CAPIF_Events_API/capif_events/openapi/openapi.yaml index cdf36c3621008b2005c103e0214565e06b7ceb65..94874755e42eb5a551ba9fe28516ca0e385a0575 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/openapi/openapi.yaml +++ b/services/TS29222_CAPIF_Events_API/capif_events/openapi/openapi.yaml @@ -1,11 +1,11 @@ openapi: 3.0.0 info: - description: "API for event subscription management. \n© 2024, 3GPP Organizational\ + description: "API for event subscription management. \n© 2025, 3GPP Organizational\ \ Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). \nAll rights reserved.\n" title: CAPIF_Events_API - version: 1.3.0 + version: 1.4.0-alpha.3 externalDocs: - description: 3GPP TS 29.222 V18.6.0 Common API Framework for 3GPP Northbound APIs + description: 3GPP TS 29.222 V19.4.0 Common API Framework for 3GPP Northbound APIs url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.222/ servers: - url: "{apiRoot}/capif-events/v1" @@ -29,7 +29,7 @@ paths: required: true responses: "204": - description: No Content (successful notification) + description: No Content (successful notification). "307": description: Temporary Redirect headers: @@ -109,8 +109,7 @@ paths: default: description: Generic Error x-callback-request: true - description: Creates a new individual CAPIF Event Subscription. - operationId: subscriber_id_subscriptions_post + operationId: create_event_subsc parameters: - description: Identifier of the Subscriber explode: false @@ -132,11 +131,11 @@ paths: application/json: schema: $ref: '#/components/schemas/EventSubscription' - description: Created (Successful creation of subscription) + description: Created (Successful creation of subscription). headers: Location: description: | - Contains the URI of the newly created resource, according to the structure {apiRoot}/capif-events/v1/{subscriberId}/subscriptions/{subscriptionId} + Contains the URI of the newly created resource, according to the structure. explode: false required: true schema: @@ -204,11 +203,13 @@ paths: description: Service Unavailable default: description: Generic Error - x-openapi-router-controller: capif_events.controllers.default_controller + summary: Create a new CAPIFs Event Subscription. + tags: + - CAPIFs Events Subscriptions (Collection) + x-openapi-router-controller: capif_events.controllers.capifs_events_subscriptions_collection_controller /{subscriberId}/subscriptions/{subscriptionId}: delete: - description: Deletes an individual CAPIF Event Subscription. - operationId: subscriber_id_subscriptions_subscription_id_delete + operationId: delete_ind_event_subsc parameters: - description: Identifier of the Subscriber explode: false @@ -229,7 +230,7 @@ paths: responses: "204": description: | - The individual CAPIF Events Subscription matching the subscriptionId is deleted. + No Content. The Individual CAPIF Events Subscription resource is successfully deleted. "307": description: Temporary Redirect headers: @@ -290,10 +291,12 @@ paths: description: Service Unavailable default: description: Generic Error - x-openapi-router-controller: capif_events.controllers.default_controller + summary: Delete an existing Individual CAPIF Events Subscription resource. + tags: + - Individual CAPIFs Events Subscription (Document) + x-openapi-router-controller: capif_events.controllers.individual_capifs_events_subscription_document_controller patch: - description: Modification of an existing individual CAPIF Event Subscription. - operationId: subscriber_id_subscriptions_subscription_id_patch + operationId: modify_ind_event_subsc parameters: - description: Identifier of the Subscriber explode: false @@ -323,9 +326,25 @@ paths: application/json: schema: $ref: '#/components/schemas/EventSubscription' - description: OK (Successful update of the subscription) + description: OK (Successful modification of the subscription). "204": - description: No Content + description: No Content (Successful modification of the subscription). + "307": + description: Temporary Redirect + headers: + Location: + description: An alternative URI of the resource. + required: true + schema: + type: string + "308": + description: Permanent Redirect + headers: + Location: + description: An alternative URI of the resource. + required: true + schema: + type: string "400": content: application/problem+json: @@ -388,10 +407,12 @@ paths: description: Service Unavailable default: description: Generic Error - x-openapi-router-controller: capif_events.controllers.default_controller + summary: Modify an existing Individual CAPIF Events Subscription resource. + tags: + - Individual CAPIFs Events Subscription (Document) + x-openapi-router-controller: capif_events.controllers.individual_capifs_events_subscription_document_controller put: - description: Update of an existing individual CAPIF Event Subscription. - operationId: subscriber_id_subscriptions_subscription_id_put + operationId: update_ind_event_subsc parameters: - description: Identifier of the Subscriber explode: false @@ -423,7 +444,23 @@ paths: $ref: '#/components/schemas/EventSubscription' description: OK (Successful update of the subscription). "204": - description: No Content + description: No Content. (Successful update of the subscription). + "307": + description: Temporary Redirect + headers: + Location: + description: An alternative URI of the resource. + required: true + schema: + type: string + "308": + description: Permanent Redirect + headers: + Location: + description: An alternative URI of the resource. + required: true + schema: + type: string "400": content: application/problem+json: @@ -486,7 +523,10 @@ paths: description: Service Unavailable default: description: Generic Error - x-openapi-router-controller: capif_events.controllers.default_controller + summary: Update an existing Individual CAPIF Events Subscription resource. + tags: + - Individual CAPIFs Events Subscription (Document) + x-openapi-router-controller: capif_events.controllers.individual_capifs_events_subscription_document_controller components: responses: "400": @@ -569,7 +609,7 @@ components: type: string schemas: EventSubscription: - description: Represents an individual CAPIF Event Subscription resource. + description: Represents a CAPIF Events Subscription. example: notificationDestination: notificationDestination eventFilters: @@ -619,14 +659,14 @@ components: requestTestNotification: true properties: events: - description: Subscribed events + description: Subscribed events. items: $ref: '#/components/schemas/CAPIFEvent' minItems: 1 title: events type: array eventFilters: - description: Subscribed event filters + description: Subscribed event filters. items: $ref: '#/components/schemas/CAPIFEventFilter' minItems: 1 @@ -657,10 +697,68 @@ components: title: EventSubscription type: object EventNotification: - description: Represents an individual CAPIF Event notification. + description: Represents a CAPIF Events Notification. example: subscriptionId: subscriptionId eventDetail: + onboardingCriteria: + - relatedCriteria: + aefIds: + - aefIds + - aefIds + apis: + - apiName: apiName + supportedApiVersions: + - supportedApiVersions + - supportedApiVersions + - apiName: apiName + supportedApiVersions: + - supportedApiVersions + - supportedApiVersions + serviceAPICategories: + - serviceAPICategories + - serviceAPICategories + secMethods: + - null + - null + - relatedCriteria: + aefIds: + - aefIds + - aefIds + apis: + - apiName: apiName + supportedApiVersions: + - supportedApiVersions + - supportedApiVersions + - apiName: apiName + supportedApiVersions: + - supportedApiVersions + - supportedApiVersions + serviceAPICategories: + - serviceAPICategories + - serviceAPICategories + secMethods: + - null + - null + discoveryCount: + - discoveryReqCount: + - 1 + - 1 + discoveryRspCount: + - 1 + - 1 + apiIds: + - apiIds + - apiIds + - discoveryReqCount: + - 1 + - 1 + discoveryRspCount: + - 1 + - 1 + apiIds: + - apiIds + - apiIds apiInvokerIds: - apiInvokerIds - apiInvokerIds @@ -691,6 +789,12 @@ components: result: result protocol: null apiVersion: apiVersion + netSliceInfo: + ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId destInterface: ipv6Addr: ipv6Addr grantTypes: @@ -728,6 +832,12 @@ components: result: result protocol: null apiVersion: apiVersion + netSliceInfo: + ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId destInterface: ipv6Addr: ipv6Addr grantTypes: @@ -769,6 +879,12 @@ components: result: result protocol: null apiVersion: apiVersion + netSliceInfo: + ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId destInterface: ipv6Addr: ipv6Addr grantTypes: @@ -806,6 +922,12 @@ components: result: result protocol: null apiVersion: apiVersion + netSliceInfo: + ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId destInterface: ipv6Addr: ipv6Addr grantTypes: @@ -1270,43 +1392,59 @@ components: end: 198.51.100.1 - start: 198.51.100.1 end: 198.51.100.1 + onboardedCount: + - count: 7 + apiId: apiId + - count: 7 + apiId: apiId accCtrlPolList: apiInvokerPolicies: - apiInvokerId: apiInvokerId - allowedTotalInvocations: 9 + allowedTotalInvocations: 3 + netSliceInfo: + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId allowedInvocationTimeRangeList: - startTime: 2000-01-23T04:56:07.000+00:00 stopTime: 2000-01-23T04:56:07.000+00:00 - startTime: 2000-01-23T04:56:07.000+00:00 stopTime: 2000-01-23T04:56:07.000+00:00 - allowedInvocationsPerSecond: 3 + allowedInvocationsPerSecond: 2 - apiInvokerId: apiInvokerId - allowedTotalInvocations: 9 + allowedTotalInvocations: 3 + netSliceInfo: + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId allowedInvocationTimeRangeList: - startTime: 2000-01-23T04:56:07.000+00:00 stopTime: 2000-01-23T04:56:07.000+00:00 - startTime: 2000-01-23T04:56:07.000+00:00 stopTime: 2000-01-23T04:56:07.000+00:00 - allowedInvocationsPerSecond: 3 + allowedInvocationsPerSecond: 2 apiId: apiId serviceAPIDescriptions: - serviceAPICategory: serviceAPICategory ccfId: ccfId apiName: apiName - shareableInfo: - capifProvDoms: - - capifProvDoms - - capifProvDoms - isShareable: true apiProvName: apiProvName supportedFeatures: supportedFeatures description: description - apiSuppFeats: apiSuppFeats - apiId: apiId - apiStatus: - aefIds: - - aefIds - - aefIds aefProfiles: - protocol: HTTP_1_1 grantTypes: @@ -1732,27 +1870,38 @@ components: availability: 0 maxReqRate: 0 avalGraComp: avalGraComp - pubApiPath: - ccfIds: - - ccfIds - - ccfIds - - serviceAPICategory: serviceAPICategory - ccfId: ccfId - apiName: apiName shareableInfo: capifProvDoms: - capifProvDoms - capifProvDoms isShareable: true - apiProvName: apiProvName - supportedFeatures: supportedFeatures - description: description + netSliceInfo: + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId apiSuppFeats: apiSuppFeats apiId: apiId apiStatus: aefIds: - aefIds - aefIds + pubApiPath: + ccfIds: + - ccfIds + - ccfIds + - serviceAPICategory: serviceAPICategory + ccfId: ccfId + apiName: apiName + apiProvName: apiProvName + supportedFeatures: supportedFeatures + description: description aefProfiles: - protocol: HTTP_1_1 grantTypes: @@ -2178,6 +2327,28 @@ components: availability: 0 maxReqRate: 0 avalGraComp: avalGraComp + shareableInfo: + capifProvDoms: + - capifProvDoms + - capifProvDoms + isShareable: true + netSliceInfo: + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + apiSuppFeats: apiSuppFeats + apiId: apiId + apiStatus: + aefIds: + - aefIds + - aefIds pubApiPath: ccfIds: - ccfIds @@ -2189,7 +2360,7 @@ components: properties: subscriptionId: description: | - Identifier of the subscription resource to which the notification is related – CAPIF resource identifier + Identifier of the subscription resource to which the notification is related. title: subscriptionId type: string events: @@ -2215,21 +2386,21 @@ components: - apiIds properties: apiIds: - description: Identifier of the service API + description: Identifier of the service API. items: type: string minItems: 1 title: apiIds type: array apiInvokerIds: - description: Identity of the API invoker + description: Identity of the API invoker. items: type: string minItems: 1 title: apiInvokerIds type: array aefIds: - description: Identifier of the API exposing function + description: Identifier of the API exposing function. items: type: string minItems: 1 @@ -2238,8 +2409,66 @@ components: title: CAPIFEventFilter type: object CAPIFEventDetail: - description: Represents a CAPIF event details. + description: Represents the CAPIF event related details. example: + onboardingCriteria: + - relatedCriteria: + aefIds: + - aefIds + - aefIds + apis: + - apiName: apiName + supportedApiVersions: + - supportedApiVersions + - supportedApiVersions + - apiName: apiName + supportedApiVersions: + - supportedApiVersions + - supportedApiVersions + serviceAPICategories: + - serviceAPICategories + - serviceAPICategories + secMethods: + - null + - null + - relatedCriteria: + aefIds: + - aefIds + - aefIds + apis: + - apiName: apiName + supportedApiVersions: + - supportedApiVersions + - supportedApiVersions + - apiName: apiName + supportedApiVersions: + - supportedApiVersions + - supportedApiVersions + serviceAPICategories: + - serviceAPICategories + - serviceAPICategories + secMethods: + - null + - null + discoveryCount: + - discoveryReqCount: + - 1 + - 1 + discoveryRspCount: + - 1 + - 1 + apiIds: + - apiIds + - apiIds + - discoveryReqCount: + - 1 + - 1 + discoveryRspCount: + - 1 + - 1 + apiIds: + - apiIds + - apiIds apiInvokerIds: - apiInvokerIds - apiInvokerIds @@ -2270,6 +2499,12 @@ components: result: result protocol: null apiVersion: apiVersion + netSliceInfo: + ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId destInterface: ipv6Addr: ipv6Addr grantTypes: @@ -2307,6 +2542,12 @@ components: result: result protocol: null apiVersion: apiVersion + netSliceInfo: + ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId destInterface: ipv6Addr: ipv6Addr grantTypes: @@ -2348,6 +2589,12 @@ components: result: result protocol: null apiVersion: apiVersion + netSliceInfo: + ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId destInterface: ipv6Addr: ipv6Addr grantTypes: @@ -2385,6 +2632,12 @@ components: result: result protocol: null apiVersion: apiVersion + netSliceInfo: + ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId destInterface: ipv6Addr: ipv6Addr grantTypes: @@ -2849,43 +3102,59 @@ components: end: 198.51.100.1 - start: 198.51.100.1 end: 198.51.100.1 + onboardedCount: + - count: 7 + apiId: apiId + - count: 7 + apiId: apiId accCtrlPolList: apiInvokerPolicies: - apiInvokerId: apiInvokerId - allowedTotalInvocations: 9 + allowedTotalInvocations: 3 + netSliceInfo: + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId allowedInvocationTimeRangeList: - startTime: 2000-01-23T04:56:07.000+00:00 stopTime: 2000-01-23T04:56:07.000+00:00 - startTime: 2000-01-23T04:56:07.000+00:00 stopTime: 2000-01-23T04:56:07.000+00:00 - allowedInvocationsPerSecond: 3 + allowedInvocationsPerSecond: 2 - apiInvokerId: apiInvokerId - allowedTotalInvocations: 9 + allowedTotalInvocations: 3 + netSliceInfo: + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId allowedInvocationTimeRangeList: - startTime: 2000-01-23T04:56:07.000+00:00 stopTime: 2000-01-23T04:56:07.000+00:00 - startTime: 2000-01-23T04:56:07.000+00:00 stopTime: 2000-01-23T04:56:07.000+00:00 - allowedInvocationsPerSecond: 3 + allowedInvocationsPerSecond: 2 apiId: apiId serviceAPIDescriptions: - serviceAPICategory: serviceAPICategory ccfId: ccfId apiName: apiName - shareableInfo: - capifProvDoms: - - capifProvDoms - - capifProvDoms - isShareable: true apiProvName: apiProvName supportedFeatures: supportedFeatures description: description - apiSuppFeats: apiSuppFeats - apiId: apiId - apiStatus: - aefIds: - - aefIds - - aefIds aefProfiles: - protocol: HTTP_1_1 grantTypes: @@ -3311,27 +3580,38 @@ components: availability: 0 maxReqRate: 0 avalGraComp: avalGraComp - pubApiPath: - ccfIds: - - ccfIds - - ccfIds - - serviceAPICategory: serviceAPICategory - ccfId: ccfId - apiName: apiName shareableInfo: capifProvDoms: - capifProvDoms - capifProvDoms isShareable: true - apiProvName: apiProvName - supportedFeatures: supportedFeatures - description: description + netSliceInfo: + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId apiSuppFeats: apiSuppFeats apiId: apiId apiStatus: aefIds: - aefIds - aefIds + pubApiPath: + ccfIds: + - ccfIds + - ccfIds + - serviceAPICategory: serviceAPICategory + ccfId: ccfId + apiName: apiName + apiProvName: apiProvName + supportedFeatures: supportedFeatures + description: description aefProfiles: - protocol: HTTP_1_1 grantTypes: @@ -3757,6 +4037,28 @@ components: availability: 0 maxReqRate: 0 avalGraComp: avalGraComp + shareableInfo: + capifProvDoms: + - capifProvDoms + - capifProvDoms + isShareable: true + netSliceInfo: + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + apiSuppFeats: apiSuppFeats + apiId: apiId + apiStatus: + aefIds: + - aefIds + - aefIds pubApiPath: ccfIds: - ccfIds @@ -3773,14 +4075,14 @@ components: title: serviceAPIDescriptions type: array apiIds: - description: Identifier of the service API + description: Identifier of the service API. items: type: string minItems: 1 title: apiIds type: array apiInvokerIds: - description: Identity of the API invoker + description: Identity of the API invoker. items: type: string minItems: 1 @@ -3797,6 +4099,24 @@ components: type: array apiTopoHide: $ref: '#/components/schemas/TopologyHiding' + onboardingCriteria: + items: + $ref: '#/components/schemas/OnboardingCriteria' + minItems: 1 + title: onboardingCriteria + type: array + onboardedCount: + items: + $ref: '#/components/schemas/ApiInvokerCount' + minItems: 1 + title: onboardedCount + type: array + discoveryCount: + items: + $ref: '#/components/schemas/DiscoveryCount' + minItems: 1 + title: discoveryCount + type: array title: CAPIFEventDetail type: object AccessControlPolicyListExt: @@ -3810,21 +4130,43 @@ components: example: apiInvokerPolicies: - apiInvokerId: apiInvokerId - allowedTotalInvocations: 9 + allowedTotalInvocations: 3 + netSliceInfo: + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId allowedInvocationTimeRangeList: - startTime: 2000-01-23T04:56:07.000+00:00 stopTime: 2000-01-23T04:56:07.000+00:00 - startTime: 2000-01-23T04:56:07.000+00:00 stopTime: 2000-01-23T04:56:07.000+00:00 - allowedInvocationsPerSecond: 3 + allowedInvocationsPerSecond: 2 - apiInvokerId: apiInvokerId - allowedTotalInvocations: 9 + allowedTotalInvocations: 3 + netSliceInfo: + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId allowedInvocationTimeRangeList: - startTime: 2000-01-23T04:56:07.000+00:00 stopTime: 2000-01-23T04:56:07.000+00:00 - startTime: 2000-01-23T04:56:07.000+00:00 stopTime: 2000-01-23T04:56:07.000+00:00 - allowedInvocationsPerSecond: 3 + allowedInvocationsPerSecond: 2 apiId: apiId required: - apiId @@ -4297,17 +4639,17 @@ components: type: object EventSubscriptionPatch: description: | - Represents the parameters to request the updated of an individual CAPIF Event Subscription resource. + Represents the parameters to request the modification of a CAPIF Events Subscription resource. properties: events: - description: Subscribed events + description: Subscribed events. items: $ref: '#/components/schemas/CAPIFEvent' minItems: 1 title: events type: array eventFilters: - description: Subscribed event filters + description: Subscribed event filters. items: $ref: '#/components/schemas/CAPIFEventFilter' minItems: 1 @@ -4321,6 +4663,64 @@ components: type: string title: EventSubscriptionPatch type: object + ApiInvokerCount: + description: Represents the count data for onboarding. + example: + count: 7 + apiId: apiId + properties: + apiId: + title: apiId + type: string + count: + description: | + Contains the number of times the API Invokers requested to onboard the service API(s) API. + title: count + type: integer + required: + - apiId + - count + title: ApiInvokerCount + type: object + DiscoveryCount: + anyOf: + - required: ["discoveryReqCount"] + - required: ["discoveryRspCount"] + description: Represents the count data for discovery. + example: + discoveryReqCount: + - 1 + - 1 + discoveryRspCount: + - 1 + - 1 + apiIds: + - apiIds + - apiIds + nullable: true + properties: + apiIds: + items: + type: string + minItems: 1 + title: apiIds + type: array + discoveryReqCount: + items: + type: integer + minItems: 1 + title: discoveryReqCount + type: array + discoveryRspCount: + items: + type: integer + minItems: 1 + title: discoveryRspCount + type: array + required: + - apiIds + title: DiscoveryCount + type: object CAPIFEvent: enum: - SERVICE_API_AVAILABLE @@ -4336,6 +4736,9 @@ components: - API_INVOKER_UPDATED - API_TOPOLOGY_HIDING_CREATED - API_TOPOLOGY_HIDING_REVOKED + - API_INVOKER_ONBOARDING_CRITERIA_FAILED + - SERVICE_API_ONBOARDED_BY_API_INVOKERS_COUNT + - SERVICE_API_DISCOVERY_BY_API_INVOKERS_COUNT type: string description: "Describes the CAPIF event. \nPossible values are:\n- SERVICE_API_AVAILABLE:\n\ \ Events related to the availability of service APIs after the service APIs\ @@ -4356,7 +4759,12 @@ components: \ information of the service APIs after the service APIs are published.\n\ - API_TOPOLOGY_HIDING_REVOKED:\n Events related to the revocation of the\ \ API topology hiding information of\n the service APIs after the service\ - \ APIs are unpublished.\n" + \ APIs are unpublished.\n- API_INVOKER_ONBOARDING_CRITERIA_FAILED: Events\ + \ related to API Invoker onboarding criteria\n failed to be met. \n- SERVICE_API_ONBOARDED_BY_API_INVOKERS_COUNT:\ + \ Periodic event related to the number of times the\n API Invokers requested\ + \ to onboard the targeted service API(s).\n- SERVICE_API_DISCOVERY_BY_API_INVOKERS_COUNT:\ + \ Periodic event related to the number of times the\n API Invokers discovered\ + \ the targeted service API(s).\n" title: CAPIFEvent ProblemDetails: description: Represents additional information and details on an error response. @@ -4530,20 +4938,9 @@ components: serviceAPICategory: serviceAPICategory ccfId: ccfId apiName: apiName - shareableInfo: - capifProvDoms: - - capifProvDoms - - capifProvDoms - isShareable: true apiProvName: apiProvName supportedFeatures: supportedFeatures description: description - apiSuppFeats: apiSuppFeats - apiId: apiId - apiStatus: - aefIds: - - aefIds - - aefIds aefProfiles: - protocol: HTTP_1_1 grantTypes: @@ -4969,6 +5366,28 @@ components: availability: 0 maxReqRate: 0 avalGraComp: avalGraComp + shareableInfo: + capifProvDoms: + - capifProvDoms + - capifProvDoms + isShareable: true + netSliceInfo: + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + apiSuppFeats: apiSuppFeats + apiId: apiId + apiStatus: + aefIds: + - aefIds + - aefIds pubApiPath: ccfIds: - ccfIds @@ -4976,7 +5395,7 @@ components: properties: apiName: description: | - API name, it is set as {apiName} part of the URI structure as defined in clause 5.2.4 of 3GPP TS 29.122. + Contains the API name set to the value of the "" placeholder of the API URI as defined in clause 5.2.4 of 3GPP TS 29.122 [14]. title: apiName type: string apiId: @@ -5026,6 +5445,13 @@ components: description: Represents the API provider name. title: apiProvName type: string + netSliceInfo: + description: Represents the applicable network slice identifiers. + items: + $ref: '#/components/schemas/NetSliceId' + minItems: 1 + title: netSliceInfo + type: array required: - apiName title: ServiceAPIDescription @@ -5039,8 +5465,9 @@ components: - aefIds properties: aefIds: - description: | - Indicates the list of AEF ID(s) where the API is active. If this attribute is omitted, the API is inactive at all AEF(s) defined in the "aefProfiles" attribute within the ServiceAPIDescription data structure. + description: "Indicates the list of AEF ID(s) where the API is active. If\ + \ an empty array is provided, it indicates that the API is inactive in\ + \ all AEF(s). \n" items: type: string title: aefIds @@ -5265,7 +5692,7 @@ components: maxReqRate: 0 avalGraComp: avalGraComp nullable: true - oneOf: + oneOf: - required: ["domainName"] - required: ["interfaceDescriptions"] - {} @@ -5752,7 +6179,7 @@ components: title: ServiceKpis type: object IpAddrRange: - anyOf: + anyOf: - required: ["ueIpv4AddrRanges"] - required: ["ueIpv6AddrRanges"] description: Represents the list of public IP ranges @@ -5796,7 +6223,7 @@ components: properties: isShareable: description: | - Set to "true" indicates that the service API and/or the service API category can be shared to the list of CAPIF provider domain information. Otherwise set to "false". + Indicates whether the service API and/or the service API category can be shared to the list of CAPIF provider domain information. true indicates that the service API and/or the service API category can be shared to the list of CAPIF provider domain information. false indicates that the service API and/or the service API category can not be shared to the list of CAPIF provider domain information. title: isShareable type: boolean capifProvDoms: @@ -5859,6 +6286,12 @@ components: result: result protocol: null apiVersion: apiVersion + netSliceInfo: + ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId destInterface: ipv6Addr: ipv6Addr grantTypes: @@ -5896,6 +6329,12 @@ components: result: result protocol: null apiVersion: apiVersion + netSliceInfo: + ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId destInterface: ipv6Addr: ipv6Addr grantTypes: @@ -5965,6 +6404,12 @@ components: result: result protocol: null apiVersion: apiVersion + netSliceInfo: + ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId destInterface: ipv6Addr: ipv6Addr grantTypes: @@ -5987,7 +6432,7 @@ components: type: string apiName: description: | - Name of the API which was invoked, it is set as {apiName} part of the URI structure as defined in clause 5.2.4 of 3GPP TS 29.122. + Contains the invoked API name set to the value of the "" placeholder of the API URI as defined in clause 5.2.4 of 3GPP TS 29.122 [14]. title: apiName type: string apiVersion: @@ -6037,6 +6482,8 @@ components: It includes the node identifier (as defined in IETF RFC 7239 of all forwarding entities between the API invoker and the AEF, concatenated with comma and space, e.g. 192.0.2.43:80, unknown:_OBFport, 203.0.113.60 title: fwdInterface type: string + netSliceInfo: + $ref: '#/components/schemas/NetSliceId' required: - apiId - apiName @@ -6051,6 +6498,108 @@ components: minimum: 0 title: DurationMs type: integer + OnboardingCriteria: + description: Represents the onboarding criteria information. + example: + relatedCriteria: + aefIds: + - aefIds + - aefIds + apis: + - apiName: apiName + supportedApiVersions: + - supportedApiVersions + - supportedApiVersions + - apiName: apiName + supportedApiVersions: + - supportedApiVersions + - supportedApiVersions + serviceAPICategories: + - serviceAPICategories + - serviceAPICategories + secMethods: + - null + - null + properties: + secMethods: + items: + $ref: '#/components/schemas/SecurityMethod' + minItems: 1 + title: secMethods + type: array + relatedCriteria: + $ref: '#/components/schemas/RelatedCriteria' + required: + - secMethods + title: OnboardingCriteria + type: object + RelatedCriteria: + anyOf: + - required: ["aefIds"] + - required: ["apis"] + - required: ["serviceAPICategories"] + not: + required: [apis, serviceAPICategories] + description: Represents onboarding related criteria. + example: + aefIds: + - aefIds + - aefIds + apis: + - apiName: apiName + supportedApiVersions: + - supportedApiVersions + - supportedApiVersions + - apiName: apiName + supportedApiVersions: + - supportedApiVersions + - supportedApiVersions + serviceAPICategories: + - serviceAPICategories + - serviceAPICategories + nullable: true + properties: + aefIds: + items: + type: string + minItems: 1 + title: aefIds + type: array + apis: + items: + $ref: '#/components/schemas/ApiInfo' + minItems: 1 + title: apis + type: array + serviceAPICategories: + items: + type: string + minItems: 1 + title: serviceAPICategories + type: array + title: RelatedCriteria + type: object + ApiInfo: + description: Represents service API identification related information. + example: + apiName: apiName + supportedApiVersions: + - supportedApiVersions + - supportedApiVersions + properties: + apiName: + title: apiName + type: string + supportedApiVersions: + items: + type: string + minItems: 1 + title: supportedApiVersions + type: array + required: + - apiName + title: ApiInfo + type: object AccessControlPolicyList: description: Represents the access control policy list for a published service API. @@ -6068,13 +6617,24 @@ components: description: Represents the policy of an API Invoker. example: apiInvokerId: apiInvokerId - allowedTotalInvocations: 9 + allowedTotalInvocations: 3 + netSliceInfo: + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId allowedInvocationTimeRangeList: - startTime: 2000-01-23T04:56:07.000+00:00 stopTime: 2000-01-23T04:56:07.000+00:00 - startTime: 2000-01-23T04:56:07.000+00:00 stopTime: 2000-01-23T04:56:07.000+00:00 - allowedInvocationsPerSecond: 3 + allowedInvocationsPerSecond: 2 properties: apiInvokerId: description: API invoker ID assigned by the CAPIF core function @@ -6098,6 +6658,12 @@ components: minItems: 0 title: allowedInvocationTimeRangeList type: array + netSliceInfo: + items: + $ref: '#/components/schemas/NetSliceId' + minItems: 1 + title: netSliceInfo + type: array required: - apiInvokerId title: ApiInvokerPolicy @@ -6394,7 +6960,9 @@ components: - ON_EVENT_DETECTION type: string description: "Represents the notification methods that can be subscribed. \n\ - Possible values are:\n- PERIODIC\n- ONE_TIME\n- ON_EVENT_DETECTION\n" + Possible values are:\n- PERIODIC: The notification is periodically sent.\n\ + - ONE_TIME: The notification is only sent one time.\n- ON_EVENT_DETECTION:\ + \ The notification is sent each time the event is detected.\n" title: NotificationMethod Uinteger: description: "Unsigned Integer, i.e. only value 0 and integers above 0 are permissible." @@ -6492,6 +7060,39 @@ components: type: integer title: MutingNotificationsSettings type: object + NetSliceId: + description: | + Represents the network slice identification information. + example: + ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + nullable: true + oneOf: + - required: ["snssai"] + - required: ["nsiId"] + - required: ["ensi"] + properties: + snssai: + $ref: '#/components/schemas/Snssai' + nsiId: + description: Contains the Identifier of the selected Network Slice instance + title: NsiId + type: string + ensi: + description: | + Represents the External Network Slice Information that is used to identify a network slice, as specified in 3GPP TS 33.501. + title: Ensi + type: string + title: NetSliceId + type: object + Ensi: + description: | + Represents the External Network Slice Information that is used to identify a network slice, as specified in 3GPP TS 33.501. + title: Ensi + type: string OAuthGrantType: enum: - CLIENT_CREDENTIALS @@ -7144,6 +7745,38 @@ components: type: string title: Ipv4AddressRange_1 type: object + Snssai: + description: | + When Snssai needs to be converted to string (e.g. when used in maps as key), the string shall be composed of one to three digits "sst" optionally followed by "-" and 6 hexadecimal digits "sd". + example: + sd: sd + sst: 237 + properties: + sst: + description: "Unsigned integer, within the range 0 to 255, representing\ + \ the Slice/Service Type. It indicates the expected Network Slice behaviour\ + \ in terms of features and services. Values 0 to 127 correspond to the\ + \ standardized SST range. Values 128 to 255 correspond to the Operator-specific\ + \ range. See clause 28.4.2 of 3GPP TS 23.003. Standardized values are\ + \ defined in clause 5.15.2.2 of 3GPP TS 23.501. \n" + maximum: 255 + minimum: 0 + title: sst + type: integer + sd: + description: | + 3-octet string, representing the Slice Differentiator, in hexadecimal representation. Each character in the string shall take a value of "0" to "9", "a" to "f" or "A" to "F" and shall represent 4 bits. The most significant character representing the 4 most significant bits of the SD shall appear first in the string, and the character representing the 4 least significant bit of the SD shall appear last in the string. This is an optional parameter that complements the Slice/Service type(s) to allow to differentiate amongst multiple Network Slices of the same Slice/Service type. This IE shall be absent if no SD value is associated with the SST. + pattern: "^[A-Fa-f0-9]{6}$" + title: sd + type: string + required: + - sst + title: Snssai + type: object + NsiId: + description: Contains the Identifier of the selected Network Slice instance + title: NsiId + type: string Float: description: string with format 'float' as defined in OpenAPI. format: float diff --git a/services/TS29222_CAPIF_Events_API/capif_events/test/test_capifs_events_subscriptions_collection_controller.py b/services/TS29222_CAPIF_Events_API/capif_events/test/test_capifs_events_subscriptions_collection_controller.py new file mode 100644 index 0000000000000000000000000000000000000000..d2b6952bbd10fc5f52333e5437d0947ccb3aca9b --- /dev/null +++ b/services/TS29222_CAPIF_Events_API/capif_events/test/test_capifs_events_subscriptions_collection_controller.py @@ -0,0 +1,34 @@ +import unittest + +from capif_events.models.event_subscription import \ + EventSubscription # noqa: E501 +from capif_events.models.problem_details import ProblemDetails # noqa: E501 +from capif_events.test import BaseTestCase +from flask import json + + +class TestCAPIFsEventsSubscriptionsCollectionController(BaseTestCase): + """CAPIFsEventsSubscriptionsCollectionController integration test stubs""" + + def test_create_event_subsc(self): + """Test case for create_event_subsc + + Create a new CAPIFs Event Subscription. + """ + event_subscription = {"notificationDestination":"notificationDestination","eventFilters":[{"aefIds":["aefIds","aefIds"],"apiInvokerIds":["apiInvokerIds","apiInvokerIds"],"apiIds":["apiIds","apiIds"]},{"aefIds":["aefIds","aefIds"],"apiInvokerIds":["apiInvokerIds","apiInvokerIds"],"apiIds":["apiIds","apiIds"]}],"supportedFeatures":"supportedFeatures","eventReq":{"notifMethod":"PERIODIC","partitionCriteria":["TAC","TAC"],"grpRepTime":5,"notifFlag":"ACTIVATE","mutingSetting":{"maxNoOfNotif":5,"durationBufferedNotif":2},"monDur":"2000-01-23T04:56:07.000+00:00","immRep":True,"maxReportNbr":0,"repPeriod":6,"sampRatio":15,"notifFlagInstruct":{"bufferedNotifs":"SEND_ALL","subscription":"CLOSE"}},"websockNotifConfig":{"requestWebsocketUri":True,"websocketUri":"websocketUri"},"events":["SERVICE_API_AVAILABLE","SERVICE_API_AVAILABLE"],"requestTestNotification":True} + headers = { + 'Accept': 'application/json', + 'Content-Type': 'application/json', + } + response = self.client.open( + '/capif-events/v1/{subscriber_id}/subscriptions'.format(subscriber_id='subscriber_id_example'), + method='POST', + headers=headers, + data=json.dumps(event_subscription), + content_type='application/json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + +if __name__ == '__main__': + unittest.main() diff --git a/services/TS29222_CAPIF_Events_API/capif_events/test/test_default_controller.py b/services/TS29222_CAPIF_Events_API/capif_events/test/test_individual_capifs_events_subscription_document_controller.py similarity index 55% rename from services/TS29222_CAPIF_Events_API/capif_events/test/test_default_controller.py rename to services/TS29222_CAPIF_Events_API/capif_events/test/test_individual_capifs_events_subscription_document_controller.py index 79cc892f18610d2b020b24c2076a7eaa84fe1b07..a991bc07dd9cb4e9f551b8d5677f3ebcbe8ba954 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/test/test_default_controller.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/test/test_individual_capifs_events_subscription_document_controller.py @@ -1,38 +1,21 @@ import unittest -from capif_events.models.event_subscription import EventSubscription # noqa: E501 -from capif_events.models.event_subscription_patch import EventSubscriptionPatch # noqa: E501 +from capif_events.models.event_subscription import \ + EventSubscription # noqa: E501 +from capif_events.models.event_subscription_patch import \ + EventSubscriptionPatch # noqa: E501 from capif_events.models.problem_details import ProblemDetails # noqa: E501 from capif_events.test import BaseTestCase from flask import json -class TestDefaultController(BaseTestCase): - """DefaultController integration test stubs""" +class TestIndividualCAPIFsEventsSubscriptionDocumentController(BaseTestCase): + """IndividualCAPIFsEventsSubscriptionDocumentController integration test stubs""" - def test_subscriber_id_subscriptions_post(self): - """Test case for subscriber_id_subscriptions_post + def test_delete_ind_event_subsc(self): + """Test case for delete_ind_event_subsc - - """ - event_subscription = {"notificationDestination":"notificationDestination","eventFilters":[{"aefIds":["aefIds","aefIds"],"apiInvokerIds":["apiInvokerIds","apiInvokerIds"],"apiIds":["apiIds","apiIds"]},{"aefIds":["aefIds","aefIds"],"apiInvokerIds":["apiInvokerIds","apiInvokerIds"],"apiIds":["apiIds","apiIds"]}],"supportedFeatures":"supportedFeatures","eventReq":{"notifMethod":"PERIODIC","partitionCriteria":["TAC","TAC"],"grpRepTime":5,"notifFlag":"ACTIVATE","mutingSetting":{"maxNoOfNotif":5,"durationBufferedNotif":2},"monDur":"2000-01-23T04:56:07.000+00:00","immRep":True,"maxReportNbr":0,"repPeriod":6,"sampRatio":15,"notifFlagInstruct":{"bufferedNotifs":"SEND_ALL","subscription":"CLOSE"}},"websockNotifConfig":{"requestWebsocketUri":True,"websocketUri":"websocketUri"},"events":["SERVICE_API_AVAILABLE","SERVICE_API_AVAILABLE"],"requestTestNotification":True} - headers = { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - } - response = self.client.open( - '/capif-events/v1/{subscriber_id}/subscriptions'.format(subscriber_id='subscriber_id_example'), - method='POST', - headers=headers, - data=json.dumps(event_subscription), - content_type='application/json') - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_subscriber_id_subscriptions_subscription_id_delete(self): - """Test case for subscriber_id_subscriptions_subscription_id_delete - - + Delete an existing Individual CAPIF Events Subscription resource. """ headers = { 'Accept': 'application/problem+json', @@ -44,10 +27,10 @@ class TestDefaultController(BaseTestCase): self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) - def test_subscriber_id_subscriptions_subscription_id_patch(self): - """Test case for subscriber_id_subscriptions_subscription_id_patch + def test_modify_ind_event_subsc(self): + """Test case for modify_ind_event_subsc - + Modify an existing Individual CAPIF Events Subscription resource. """ event_subscription_patch = openapi_server.EventSubscriptionPatch() headers = { @@ -63,10 +46,10 @@ class TestDefaultController(BaseTestCase): self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) - def test_subscriber_id_subscriptions_subscription_id_put(self): - """Test case for subscriber_id_subscriptions_subscription_id_put + def test_update_ind_event_subsc(self): + """Test case for update_ind_event_subsc - + Update an existing Individual CAPIF Events Subscription resource. """ event_subscription = {"notificationDestination":"notificationDestination","eventFilters":[{"aefIds":["aefIds","aefIds"],"apiInvokerIds":["apiInvokerIds","apiInvokerIds"],"apiIds":["apiIds","apiIds"]},{"aefIds":["aefIds","aefIds"],"apiInvokerIds":["apiInvokerIds","apiInvokerIds"],"apiIds":["apiIds","apiIds"]}],"supportedFeatures":"supportedFeatures","eventReq":{"notifMethod":"PERIODIC","partitionCriteria":["TAC","TAC"],"grpRepTime":5,"notifFlag":"ACTIVATE","mutingSetting":{"maxNoOfNotif":5,"durationBufferedNotif":2},"monDur":"2000-01-23T04:56:07.000+00:00","immRep":True,"maxReportNbr":0,"repPeriod":6,"sampRatio":15,"notifFlagInstruct":{"bufferedNotifs":"SEND_ALL","subscription":"CLOSE"}},"websockNotifConfig":{"requestWebsocketUri":True,"websocketUri":"websocketUri"},"events":["SERVICE_API_AVAILABLE","SERVICE_API_AVAILABLE"],"requestTestNotification":True} headers = { diff --git a/services/TS29222_CAPIF_Events_API/capif_events/util.py b/services/TS29222_CAPIF_Events_API/capif_events/util.py index f09cd65c231f3f6b13fed43eb91a7531064382db..128889d9cbf9d20abcb6afc7c9cdf7ca2f50991b 100644 --- a/services/TS29222_CAPIF_Events_API/capif_events/util.py +++ b/services/TS29222_CAPIF_Events_API/capif_events/util.py @@ -56,7 +56,6 @@ def dict_to_camel_case(my_dict): return result - def _deserialize(data, klass): """Deserializes dict, list, str into an object. diff --git a/services/TS29222_CAPIF_Events_API/requirements.txt b/services/TS29222_CAPIF_Events_API/requirements.txt index 1edc40a9b8d68f47e5f55a18401e3657c766a2df..63bfea96c998f567129d10bcd962b078c25b3029 100644 --- a/services/TS29222_CAPIF_Events_API/requirements.txt +++ b/services/TS29222_CAPIF_Events_API/requirements.txt @@ -1,28 +1,28 @@ connexion[flask, swagger-ui, uvicorn] == 3.1.0; python_version>="3.6" swagger-ui-bundle >= 0.0.2 python_dateutil >= 2.6.0 -setuptools == 74.0.0 +setuptools == 80.9.0 Flask == 3.0.3 pymongo == 4.7.3 redis == 4.5.4 flask_jwt_extended == 4.6.0 -cryptography == 42.0.8 +cryptography == 46.0.1 rfc3987 == 1.3.8 -opentelemetry-instrumentation == 0.40b0 -opentelemetry-instrumentation-flask == 0.40b0 -opentelemetry-instrumentation-redis == 0.40b0 -opentelemetry-instrumentation-pymongo == 0.40b0 -opentelemetry-exporter-otlp == 1.19.0 -opentelemetry-exporter-jaeger == 1.19.0 +opentelemetry-instrumentation == 0.41b0 +opentelemetry-instrumentation-flask == 0.41b0 +opentelemetry-instrumentation-redis == 0.41b0 +opentelemetry-instrumentation-pymongo == 0.41b0 +opentelemetry-exporter-otlp == 1.20.0 +opentelemetry-exporter-jaeger == 1.21.0 fluent == 0.10.0 fluent-logger == 0.10.0 -opentelemetry-api == 1.19.0 -opentelemetry-sdk == 1.19.0 +opentelemetry-api == 1.20.0 +opentelemetry-sdk == 1.20.0 flask_executor == 1.0.0 Flask-APScheduler == 1.13.1 aiohttp == 3.10.5 async-timeout == 4.0.3 -werkzeug == 3.0.4 -pyopenssl == 24.2.1 +werkzeug == 3.1.3 +pyopenssl == 25.3.0 gunicorn == 23.0.0 packaging == 24.0 \ No newline at end of file diff --git a/services/TS29222_CAPIF_Events_API/setup.py b/services/TS29222_CAPIF_Events_API/setup.py index f126a701844e3fd9dd10fb8ee0db3159aaf2bbc3..ce8b1eab766195e0c2d751589f431f429c7699af 100644 --- a/services/TS29222_CAPIF_Events_API/setup.py +++ b/services/TS29222_CAPIF_Events_API/setup.py @@ -31,7 +31,7 @@ setup( entry_points={ 'console_scripts': ['capif_events=capif_events.__main__:main']}, long_description="""\ - API for event subscription management. © 2024, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. + API for event subscription management. © 2025, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. """ ) diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/.openapi-generator/FILES b/services/TS29222_CAPIF_Logging_API_Invocation_API/.openapi-generator/FILES index fd69e2e1d1357e821cdd25f0232c8795f078b32b..ee904ed42aa643509eca0caa52582ec1e438c630 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/.openapi-generator/FILES +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/.openapi-generator/FILES @@ -17,11 +17,13 @@ api_invocation_logs/models/interface_description.py api_invocation_logs/models/invalid_param.py api_invocation_logs/models/invocation_log.py api_invocation_logs/models/log.py +api_invocation_logs/models/net_slice_id.py api_invocation_logs/models/o_auth_grant_type.py api_invocation_logs/models/operation.py api_invocation_logs/models/problem_details.py api_invocation_logs/models/protocol.py api_invocation_logs/models/security_method.py +api_invocation_logs/models/snssai.py api_invocation_logs/openapi/openapi.yaml api_invocation_logs/test/__init__.py api_invocation_logs/test/test_default_controller.py diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/app.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/app.py index 56c94af9489f5211e915ddb49601ac294ebe3c44..ad0b6d3b3949d9cb32020d257f4a37ca6f2ddf60 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/app.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/app.py @@ -9,12 +9,14 @@ import encoder from config import Config from fluent import sender from opentelemetry import trace -from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter +from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import \ + OTLPSpanExporter from opentelemetry.instrumentation.flask import FlaskInstrumentor from opentelemetry.sdk.resources import Resource from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import BatchSpanProcessor -from opentelemetry.trace.propagation.tracecontext import TraceContextTextMapPropagator +from opentelemetry.trace.propagation.tracecontext import \ + TraceContextTextMapPropagator NAME = "Logging-Service" diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/controllers/default_controller.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/controllers/default_controller.py index f23e60283788d794ceb6f33cb503bf09705d7291..ce62116b04c912315b62f5b4cd513ba0e50cf1ed 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/controllers/default_controller.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/controllers/default_controller.py @@ -1,8 +1,14 @@ -from api_invocation_logs.models.invocation_log import InvocationLog # noqa: E501 +from functools import wraps + +from api_invocation_logs.models.invocation_log import \ + InvocationLog # noqa: E501 +from api_invocation_logs.models.problem_details import \ + ProblemDetails # noqa: E501 from cryptography import x509 from cryptography.hazmat.backends import default_backend from flask import current_app, request -from functools import wraps + +from ..core.responses import unauthorized_error from ..core.invocationlogs import LoggingInvocationOperations from ..core.validate_user import ControlAccess @@ -18,7 +24,11 @@ def cert_validation(): def __cert_validation(*args, **kwargs): args = request.view_args - cert_tmp = request.headers['X-Ssl-Client-Cert'] + cert_tmp = request.headers.get('X-Ssl-Client-Cert') + + if not cert_tmp: + return unauthorized_error("Client certificate required", "X-Ssl-Client-Cert header is missing") + cert_raw = cert_tmp.replace('\t', '') cert = x509.load_pem_x509_certificate(str.encode(cert_raw), default_backend()) @@ -37,7 +47,6 @@ def cert_validation(): return __cert_validation return _cert_validation - @cert_validation() def aef_id_logs_post(aef_id, body): # noqa: E501 """aef_id_logs_post diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/controllers/security_controller.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/controllers/security_controller.py index 139597f9cb07c5d48bed18984ec4747f4b4f3438..8b137891791fe96927ad78e64b0aad7bded08bdc 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/controllers/security_controller.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/controllers/security_controller.py @@ -1,2 +1 @@ - diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/core/invocationlogs.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/core/invocationlogs.py index 614181d940f8fd192a02a21fbe13f485f6a931dd..df2e312143787e35a4ba1f3034d2d7fb15ea54de 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/core/invocationlogs.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/core/invocationlogs.py @@ -10,7 +10,8 @@ from ..encoder import CustomJSONEncoder from ..util import serialize_clean_camel_case from .redis_event import RedisEvent from .resources import Resource -from .responses import internal_server_error, make_response, not_found_error, unauthorized_error +from .responses import (internal_server_error, make_response, not_found_error, + unauthorized_error) TOTAL_FEATURES = 1 SUPPORTED_FEATURES_HEX = "0" diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/core/responses.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/core/responses.py index 1f0302f64b0ac1791aa594b5b16772343af286b9..8ba055f9295f90258ff39547a9f4af1b22a75a30 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/core/responses.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/core/responses.py @@ -33,7 +33,7 @@ def bad_request_error(detail, cause, invalid_params): prob = ProblemDetails(title="Bad Request", status=400, detail=detail, cause=cause, invalid_params=invalid_params) prob = serialize_clean_camel_case(prob) - return Response(json.dumps(prob, cls=CustomJSONEncoder), status=400, mimetype=cause) + return Response(json.dumps(prob, cls=CustomJSONEncoder), status=400, mimetype=mimetype) def not_found_error(detail, cause): diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/interface_description.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/interface_description.py index 03cb6d5a4e803a6f2ea3ec17f0d4b0aed1dff2e3..be37ab27a04b7ed40c93e8e1b339e2ff1b5ed19c 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/interface_description.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/interface_description.py @@ -4,8 +4,10 @@ from typing import Dict, List # noqa: F401 from api_invocation_logs import util from api_invocation_logs.models.base_model import Model -from api_invocation_logs.models.o_auth_grant_type import OAuthGrantType # noqa: E501 -from api_invocation_logs.models.security_method import SecurityMethod # noqa: E501 +from api_invocation_logs.models.o_auth_grant_type import \ + OAuthGrantType # noqa: E501 +from api_invocation_logs.models.security_method import \ + SecurityMethod # noqa: E501 class InterfaceDescription(Model): diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/log.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/log.py index 84715f3068385d053d9adacd3540245748eb0a9a..8a912ad1dbf33e4e2a614c14275f6bbbfa99aadc 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/log.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/log.py @@ -3,7 +3,9 @@ from typing import Dict, List # noqa: F401 from api_invocation_logs import util from api_invocation_logs.models.base_model import Model -from api_invocation_logs.models.interface_description import InterfaceDescription # noqa: E501 +from api_invocation_logs.models.interface_description import \ + InterfaceDescription # noqa: E501 +from api_invocation_logs.models.net_slice_id import NetSliceId # noqa: E501 from api_invocation_logs.models.operation import Operation # noqa: E501 from api_invocation_logs.models.protocol import Protocol # noqa: E501 @@ -14,7 +16,7 @@ class Log(Model): Do not edit the class manually. """ - def __init__(self, api_id=None, api_name=None, api_version=None, resource_name=None, uri=None, protocol=None, operation=None, result=None, invocation_time=None, invocation_latency=None, input_parameters=None, output_parameters=None, src_interface=None, dest_interface=None, fwd_interface=None): # noqa: E501 + def __init__(self, api_id=None, api_name=None, api_version=None, resource_name=None, uri=None, protocol=None, operation=None, result=None, invocation_time=None, invocation_latency=None, input_parameters=None, output_parameters=None, src_interface=None, dest_interface=None, fwd_interface=None, net_slice_info=None): # noqa: E501 """Log - a model defined in OpenAPI :param api_id: The api_id of this Log. # noqa: E501 @@ -47,6 +49,8 @@ class Log(Model): :type dest_interface: InterfaceDescription :param fwd_interface: The fwd_interface of this Log. # noqa: E501 :type fwd_interface: str + :param net_slice_info: The net_slice_info of this Log. # noqa: E501 + :type net_slice_info: NetSliceId """ self.openapi_types = { 'api_id': str, @@ -63,7 +67,8 @@ class Log(Model): 'output_parameters': object, 'src_interface': InterfaceDescription, 'dest_interface': InterfaceDescription, - 'fwd_interface': str + 'fwd_interface': str, + 'net_slice_info': NetSliceId } self.attribute_map = { @@ -81,7 +86,8 @@ class Log(Model): 'output_parameters': 'outputParameters', 'src_interface': 'srcInterface', 'dest_interface': 'destInterface', - 'fwd_interface': 'fwdInterface' + 'fwd_interface': 'fwdInterface', + 'net_slice_info': 'netSliceInfo' } self._api_id = api_id @@ -99,6 +105,7 @@ class Log(Model): self._src_interface = src_interface self._dest_interface = dest_interface self._fwd_interface = fwd_interface + self._net_slice_info = net_slice_info @classmethod def from_dict(cls, dikt) -> 'Log': @@ -140,7 +147,7 @@ class Log(Model): def api_name(self) -> str: """Gets the api_name of this Log. - Name of the API which was invoked, it is set as {apiName} part of the URI structure as defined in clause 5.2.4 of 3GPP TS 29.122. # noqa: E501 + Contains the invoked API name set to the value of the \"\" placeholder of the API URI as defined in clause 5.2.4 of 3GPP TS 29.122 [14]. # noqa: E501 :return: The api_name of this Log. :rtype: str @@ -151,7 +158,7 @@ class Log(Model): def api_name(self, api_name: str): """Sets the api_name of this Log. - Name of the API which was invoked, it is set as {apiName} part of the URI structure as defined in clause 5.2.4 of 3GPP TS 29.122. # noqa: E501 + Contains the invoked API name set to the value of the \"\" placeholder of the API URI as defined in clause 5.2.4 of 3GPP TS 29.122 [14]. # noqa: E501 :param api_name: The api_name of this Log. :type api_name: str @@ -461,3 +468,24 @@ class Log(Model): """ self._fwd_interface = fwd_interface + + @property + def net_slice_info(self) -> NetSliceId: + """Gets the net_slice_info of this Log. + + + :return: The net_slice_info of this Log. + :rtype: NetSliceId + """ + return self._net_slice_info + + @net_slice_info.setter + def net_slice_info(self, net_slice_info: NetSliceId): + """Sets the net_slice_info of this Log. + + + :param net_slice_info: The net_slice_info of this Log. + :type net_slice_info: NetSliceId + """ + + self._net_slice_info = net_slice_info diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/net_slice_id.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/net_slice_id.py new file mode 100644 index 0000000000000000000000000000000000000000..3f37e1dd303d73eea5b06c53fa621f33d62c7801 --- /dev/null +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/net_slice_id.py @@ -0,0 +1,117 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api_invocation_logs import util +from api_invocation_logs.models.base_model import Model +from api_invocation_logs.models.snssai import Snssai # noqa: E501 + + +class NetSliceId(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, snssai=None, nsi_id=None, ensi=None): # noqa: E501 + """NetSliceId - a model defined in OpenAPI + + :param snssai: The snssai of this NetSliceId. # noqa: E501 + :type snssai: Snssai + :param nsi_id: The nsi_id of this NetSliceId. # noqa: E501 + :type nsi_id: str + :param ensi: The ensi of this NetSliceId. # noqa: E501 + :type ensi: str + """ + self.openapi_types = { + 'snssai': Snssai, + 'nsi_id': str, + 'ensi': str + } + + self.attribute_map = { + 'snssai': 'snssai', + 'nsi_id': 'nsiId', + 'ensi': 'ensi' + } + + self._snssai = snssai + self._nsi_id = nsi_id + self._ensi = ensi + + @classmethod + def from_dict(cls, dikt) -> 'NetSliceId': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The NetSliceId of this NetSliceId. # noqa: E501 + :rtype: NetSliceId + """ + return util.deserialize_model(dikt, cls) + + @property + def snssai(self) -> Snssai: + """Gets the snssai of this NetSliceId. + + + :return: The snssai of this NetSliceId. + :rtype: Snssai + """ + return self._snssai + + @snssai.setter + def snssai(self, snssai: Snssai): + """Sets the snssai of this NetSliceId. + + + :param snssai: The snssai of this NetSliceId. + :type snssai: Snssai + """ + + self._snssai = snssai + + @property + def nsi_id(self) -> str: + """Gets the nsi_id of this NetSliceId. + + Contains the Identifier of the selected Network Slice instance # noqa: E501 + + :return: The nsi_id of this NetSliceId. + :rtype: str + """ + return self._nsi_id + + @nsi_id.setter + def nsi_id(self, nsi_id: str): + """Sets the nsi_id of this NetSliceId. + + Contains the Identifier of the selected Network Slice instance # noqa: E501 + + :param nsi_id: The nsi_id of this NetSliceId. + :type nsi_id: str + """ + + self._nsi_id = nsi_id + + @property + def ensi(self) -> str: + """Gets the ensi of this NetSliceId. + + Represents the External Network Slice Information that is used to identify a network slice, as specified in 3GPP TS 33.501. # noqa: E501 + + :return: The ensi of this NetSliceId. + :rtype: str + """ + return self._ensi + + @ensi.setter + def ensi(self, ensi: str): + """Sets the ensi of this NetSliceId. + + Represents the External Network Slice Information that is used to identify a network slice, as specified in 3GPP TS 33.501. # noqa: E501 + + :param ensi: The ensi of this NetSliceId. + :type ensi: str + """ + + self._ensi = ensi diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/snssai.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/snssai.py new file mode 100644 index 0000000000000000000000000000000000000000..a278c191f2629236502e477f616e0d9ddb03de50 --- /dev/null +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/models/snssai.py @@ -0,0 +1,99 @@ +import re # noqa: E501 +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api_invocation_logs import util +from api_invocation_logs.models.base_model import Model + + +class Snssai(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, sst=None, sd=None): # noqa: E501 + """Snssai - a model defined in OpenAPI + + :param sst: The sst of this Snssai. # noqa: E501 + :type sst: int + :param sd: The sd of this Snssai. # noqa: E501 + :type sd: str + """ + self.openapi_types = { + 'sst': int, + 'sd': str + } + + self.attribute_map = { + 'sst': 'sst', + 'sd': 'sd' + } + + self._sst = sst + self._sd = sd + + @classmethod + def from_dict(cls, dikt) -> 'Snssai': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The Snssai of this Snssai. # noqa: E501 + :rtype: Snssai + """ + return util.deserialize_model(dikt, cls) + + @property + def sst(self) -> int: + """Gets the sst of this Snssai. + + Unsigned integer, within the range 0 to 255, representing the Slice/Service Type. It indicates the expected Network Slice behaviour in terms of features and services. Values 0 to 127 correspond to the standardized SST range. Values 128 to 255 correspond to the Operator-specific range. See clause 28.4.2 of 3GPP TS 23.003. Standardized values are defined in clause 5.15.2.2 of 3GPP TS 23.501. # noqa: E501 + + :return: The sst of this Snssai. + :rtype: int + """ + return self._sst + + @sst.setter + def sst(self, sst: int): + """Sets the sst of this Snssai. + + Unsigned integer, within the range 0 to 255, representing the Slice/Service Type. It indicates the expected Network Slice behaviour in terms of features and services. Values 0 to 127 correspond to the standardized SST range. Values 128 to 255 correspond to the Operator-specific range. See clause 28.4.2 of 3GPP TS 23.003. Standardized values are defined in clause 5.15.2.2 of 3GPP TS 23.501. # noqa: E501 + + :param sst: The sst of this Snssai. + :type sst: int + """ + if sst is None: + raise ValueError("Invalid value for `sst`, must not be `None`") # noqa: E501 + if sst is not None and sst > 255: # noqa: E501 + raise ValueError("Invalid value for `sst`, must be a value less than or equal to `255`") # noqa: E501 + if sst is not None and sst < 0: # noqa: E501 + raise ValueError("Invalid value for `sst`, must be a value greater than or equal to `0`") # noqa: E501 + + self._sst = sst + + @property + def sd(self) -> str: + """Gets the sd of this Snssai. + + 3-octet string, representing the Slice Differentiator, in hexadecimal representation. Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent 4 bits. The most significant character representing the 4 most significant bits of the SD shall appear first in the string, and the character representing the 4 least significant bit of the SD shall appear last in the string. This is an optional parameter that complements the Slice/Service type(s) to allow to differentiate amongst multiple Network Slices of the same Slice/Service type. This IE shall be absent if no SD value is associated with the SST. # noqa: E501 + + :return: The sd of this Snssai. + :rtype: str + """ + return self._sd + + @sd.setter + def sd(self, sd: str): + """Sets the sd of this Snssai. + + 3-octet string, representing the Slice Differentiator, in hexadecimal representation. Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent 4 bits. The most significant character representing the 4 most significant bits of the SD shall appear first in the string, and the character representing the 4 least significant bit of the SD shall appear last in the string. This is an optional parameter that complements the Slice/Service type(s) to allow to differentiate amongst multiple Network Slices of the same Slice/Service type. This IE shall be absent if no SD value is associated with the SST. # noqa: E501 + + :param sd: The sd of this Snssai. + :type sd: str + """ + if sd is not None and not re.search(r'^[A-Fa-f0-9]{6}$', sd): # noqa: E501 + raise ValueError(r"Invalid value for `sd`, must be a follow pattern or equal to `/^[A-Fa-f0-9]{6}$/`") # noqa: E501 + + self._sd = sd diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/openapi/openapi.yaml b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/openapi/openapi.yaml index 7e794c1a7d52c0a4366616d7fd075ac36e6c3131..7ea3b64717c864847c365c823bed37f186c5380f 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/openapi/openapi.yaml +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/openapi/openapi.yaml @@ -1,11 +1,11 @@ openapi: 3.0.0 info: - description: "API for invocation logs. \n© 2024, 3GPP Organizational Partners (ARIB,\ + description: "API for invocation logs. \n© 2025, 3GPP Organizational Partners (ARIB,\ \ ATIS, CCSA, ETSI, TSDSI, TTA, TTC). \nAll rights reserved.\n" title: CAPIF_Logging_API_Invocation_API - version: 1.3.0 + version: 1.4.0-alpha.2 externalDocs: - description: 3GPP TS 29.222 V18.6.0 Common API Framework for 3GPP Northbound APIs + description: 3GPP TS 29.222 V19.3.0 Common API Framework for 3GPP Northbound APIs url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.222/ servers: - url: "{apiRoot}/api-invocation-logs/v1" @@ -210,6 +210,12 @@ components: result: result protocol: HTTP_1_1 apiVersion: apiVersion + netSliceInfo: + ensi: ensi + snssai: + sd: sd + sst: 37 + nsiId: nsiId destInterface: ipv6Addr: ipv6Addr grantTypes: @@ -247,6 +253,12 @@ components: result: result protocol: HTTP_1_1 apiVersion: apiVersion + netSliceInfo: + ensi: ensi + snssai: + sd: sd + sst: 37 + nsiId: nsiId destInterface: ipv6Addr: ipv6Addr grantTypes: @@ -316,6 +328,12 @@ components: result: result protocol: HTTP_1_1 apiVersion: apiVersion + netSliceInfo: + ensi: ensi + snssai: + sd: sd + sst: 37 + nsiId: nsiId destInterface: ipv6Addr: ipv6Addr grantTypes: @@ -338,7 +356,7 @@ components: type: string apiName: description: | - Name of the API which was invoked, it is set as {apiName} part of the URI structure as defined in clause 5.2.4 of 3GPP TS 29.122. + Contains the invoked API name set to the value of the "" placeholder of the API URI as defined in clause 5.2.4 of 3GPP TS 29.122 [14]. title: apiName type: string apiVersion: @@ -388,6 +406,8 @@ components: It includes the node identifier (as defined in IETF RFC 7239 of all forwarding entities between the API invoker and the AEF, concatenated with comma and space, e.g. 192.0.2.43:80, unknown:_OBFport, 203.0.113.60 title: fwdInterface type: string + netSliceInfo: + $ref: '#/components/schemas/NetSliceId' required: - apiId - apiName @@ -520,7 +540,7 @@ components: apiPrefix: apiPrefix ipv4Addr: ipv4Addr nullable: true - oneOf: + oneOf: - required: ["fqdn"] - required: ["ipv4Addr"] - required: ["ipv6Addr"] @@ -581,6 +601,39 @@ components: \ Security method 2 (Using PKI) as described in 3GPP TS 33.122.\n- OAUTH:\ \ Security method 3 (TLS with OAuth token) as described in 3GPP TS 33.122.\n" title: SecurityMethod + NetSliceId: + description: | + Represents the network slice identification information. + example: + ensi: ensi + snssai: + sd: sd + sst: 37 + nsiId: nsiId + nullable: true + oneOf: + - required: ["snssai"] + - required: ["nsiId"] + - required: ["ensi"] + properties: + snssai: + $ref: '#/components/schemas/Snssai' + nsiId: + description: Contains the Identifier of the selected Network Slice instance + title: NsiId + type: string + ensi: + description: | + Represents the External Network Slice Information that is used to identify a network slice, as specified in 3GPP TS 33.501. + title: Ensi + type: string + title: NetSliceId + type: object + Ensi: + description: | + Represents the External Network Slice Information that is used to identify a network slice, as specified in 3GPP TS 33.501. + title: Ensi + type: string Ipv4Addr: description: | string identifying a Ipv4 address formatted in the "dotted decimal" notation as defined in IETF RFC 1166. @@ -618,3 +671,35 @@ components: \ authorization code.\n- AUTHORIZATION_CODE_WITH_PKCE: Indicate that the grant\ \ type is authorization code with PKCE.\n" title: OAuthGrantType + Snssai: + description: | + When Snssai needs to be converted to string (e.g. when used in maps as key), the string shall be composed of one to three digits "sst" optionally followed by "-" and 6 hexadecimal digits "sd". + example: + sd: sd + sst: 37 + properties: + sst: + description: "Unsigned integer, within the range 0 to 255, representing\ + \ the Slice/Service Type. It indicates the expected Network Slice behaviour\ + \ in terms of features and services. Values 0 to 127 correspond to the\ + \ standardized SST range. Values 128 to 255 correspond to the Operator-specific\ + \ range. See clause 28.4.2 of 3GPP TS 23.003. Standardized values are\ + \ defined in clause 5.15.2.2 of 3GPP TS 23.501. \n" + maximum: 255 + minimum: 0 + title: sst + type: integer + sd: + description: | + 3-octet string, representing the Slice Differentiator, in hexadecimal representation. Each character in the string shall take a value of "0" to "9", "a" to "f" or "A" to "F" and shall represent 4 bits. The most significant character representing the 4 most significant bits of the SD shall appear first in the string, and the character representing the 4 least significant bit of the SD shall appear last in the string. This is an optional parameter that complements the Slice/Service type(s) to allow to differentiate amongst multiple Network Slices of the same Slice/Service type. This IE shall be absent if no SD value is associated with the SST. + pattern: "^[A-Fa-f0-9]{6}$" + title: sd + type: string + required: + - sst + title: Snssai + type: object + NsiId: + description: Contains the Identifier of the selected Network Slice instance + title: NsiId + type: string diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/test/test_default_controller.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/test/test_default_controller.py index 1475dbad48a6bf2d627dece7cbc29f7551ec39ca..da4ebd653ae52bdf13b6c6e45208881d6b55dc53 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/test/test_default_controller.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/api_invocation_logs/test/test_default_controller.py @@ -1,7 +1,9 @@ import unittest -from api_invocation_logs.models.invocation_log import InvocationLog # noqa: E501 -from api_invocation_logs.models.problem_details import ProblemDetails # noqa: E501 +from api_invocation_logs.models.invocation_log import \ + InvocationLog # noqa: E501 +from api_invocation_logs.models.problem_details import \ + ProblemDetails # noqa: E501 from api_invocation_logs.test import BaseTestCase from flask import json @@ -14,7 +16,7 @@ class TestDefaultController(BaseTestCase): """ - invocation_log = {"supportedFeatures":"supportedFeatures","apiInvokerId":"apiInvokerId","aefId":"aefId","logs":[{"apiName":"apiName","invocationTime":"2000-01-23T04:56:07.000+00:00","srcInterface":{"ipv6Addr":"ipv6Addr","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"securityMethods":["PSK","PSK"],"fqdn":"fqdn","port":39500,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},"fwdInterface":"fwdInterface","resourceName":"resourceName","uri":"uri","inputParameters":"","invocationLatency":0,"result":"result","protocol":"HTTP_1_1","apiVersion":"apiVersion","destInterface":{"ipv6Addr":"ipv6Addr","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"securityMethods":["PSK","PSK"],"fqdn":"fqdn","port":39500,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},"operation":"GET","apiId":"apiId","outputParameters":""},{"apiName":"apiName","invocationTime":"2000-01-23T04:56:07.000+00:00","srcInterface":{"ipv6Addr":"ipv6Addr","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"securityMethods":["PSK","PSK"],"fqdn":"fqdn","port":39500,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},"fwdInterface":"fwdInterface","resourceName":"resourceName","uri":"uri","inputParameters":"","invocationLatency":0,"result":"result","protocol":"HTTP_1_1","apiVersion":"apiVersion","destInterface":{"ipv6Addr":"ipv6Addr","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"securityMethods":["PSK","PSK"],"fqdn":"fqdn","port":39500,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},"operation":"GET","apiId":"apiId","outputParameters":""}]} + invocation_log = {"supportedFeatures":"supportedFeatures","apiInvokerId":"apiInvokerId","aefId":"aefId","logs":[{"apiName":"apiName","invocationTime":"2000-01-23T04:56:07.000+00:00","srcInterface":{"ipv6Addr":"ipv6Addr","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"securityMethods":["PSK","PSK"],"fqdn":"fqdn","port":39500,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},"fwdInterface":"fwdInterface","resourceName":"resourceName","uri":"uri","inputParameters":"","invocationLatency":0,"result":"result","protocol":"HTTP_1_1","apiVersion":"apiVersion","netSliceInfo":{"ensi":"ensi","snssai":{"sd":"sd","sst":37},"nsiId":"nsiId"},"destInterface":{"ipv6Addr":"ipv6Addr","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"securityMethods":["PSK","PSK"],"fqdn":"fqdn","port":39500,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},"operation":"GET","apiId":"apiId","outputParameters":""},{"apiName":"apiName","invocationTime":"2000-01-23T04:56:07.000+00:00","srcInterface":{"ipv6Addr":"ipv6Addr","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"securityMethods":["PSK","PSK"],"fqdn":"fqdn","port":39500,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},"fwdInterface":"fwdInterface","resourceName":"resourceName","uri":"uri","inputParameters":"","invocationLatency":0,"result":"result","protocol":"HTTP_1_1","apiVersion":"apiVersion","netSliceInfo":{"ensi":"ensi","snssai":{"sd":"sd","sst":37},"nsiId":"nsiId"},"destInterface":{"ipv6Addr":"ipv6Addr","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"securityMethods":["PSK","PSK"],"fqdn":"fqdn","port":39500,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},"operation":"GET","apiId":"apiId","outputParameters":""}]} headers = { 'Accept': 'application/json', 'Content-Type': 'application/json', diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/requirements.txt b/services/TS29222_CAPIF_Logging_API_Invocation_API/requirements.txt index 7abd46099797a5916f493661532e243c34571089..53f0f5dc839dfb66353a5666b0988d56ca8688ad 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/requirements.txt +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/requirements.txt @@ -1,25 +1,25 @@ connexion[flask, swagger-ui, uvicorn] == 3.1.0; python_version>="3.6" swagger-ui-bundle >= 0.0.2 python_dateutil >= 2.6.0 -setuptools == 74.0.0 +setuptools == 80.9.0 Flask == 3.0.3 pymongo == 4.7.3 elasticsearch == 8.4.3 flask_jwt_extended == 4.6.0 -cryptography == 42.0.8 +cryptography == 46.0.1 redis == 4.5.4 -opentelemetry-instrumentation == 0.40b0 -opentelemetry-instrumentation-flask == 0.40b0 -opentelemetry-instrumentation-redis == 0.40b0 -opentelemetry-instrumentation-pymongo == 0.40b0 -opentelemetry-exporter-otlp == 1.19.0 -opentelemetry-exporter-jaeger == 1.19.0 +opentelemetry-instrumentation == 0.41b0 +opentelemetry-instrumentation-flask == 0.41b0 +opentelemetry-instrumentation-redis == 0.41b0 +opentelemetry-instrumentation-pymongo == 0.41b0 +opentelemetry-exporter-otlp == 1.20.0 +opentelemetry-exporter-jaeger == 1.21.0 fluent == 0.10.0 fluent-logger == 0.10.0 -opentelemetry-api == 1.19.0 -opentelemetry-sdk == 1.19.0 +opentelemetry-api == 1.20.0 +opentelemetry-sdk == 1.20.0 flask_executor == 1.0.0 -werkzeug == 3.0.4 -pyopenssl == 24.1.0 +werkzeug == 3.1.3 +pyopenssl == 25.3.0 gunicorn == 23.0.0 packaging == 24.0 diff --git a/services/TS29222_CAPIF_Logging_API_Invocation_API/setup.py b/services/TS29222_CAPIF_Logging_API_Invocation_API/setup.py index aed8492996aef557130e39dc81933efc0fa5d94c..bb5ba1bb2c95d695184025995935bb2a8d6a533c 100644 --- a/services/TS29222_CAPIF_Logging_API_Invocation_API/setup.py +++ b/services/TS29222_CAPIF_Logging_API_Invocation_API/setup.py @@ -31,7 +31,7 @@ setup( entry_points={ 'console_scripts': ['api_invocation_logs=api_invocation_logs.__main__:main']}, long_description="""\ - API for invocation logs. © 2024, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. + API for invocation logs. © 2025, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. """ ) diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/.dockerignore b/services/TS29222_CAPIF_Open_Discover_Service_API/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..f9619601908b43d5d90c9befea5aa6ef6a732fa9 --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/.dockerignore @@ -0,0 +1,72 @@ +.travis.yaml +.openapi-generator-ignore +README.md +tox.ini +git_push.sh +test-requirements.txt +setup.py + +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ +venv/ +.python-version + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +#Ipython Notebook +.ipynb_checkpoints diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/.gitignore b/services/TS29222_CAPIF_Open_Discover_Service_API/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..43995bd42fa23bbc4c3a59d5fb9da99042fcf139 --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/.gitignore @@ -0,0 +1,66 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ +venv/ +.venv/ +.python-version +.pytest_cache + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +#Ipython Notebook +.ipynb_checkpoints diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/.openapi-generator-ignore b/services/TS29222_CAPIF_Open_Discover_Service_API/.openapi-generator-ignore new file mode 100644 index 0000000000000000000000000000000000000000..7484ee590a3894506cf063799b885428f95a71be --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/.openapi-generator/FILES b/services/TS29222_CAPIF_Open_Discover_Service_API/.openapi-generator/FILES new file mode 100644 index 0000000000000000000000000000000000000000..9b3cf66d4b10082e40692a8b93519a004837fbb9 --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/.openapi-generator/FILES @@ -0,0 +1,58 @@ +.dockerignore +.gitignore +.openapi-generator-ignore +.travis.yml +Dockerfile +README.md +git_push.sh +openapi_server/__init__.py +openapi_server/__main__.py +openapi_server/controllers/__init__.py +openapi_server/controllers/default_controller.py +openapi_server/controllers/security_controller.py +openapi_server/encoder.py +openapi_server/models/__init__.py +openapi_server/models/aef_location.py +openapi_server/models/api_status.py +openapi_server/models/base_model.py +openapi_server/models/civic_address.py +openapi_server/models/communication_type.py +openapi_server/models/custom_operation.py +openapi_server/models/data_format.py +openapi_server/models/ellipsoid_arc.py +openapi_server/models/gad_shape.py +openapi_server/models/geographic_area.py +openapi_server/models/geographical_coordinates.py +openapi_server/models/invalid_param.py +openapi_server/models/local2d_point_uncertainty_ellipse.py +openapi_server/models/local3d_point_uncertainty_ellipsoid.py +openapi_server/models/local_origin.py +openapi_server/models/open_aef_profile.py +openapi_server/models/open_api_details.py +openapi_server/models/open_discovery_resp.py +openapi_server/models/operation.py +openapi_server/models/point.py +openapi_server/models/point_altitude.py +openapi_server/models/point_altitude_uncertainty.py +openapi_server/models/point_uncertainty_circle.py +openapi_server/models/point_uncertainty_ellipse.py +openapi_server/models/polygon.py +openapi_server/models/problem_details.py +openapi_server/models/protocol.py +openapi_server/models/relative_cartesian_location.py +openapi_server/models/res_oper_info.py +openapi_server/models/resource.py +openapi_server/models/service_kpis.py +openapi_server/models/supported_gad_shapes.py +openapi_server/models/uncertainty_ellipse.py +openapi_server/models/uncertainty_ellipsoid.py +openapi_server/models/version.py +openapi_server/openapi/openapi.yaml +openapi_server/test/__init__.py +openapi_server/test/test_default_controller.py +openapi_server/typing_utils.py +openapi_server/util.py +requirements.txt +setup.py +test-requirements.txt +tox.ini diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/.openapi-generator/VERSION b/services/TS29222_CAPIF_Open_Discover_Service_API/.openapi-generator/VERSION new file mode 100644 index 0000000000000000000000000000000000000000..b23eb27529e2bacf6c8c06f725c323d9fb87f042 --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.11.0 diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/.travis.yml b/services/TS29222_CAPIF_Open_Discover_Service_API/.travis.yml new file mode 100644 index 0000000000000000000000000000000000000000..ad71ee5ca083a6923c91104533c5c7b86f297f3f --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/.travis.yml @@ -0,0 +1,14 @@ +# ref: https://docs.travis-ci.com/user/languages/python +language: python +python: + - "3.2" + - "3.3" + - "3.4" + - "3.5" + - "3.6" + - "3.7" + - "3.8" +# command to install dependencies +install: "pip install -r requirements.txt" +# command to run tests +script: nosetests diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/Dockerfile b/services/TS29222_CAPIF_Open_Discover_Service_API/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..4857637c3799f904ed177ef39c030be1b90d556d --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/Dockerfile @@ -0,0 +1,16 @@ +FROM python:3-alpine + +RUN mkdir -p /usr/src/app +WORKDIR /usr/src/app + +COPY requirements.txt /usr/src/app/ + +RUN pip3 install --no-cache-dir -r requirements.txt + +COPY . /usr/src/app + +EXPOSE 8080 + +ENTRYPOINT ["python3"] + +CMD ["-m", "openapi_server"] \ No newline at end of file diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/README.md b/services/TS29222_CAPIF_Open_Discover_Service_API/README.md new file mode 100644 index 0000000000000000000000000000000000000000..2786f7a6007249fe19a16053ea772e4f858d15b8 --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/README.md @@ -0,0 +1,49 @@ +# OpenAPI generated server + +## Overview +This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the +[OpenAPI-Spec](https://openapis.org) from a remote server, you can easily generate a server stub. This +is an example of building a OpenAPI-enabled Flask server. + +This example uses the [Connexion](https://github.com/zalando/connexion) library on top of Flask. + +## Requirements +Python 3.5.2+ + +## Usage +To run the server, please execute the following from the root directory: + +``` +pip3 install -r requirements.txt +python3 -m openapi_server +``` + +and open your browser to here: + +``` +http://localhost:8080/open-api-disc/v1/ui/ +``` + +Your OpenAPI definition lives here: + +``` +http://localhost:8080/open-api-disc/v1/openapi.json +``` + +To launch the integration tests, use tox: +``` +sudo pip install tox +tox +``` + +## Running with Docker + +To run the server on a Docker container, please execute the following from the root directory: + +```bash +# building the image +docker build -t openapi_server . + +# starting up a container +docker run -p 8080:8080 openapi_server +``` \ No newline at end of file diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/git_push.sh b/services/TS29222_CAPIF_Open_Discover_Service_API/git_push.sh new file mode 100644 index 0000000000000000000000000000000000000000..f53a75d4fabe760cce49eddfd62fcc702938ea90 --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/__init__.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/__main__.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..1b2cdd80532c0b872433b8834fccc3c5c39a3c19 --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/__main__.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 + +import connexion +from openapi_server import encoder + + +def main(): + app = connexion.App(__name__, specification_dir='./openapi/') + app.app.json_encoder = encoder.JSONEncoder + app.add_api('openapi.yaml', + arguments={'title': 'CAPIF_Open_Discover_Service_API'}, + pythonic_params=True) + + app.run(port=8080) + + +if __name__ == '__main__': + main() diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/controllers/__init__.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/controllers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/controllers/default_controller.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/controllers/default_controller.py new file mode 100644 index 0000000000000000000000000000000000000000..74f5e841cd19e378dddf3ba41067d1ed08a998c3 --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/controllers/default_controller.py @@ -0,0 +1,61 @@ + +import connexion +from openapi_server.models.aef_location import AefLocation # noqa: E501 +from openapi_server.models.communication_type import \ + CommunicationType # noqa: E501 +from openapi_server.models.data_format import DataFormat # noqa: E501 +from openapi_server.models.open_discovery_resp import \ + OpenDiscoveryResp # noqa: E501 +from openapi_server.models.problem_details import ProblemDetails # noqa: E501 +from openapi_server.models.protocol import Protocol # noqa: E501 +from openapi_server.models.res_oper_info import ResOperInfo # noqa: E501 +from openapi_server.models.service_kpis import ServiceKpis # noqa: E501 + + +def service_apis_get(api_names=None, api_versions=None, comm_type=None, protocols=None, data_format=None, api_cats=None, preferred_aef_loc=None, api_prov_names=None, api_supported_features=None, api_ids=None, service_kpis=None, res_ops=None, supported_features=None): # noqa: E501 + """service_apis_get + + Enables Open discovery of the currently registered at the CCF and satisfying a number of filter criteria. # noqa: E501 + + :param api_names: Contains the name(s) of the target Service API(s). + :type api_names: List[str] + :param api_versions: Contains the major version(s) (e.g., v1) of the target Service API(s). + :type api_versions: Dict[str, ] + :param comm_type: Contains the communication type supported by the target Service API(s). + :type comm_type: dict | bytes + :param protocols: Contains the protocol(s) supported by the target Service API(s). + :type protocols: list | bytes + :param data_format: Contains data format(s) supported by the target Service API(s). + :type data_format: dict | bytes + :param api_cats: Contains the category(ies) of the target Service API(s). + :type api_cats: List[str] + :param preferred_aef_loc: Contains the preferred location information for AEF(s) exposing the target Service API(s). This query parameter is ignored by the CCF if there are no matching records at the CCF. + :type preferred_aef_loc: dict | bytes + :param api_prov_names: Contains the name(s) of the provider(s) of the target Service API(s). + :type api_prov_names: List[str] + :param api_supported_features: Contains the features supported by the discovered service API indicated by api-name parameter. This may only be present if api-name query parameter is present. + :type api_supported_features: Dict[str, str] + :param api_ids: Contains the identifier(s) of the targeted service APIs. + :type api_ids: List[str] + :param service_kpis: Contains iInformation about service characteristics provided by the targeted service API(s). + :type service_kpis: dict | bytes + :param res_ops: Contains the list of supported API resource(s) and service operation(s). + :type res_ops: list | bytes + :param supported_features: Contains a list of supported features among the ones defined in clause 8.1.6. This attributed shall be present only when feature negotiation needs to take place. + :type supported_features: str + + :rtype: Union[OpenDiscoveryResp, Tuple[OpenDiscoveryResp, int], Tuple[OpenDiscoveryResp, int, Dict[str, str]] + """ + if connexion.request.is_json: + comm_type = CommunicationType.from_dict(connexion.request.get_json()) # noqa: E501 + if connexion.request.is_json: + protocols = [Protocol.from_dict(d) for d in connexion.request.get_json()] # noqa: E501 + if connexion.request.is_json: + data_format = DataFormat.from_dict(connexion.request.get_json()) # noqa: E501 + if connexion.request.is_json: + preferred_aef_loc = AefLocation.from_dict(connexion.request.get_json()) # noqa: E501 + if connexion.request.is_json: + service_kpis = ServiceKpis.from_dict(connexion.request.get_json()) # noqa: E501 + if connexion.request.is_json: + res_ops = [ResOperInfo.from_dict(d) for d in connexion.request.get_json()] # noqa: E501 + return 'do some magic!' diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/controllers/security_controller.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/controllers/security_controller.py new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/controllers/security_controller.py @@ -0,0 +1 @@ + diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/encoder.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/encoder.py new file mode 100644 index 0000000000000000000000000000000000000000..8eac4f36025f342584741c4f4e34dbd6a11328c0 --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/encoder.py @@ -0,0 +1,18 @@ +from connexion.apps.flask_app import FlaskJSONEncoder +from openapi_server.models.base_model import Model + + +class JSONEncoder(FlaskJSONEncoder): + include_nulls = False + + def default(self, o): + if isinstance(o, Model): + dikt = {} + for attr in o.openapi_types: + value = getattr(o, attr) + if value is None and not self.include_nulls: + continue + attr = o.attribute_map[attr] + dikt[attr] = value + return dikt + return FlaskJSONEncoder.default(self, o) diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/__init__.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d036df693ea41dfaa3debffffad0462c1fcd8e4a --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/__init__.py @@ -0,0 +1,2 @@ +# flake8: noqa +# import models into model package diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/aef_location.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/aef_location.py new file mode 100644 index 0000000000000000000000000000000000000000..665502a3ca172c7d581cedac3d7302bdbc74bb9d --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/aef_location.py @@ -0,0 +1,116 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from openapi_server import util +from openapi_server.models.base_model import Model +from openapi_server.models.civic_address import CivicAddress # noqa: E501 +from openapi_server.models.geographic_area import GeographicArea # noqa: E501 + + +class AefLocation(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, civic_addr=None, geo_area=None, dc_id=None): # noqa: E501 + """AefLocation - a model defined in OpenAPI + + :param civic_addr: The civic_addr of this AefLocation. # noqa: E501 + :type civic_addr: CivicAddress + :param geo_area: The geo_area of this AefLocation. # noqa: E501 + :type geo_area: GeographicArea + :param dc_id: The dc_id of this AefLocation. # noqa: E501 + :type dc_id: str + """ + self.openapi_types = { + 'civic_addr': CivicAddress, + 'geo_area': GeographicArea, + 'dc_id': str + } + + self.attribute_map = { + 'civic_addr': 'civicAddr', + 'geo_area': 'geoArea', + 'dc_id': 'dcId' + } + + self._civic_addr = civic_addr + self._geo_area = geo_area + self._dc_id = dc_id + + @classmethod + def from_dict(cls, dikt) -> 'AefLocation': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The AefLocation of this AefLocation. # noqa: E501 + :rtype: AefLocation + """ + return util.deserialize_model(dikt, cls) + + @property + def civic_addr(self) -> CivicAddress: + """Gets the civic_addr of this AefLocation. + + + :return: The civic_addr of this AefLocation. + :rtype: CivicAddress + """ + return self._civic_addr + + @civic_addr.setter + def civic_addr(self, civic_addr: CivicAddress): + """Sets the civic_addr of this AefLocation. + + + :param civic_addr: The civic_addr of this AefLocation. + :type civic_addr: CivicAddress + """ + + self._civic_addr = civic_addr + + @property + def geo_area(self) -> GeographicArea: + """Gets the geo_area of this AefLocation. + + + :return: The geo_area of this AefLocation. + :rtype: GeographicArea + """ + return self._geo_area + + @geo_area.setter + def geo_area(self, geo_area: GeographicArea): + """Sets the geo_area of this AefLocation. + + + :param geo_area: The geo_area of this AefLocation. + :type geo_area: GeographicArea + """ + + self._geo_area = geo_area + + @property + def dc_id(self) -> str: + """Gets the dc_id of this AefLocation. + + Identifies the data center where the AEF providing the service API is located. # noqa: E501 + + :return: The dc_id of this AefLocation. + :rtype: str + """ + return self._dc_id + + @dc_id.setter + def dc_id(self, dc_id: str): + """Sets the dc_id of this AefLocation. + + Identifies the data center where the AEF providing the service API is located. # noqa: E501 + + :param dc_id: The dc_id of this AefLocation. + :type dc_id: str + """ + + self._dc_id = dc_id diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/api_status.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/api_status.py new file mode 100644 index 0000000000000000000000000000000000000000..e13cbf69bec20c88a92a56014966f411e4561488 --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/api_status.py @@ -0,0 +1,64 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from openapi_server import util +from openapi_server.models.base_model import Model + + +class ApiStatus(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, aef_ids=None): # noqa: E501 + """ApiStatus - a model defined in OpenAPI + + :param aef_ids: The aef_ids of this ApiStatus. # noqa: E501 + :type aef_ids: List[str] + """ + self.openapi_types = { + 'aef_ids': List[str] + } + + self.attribute_map = { + 'aef_ids': 'aefIds' + } + + self._aef_ids = aef_ids + + @classmethod + def from_dict(cls, dikt) -> 'ApiStatus': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The ApiStatus of this ApiStatus. # noqa: E501 + :rtype: ApiStatus + """ + return util.deserialize_model(dikt, cls) + + @property + def aef_ids(self) -> List[str]: + """Gets the aef_ids of this ApiStatus. + + Indicates the list of AEF ID(s) where the API is active. If an empty array is provided, it indicates that the API is inactive in all AEF(s). # noqa: E501 + + :return: The aef_ids of this ApiStatus. + :rtype: List[str] + """ + return self._aef_ids + + @aef_ids.setter + def aef_ids(self, aef_ids: List[str]): + """Sets the aef_ids of this ApiStatus. + + Indicates the list of AEF ID(s) where the API is active. If an empty array is provided, it indicates that the API is inactive in all AEF(s). # noqa: E501 + + :param aef_ids: The aef_ids of this ApiStatus. + :type aef_ids: List[str] + """ + if aef_ids is None: + raise ValueError("Invalid value for `aef_ids`, must not be `None`") # noqa: E501 + + self._aef_ids = aef_ids diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/base_model.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/base_model.py new file mode 100644 index 0000000000000000000000000000000000000000..8b699027e809a43524b1a43bcd912af9f6a7e59d --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/base_model.py @@ -0,0 +1,67 @@ +import pprint +import typing + +from openapi_server import util + +T = typing.TypeVar('T') + + +class Model: + # openapiTypes: The key is attribute name and the + # value is attribute type. + openapi_types: typing.Dict[str, type] = {} + + # attributeMap: The key is attribute name and the + # value is json key in definition. + attribute_map: typing.Dict[str, str] = {} + + @classmethod + def from_dict(cls: typing.Type[T], dikt) -> T: + """Returns the dict as a model""" + return util.deserialize_model(dikt, cls) + + def to_dict(self): + """Returns the model properties as a dict + + :rtype: dict + """ + result = {} + + for attr in self.openapi_types: + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model + + :rtype: str + """ + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/civic_address.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/civic_address.py new file mode 100644 index 0000000000000000000000000000000000000000..973c30404a96e80881db95dc16e8838f3bbaa324 --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/civic_address.py @@ -0,0 +1,918 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from openapi_server import util +from openapi_server.models.base_model import Model + + +class CivicAddress(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, country=None, a1=None, a2=None, a3=None, a4=None, a5=None, a6=None, prd=None, pod=None, sts=None, hno=None, hns=None, lmk=None, loc=None, nam=None, pc=None, bld=None, unit=None, flr=None, room=None, plc=None, pcn=None, pobox=None, addcode=None, seat=None, rd=None, rdsec=None, rdbr=None, rdsubbr=None, prm=None, pom=None, usage_rules=None, method=None, provided_by=None): # noqa: E501 + """CivicAddress - a model defined in OpenAPI + + :param country: The country of this CivicAddress. # noqa: E501 + :type country: str + :param a1: The a1 of this CivicAddress. # noqa: E501 + :type a1: str + :param a2: The a2 of this CivicAddress. # noqa: E501 + :type a2: str + :param a3: The a3 of this CivicAddress. # noqa: E501 + :type a3: str + :param a4: The a4 of this CivicAddress. # noqa: E501 + :type a4: str + :param a5: The a5 of this CivicAddress. # noqa: E501 + :type a5: str + :param a6: The a6 of this CivicAddress. # noqa: E501 + :type a6: str + :param prd: The prd of this CivicAddress. # noqa: E501 + :type prd: str + :param pod: The pod of this CivicAddress. # noqa: E501 + :type pod: str + :param sts: The sts of this CivicAddress. # noqa: E501 + :type sts: str + :param hno: The hno of this CivicAddress. # noqa: E501 + :type hno: str + :param hns: The hns of this CivicAddress. # noqa: E501 + :type hns: str + :param lmk: The lmk of this CivicAddress. # noqa: E501 + :type lmk: str + :param loc: The loc of this CivicAddress. # noqa: E501 + :type loc: str + :param nam: The nam of this CivicAddress. # noqa: E501 + :type nam: str + :param pc: The pc of this CivicAddress. # noqa: E501 + :type pc: str + :param bld: The bld of this CivicAddress. # noqa: E501 + :type bld: str + :param unit: The unit of this CivicAddress. # noqa: E501 + :type unit: str + :param flr: The flr of this CivicAddress. # noqa: E501 + :type flr: str + :param room: The room of this CivicAddress. # noqa: E501 + :type room: str + :param plc: The plc of this CivicAddress. # noqa: E501 + :type plc: str + :param pcn: The pcn of this CivicAddress. # noqa: E501 + :type pcn: str + :param pobox: The pobox of this CivicAddress. # noqa: E501 + :type pobox: str + :param addcode: The addcode of this CivicAddress. # noqa: E501 + :type addcode: str + :param seat: The seat of this CivicAddress. # noqa: E501 + :type seat: str + :param rd: The rd of this CivicAddress. # noqa: E501 + :type rd: str + :param rdsec: The rdsec of this CivicAddress. # noqa: E501 + :type rdsec: str + :param rdbr: The rdbr of this CivicAddress. # noqa: E501 + :type rdbr: str + :param rdsubbr: The rdsubbr of this CivicAddress. # noqa: E501 + :type rdsubbr: str + :param prm: The prm of this CivicAddress. # noqa: E501 + :type prm: str + :param pom: The pom of this CivicAddress. # noqa: E501 + :type pom: str + :param usage_rules: The usage_rules of this CivicAddress. # noqa: E501 + :type usage_rules: str + :param method: The method of this CivicAddress. # noqa: E501 + :type method: str + :param provided_by: The provided_by of this CivicAddress. # noqa: E501 + :type provided_by: str + """ + self.openapi_types = { + 'country': str, + 'a1': str, + 'a2': str, + 'a3': str, + 'a4': str, + 'a5': str, + 'a6': str, + 'prd': str, + 'pod': str, + 'sts': str, + 'hno': str, + 'hns': str, + 'lmk': str, + 'loc': str, + 'nam': str, + 'pc': str, + 'bld': str, + 'unit': str, + 'flr': str, + 'room': str, + 'plc': str, + 'pcn': str, + 'pobox': str, + 'addcode': str, + 'seat': str, + 'rd': str, + 'rdsec': str, + 'rdbr': str, + 'rdsubbr': str, + 'prm': str, + 'pom': str, + 'usage_rules': str, + 'method': str, + 'provided_by': str + } + + self.attribute_map = { + 'country': 'country', + 'a1': 'A1', + 'a2': 'A2', + 'a3': 'A3', + 'a4': 'A4', + 'a5': 'A5', + 'a6': 'A6', + 'prd': 'PRD', + 'pod': 'POD', + 'sts': 'STS', + 'hno': 'HNO', + 'hns': 'HNS', + 'lmk': 'LMK', + 'loc': 'LOC', + 'nam': 'NAM', + 'pc': 'PC', + 'bld': 'BLD', + 'unit': 'UNIT', + 'flr': 'FLR', + 'room': 'ROOM', + 'plc': 'PLC', + 'pcn': 'PCN', + 'pobox': 'POBOX', + 'addcode': 'ADDCODE', + 'seat': 'SEAT', + 'rd': 'RD', + 'rdsec': 'RDSEC', + 'rdbr': 'RDBR', + 'rdsubbr': 'RDSUBBR', + 'prm': 'PRM', + 'pom': 'POM', + 'usage_rules': 'usageRules', + 'method': 'method', + 'provided_by': 'providedBy' + } + + self._country = country + self._a1 = a1 + self._a2 = a2 + self._a3 = a3 + self._a4 = a4 + self._a5 = a5 + self._a6 = a6 + self._prd = prd + self._pod = pod + self._sts = sts + self._hno = hno + self._hns = hns + self._lmk = lmk + self._loc = loc + self._nam = nam + self._pc = pc + self._bld = bld + self._unit = unit + self._flr = flr + self._room = room + self._plc = plc + self._pcn = pcn + self._pobox = pobox + self._addcode = addcode + self._seat = seat + self._rd = rd + self._rdsec = rdsec + self._rdbr = rdbr + self._rdsubbr = rdsubbr + self._prm = prm + self._pom = pom + self._usage_rules = usage_rules + self._method = method + self._provided_by = provided_by + + @classmethod + def from_dict(cls, dikt) -> 'CivicAddress': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The CivicAddress of this CivicAddress. # noqa: E501 + :rtype: CivicAddress + """ + return util.deserialize_model(dikt, cls) + + @property + def country(self) -> str: + """Gets the country of this CivicAddress. + + + :return: The country of this CivicAddress. + :rtype: str + """ + return self._country + + @country.setter + def country(self, country: str): + """Sets the country of this CivicAddress. + + + :param country: The country of this CivicAddress. + :type country: str + """ + + self._country = country + + @property + def a1(self) -> str: + """Gets the a1 of this CivicAddress. + + + :return: The a1 of this CivicAddress. + :rtype: str + """ + return self._a1 + + @a1.setter + def a1(self, a1: str): + """Sets the a1 of this CivicAddress. + + + :param a1: The a1 of this CivicAddress. + :type a1: str + """ + + self._a1 = a1 + + @property + def a2(self) -> str: + """Gets the a2 of this CivicAddress. + + + :return: The a2 of this CivicAddress. + :rtype: str + """ + return self._a2 + + @a2.setter + def a2(self, a2: str): + """Sets the a2 of this CivicAddress. + + + :param a2: The a2 of this CivicAddress. + :type a2: str + """ + + self._a2 = a2 + + @property + def a3(self) -> str: + """Gets the a3 of this CivicAddress. + + + :return: The a3 of this CivicAddress. + :rtype: str + """ + return self._a3 + + @a3.setter + def a3(self, a3: str): + """Sets the a3 of this CivicAddress. + + + :param a3: The a3 of this CivicAddress. + :type a3: str + """ + + self._a3 = a3 + + @property + def a4(self) -> str: + """Gets the a4 of this CivicAddress. + + + :return: The a4 of this CivicAddress. + :rtype: str + """ + return self._a4 + + @a4.setter + def a4(self, a4: str): + """Sets the a4 of this CivicAddress. + + + :param a4: The a4 of this CivicAddress. + :type a4: str + """ + + self._a4 = a4 + + @property + def a5(self) -> str: + """Gets the a5 of this CivicAddress. + + + :return: The a5 of this CivicAddress. + :rtype: str + """ + return self._a5 + + @a5.setter + def a5(self, a5: str): + """Sets the a5 of this CivicAddress. + + + :param a5: The a5 of this CivicAddress. + :type a5: str + """ + + self._a5 = a5 + + @property + def a6(self) -> str: + """Gets the a6 of this CivicAddress. + + + :return: The a6 of this CivicAddress. + :rtype: str + """ + return self._a6 + + @a6.setter + def a6(self, a6: str): + """Sets the a6 of this CivicAddress. + + + :param a6: The a6 of this CivicAddress. + :type a6: str + """ + + self._a6 = a6 + + @property + def prd(self) -> str: + """Gets the prd of this CivicAddress. + + + :return: The prd of this CivicAddress. + :rtype: str + """ + return self._prd + + @prd.setter + def prd(self, prd: str): + """Sets the prd of this CivicAddress. + + + :param prd: The prd of this CivicAddress. + :type prd: str + """ + + self._prd = prd + + @property + def pod(self) -> str: + """Gets the pod of this CivicAddress. + + + :return: The pod of this CivicAddress. + :rtype: str + """ + return self._pod + + @pod.setter + def pod(self, pod: str): + """Sets the pod of this CivicAddress. + + + :param pod: The pod of this CivicAddress. + :type pod: str + """ + + self._pod = pod + + @property + def sts(self) -> str: + """Gets the sts of this CivicAddress. + + + :return: The sts of this CivicAddress. + :rtype: str + """ + return self._sts + + @sts.setter + def sts(self, sts: str): + """Sets the sts of this CivicAddress. + + + :param sts: The sts of this CivicAddress. + :type sts: str + """ + + self._sts = sts + + @property + def hno(self) -> str: + """Gets the hno of this CivicAddress. + + + :return: The hno of this CivicAddress. + :rtype: str + """ + return self._hno + + @hno.setter + def hno(self, hno: str): + """Sets the hno of this CivicAddress. + + + :param hno: The hno of this CivicAddress. + :type hno: str + """ + + self._hno = hno + + @property + def hns(self) -> str: + """Gets the hns of this CivicAddress. + + + :return: The hns of this CivicAddress. + :rtype: str + """ + return self._hns + + @hns.setter + def hns(self, hns: str): + """Sets the hns of this CivicAddress. + + + :param hns: The hns of this CivicAddress. + :type hns: str + """ + + self._hns = hns + + @property + def lmk(self) -> str: + """Gets the lmk of this CivicAddress. + + + :return: The lmk of this CivicAddress. + :rtype: str + """ + return self._lmk + + @lmk.setter + def lmk(self, lmk: str): + """Sets the lmk of this CivicAddress. + + + :param lmk: The lmk of this CivicAddress. + :type lmk: str + """ + + self._lmk = lmk + + @property + def loc(self) -> str: + """Gets the loc of this CivicAddress. + + + :return: The loc of this CivicAddress. + :rtype: str + """ + return self._loc + + @loc.setter + def loc(self, loc: str): + """Sets the loc of this CivicAddress. + + + :param loc: The loc of this CivicAddress. + :type loc: str + """ + + self._loc = loc + + @property + def nam(self) -> str: + """Gets the nam of this CivicAddress. + + + :return: The nam of this CivicAddress. + :rtype: str + """ + return self._nam + + @nam.setter + def nam(self, nam: str): + """Sets the nam of this CivicAddress. + + + :param nam: The nam of this CivicAddress. + :type nam: str + """ + + self._nam = nam + + @property + def pc(self) -> str: + """Gets the pc of this CivicAddress. + + + :return: The pc of this CivicAddress. + :rtype: str + """ + return self._pc + + @pc.setter + def pc(self, pc: str): + """Sets the pc of this CivicAddress. + + + :param pc: The pc of this CivicAddress. + :type pc: str + """ + + self._pc = pc + + @property + def bld(self) -> str: + """Gets the bld of this CivicAddress. + + + :return: The bld of this CivicAddress. + :rtype: str + """ + return self._bld + + @bld.setter + def bld(self, bld: str): + """Sets the bld of this CivicAddress. + + + :param bld: The bld of this CivicAddress. + :type bld: str + """ + + self._bld = bld + + @property + def unit(self) -> str: + """Gets the unit of this CivicAddress. + + + :return: The unit of this CivicAddress. + :rtype: str + """ + return self._unit + + @unit.setter + def unit(self, unit: str): + """Sets the unit of this CivicAddress. + + + :param unit: The unit of this CivicAddress. + :type unit: str + """ + + self._unit = unit + + @property + def flr(self) -> str: + """Gets the flr of this CivicAddress. + + + :return: The flr of this CivicAddress. + :rtype: str + """ + return self._flr + + @flr.setter + def flr(self, flr: str): + """Sets the flr of this CivicAddress. + + + :param flr: The flr of this CivicAddress. + :type flr: str + """ + + self._flr = flr + + @property + def room(self) -> str: + """Gets the room of this CivicAddress. + + + :return: The room of this CivicAddress. + :rtype: str + """ + return self._room + + @room.setter + def room(self, room: str): + """Sets the room of this CivicAddress. + + + :param room: The room of this CivicAddress. + :type room: str + """ + + self._room = room + + @property + def plc(self) -> str: + """Gets the plc of this CivicAddress. + + + :return: The plc of this CivicAddress. + :rtype: str + """ + return self._plc + + @plc.setter + def plc(self, plc: str): + """Sets the plc of this CivicAddress. + + + :param plc: The plc of this CivicAddress. + :type plc: str + """ + + self._plc = plc + + @property + def pcn(self) -> str: + """Gets the pcn of this CivicAddress. + + + :return: The pcn of this CivicAddress. + :rtype: str + """ + return self._pcn + + @pcn.setter + def pcn(self, pcn: str): + """Sets the pcn of this CivicAddress. + + + :param pcn: The pcn of this CivicAddress. + :type pcn: str + """ + + self._pcn = pcn + + @property + def pobox(self) -> str: + """Gets the pobox of this CivicAddress. + + + :return: The pobox of this CivicAddress. + :rtype: str + """ + return self._pobox + + @pobox.setter + def pobox(self, pobox: str): + """Sets the pobox of this CivicAddress. + + + :param pobox: The pobox of this CivicAddress. + :type pobox: str + """ + + self._pobox = pobox + + @property + def addcode(self) -> str: + """Gets the addcode of this CivicAddress. + + + :return: The addcode of this CivicAddress. + :rtype: str + """ + return self._addcode + + @addcode.setter + def addcode(self, addcode: str): + """Sets the addcode of this CivicAddress. + + + :param addcode: The addcode of this CivicAddress. + :type addcode: str + """ + + self._addcode = addcode + + @property + def seat(self) -> str: + """Gets the seat of this CivicAddress. + + + :return: The seat of this CivicAddress. + :rtype: str + """ + return self._seat + + @seat.setter + def seat(self, seat: str): + """Sets the seat of this CivicAddress. + + + :param seat: The seat of this CivicAddress. + :type seat: str + """ + + self._seat = seat + + @property + def rd(self) -> str: + """Gets the rd of this CivicAddress. + + + :return: The rd of this CivicAddress. + :rtype: str + """ + return self._rd + + @rd.setter + def rd(self, rd: str): + """Sets the rd of this CivicAddress. + + + :param rd: The rd of this CivicAddress. + :type rd: str + """ + + self._rd = rd + + @property + def rdsec(self) -> str: + """Gets the rdsec of this CivicAddress. + + + :return: The rdsec of this CivicAddress. + :rtype: str + """ + return self._rdsec + + @rdsec.setter + def rdsec(self, rdsec: str): + """Sets the rdsec of this CivicAddress. + + + :param rdsec: The rdsec of this CivicAddress. + :type rdsec: str + """ + + self._rdsec = rdsec + + @property + def rdbr(self) -> str: + """Gets the rdbr of this CivicAddress. + + + :return: The rdbr of this CivicAddress. + :rtype: str + """ + return self._rdbr + + @rdbr.setter + def rdbr(self, rdbr: str): + """Sets the rdbr of this CivicAddress. + + + :param rdbr: The rdbr of this CivicAddress. + :type rdbr: str + """ + + self._rdbr = rdbr + + @property + def rdsubbr(self) -> str: + """Gets the rdsubbr of this CivicAddress. + + + :return: The rdsubbr of this CivicAddress. + :rtype: str + """ + return self._rdsubbr + + @rdsubbr.setter + def rdsubbr(self, rdsubbr: str): + """Sets the rdsubbr of this CivicAddress. + + + :param rdsubbr: The rdsubbr of this CivicAddress. + :type rdsubbr: str + """ + + self._rdsubbr = rdsubbr + + @property + def prm(self) -> str: + """Gets the prm of this CivicAddress. + + + :return: The prm of this CivicAddress. + :rtype: str + """ + return self._prm + + @prm.setter + def prm(self, prm: str): + """Sets the prm of this CivicAddress. + + + :param prm: The prm of this CivicAddress. + :type prm: str + """ + + self._prm = prm + + @property + def pom(self) -> str: + """Gets the pom of this CivicAddress. + + + :return: The pom of this CivicAddress. + :rtype: str + """ + return self._pom + + @pom.setter + def pom(self, pom: str): + """Sets the pom of this CivicAddress. + + + :param pom: The pom of this CivicAddress. + :type pom: str + """ + + self._pom = pom + + @property + def usage_rules(self) -> str: + """Gets the usage_rules of this CivicAddress. + + + :return: The usage_rules of this CivicAddress. + :rtype: str + """ + return self._usage_rules + + @usage_rules.setter + def usage_rules(self, usage_rules: str): + """Sets the usage_rules of this CivicAddress. + + + :param usage_rules: The usage_rules of this CivicAddress. + :type usage_rules: str + """ + + self._usage_rules = usage_rules + + @property + def method(self) -> str: + """Gets the method of this CivicAddress. + + + :return: The method of this CivicAddress. + :rtype: str + """ + return self._method + + @method.setter + def method(self, method: str): + """Sets the method of this CivicAddress. + + + :param method: The method of this CivicAddress. + :type method: str + """ + + self._method = method + + @property + def provided_by(self) -> str: + """Gets the provided_by of this CivicAddress. + + + :return: The provided_by of this CivicAddress. + :rtype: str + """ + return self._provided_by + + @provided_by.setter + def provided_by(self, provided_by: str): + """Sets the provided_by of this CivicAddress. + + + :param provided_by: The provided_by of this CivicAddress. + :type provided_by: str + """ + + self._provided_by = provided_by diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/communication_type.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/communication_type.py new file mode 100644 index 0000000000000000000000000000000000000000..76e66900de6bc68ef44fa4493fc04fb1e0cc57e5 --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/communication_type.py @@ -0,0 +1,33 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from openapi_server import util +from openapi_server.models.base_model import Model + + +class CommunicationType(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self): # noqa: E501 + """CommunicationType - a model defined in OpenAPI + + """ + self.openapi_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'CommunicationType': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The CommunicationType of this CommunicationType. # noqa: E501 + :rtype: CommunicationType + """ + return util.deserialize_model(dikt, cls) diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/custom_operation.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/custom_operation.py new file mode 100644 index 0000000000000000000000000000000000000000..3e8f2a2e74ccb816ca57b56f311daa4c51e75834 --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/custom_operation.py @@ -0,0 +1,153 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from openapi_server import util +from openapi_server.models.base_model import Model +from openapi_server.models.communication_type import \ + CommunicationType # noqa: E501 +from openapi_server.models.operation import Operation # noqa: E501 + + +class CustomOperation(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, comm_type=None, cust_op_name=None, operations=None, description=None): # noqa: E501 + """CustomOperation - a model defined in OpenAPI + + :param comm_type: The comm_type of this CustomOperation. # noqa: E501 + :type comm_type: CommunicationType + :param cust_op_name: The cust_op_name of this CustomOperation. # noqa: E501 + :type cust_op_name: str + :param operations: The operations of this CustomOperation. # noqa: E501 + :type operations: List[Operation] + :param description: The description of this CustomOperation. # noqa: E501 + :type description: str + """ + self.openapi_types = { + 'comm_type': CommunicationType, + 'cust_op_name': str, + 'operations': List[Operation], + 'description': str + } + + self.attribute_map = { + 'comm_type': 'commType', + 'cust_op_name': 'custOpName', + 'operations': 'operations', + 'description': 'description' + } + + self._comm_type = comm_type + self._cust_op_name = cust_op_name + self._operations = operations + self._description = description + + @classmethod + def from_dict(cls, dikt) -> 'CustomOperation': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The CustomOperation of this CustomOperation. # noqa: E501 + :rtype: CustomOperation + """ + return util.deserialize_model(dikt, cls) + + @property + def comm_type(self) -> CommunicationType: + """Gets the comm_type of this CustomOperation. + + + :return: The comm_type of this CustomOperation. + :rtype: CommunicationType + """ + return self._comm_type + + @comm_type.setter + def comm_type(self, comm_type: CommunicationType): + """Sets the comm_type of this CustomOperation. + + + :param comm_type: The comm_type of this CustomOperation. + :type comm_type: CommunicationType + """ + if comm_type is None: + raise ValueError("Invalid value for `comm_type`, must not be `None`") # noqa: E501 + + self._comm_type = comm_type + + @property + def cust_op_name(self) -> str: + """Gets the cust_op_name of this CustomOperation. + + it is set as {custOpName} part of the URI structure for a custom operation without resource association as defined in clause 5.2.4 of 3GPP TS 29.122. # noqa: E501 + + :return: The cust_op_name of this CustomOperation. + :rtype: str + """ + return self._cust_op_name + + @cust_op_name.setter + def cust_op_name(self, cust_op_name: str): + """Sets the cust_op_name of this CustomOperation. + + it is set as {custOpName} part of the URI structure for a custom operation without resource association as defined in clause 5.2.4 of 3GPP TS 29.122. # noqa: E501 + + :param cust_op_name: The cust_op_name of this CustomOperation. + :type cust_op_name: str + """ + if cust_op_name is None: + raise ValueError("Invalid value for `cust_op_name`, must not be `None`") # noqa: E501 + + self._cust_op_name = cust_op_name + + @property + def operations(self) -> List[Operation]: + """Gets the operations of this CustomOperation. + + Supported HTTP methods for the API resource. Only applicable when the protocol in AefProfile indicates HTTP. # noqa: E501 + + :return: The operations of this CustomOperation. + :rtype: List[Operation] + """ + return self._operations + + @operations.setter + def operations(self, operations: List[Operation]): + """Sets the operations of this CustomOperation. + + Supported HTTP methods for the API resource. Only applicable when the protocol in AefProfile indicates HTTP. # noqa: E501 + + :param operations: The operations of this CustomOperation. + :type operations: List[Operation] + """ + if operations is not None and len(operations) < 1: + raise ValueError("Invalid value for `operations`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._operations = operations + + @property + def description(self) -> str: + """Gets the description of this CustomOperation. + + Text description of the custom operation # noqa: E501 + + :return: The description of this CustomOperation. + :rtype: str + """ + return self._description + + @description.setter + def description(self, description: str): + """Sets the description of this CustomOperation. + + Text description of the custom operation # noqa: E501 + + :param description: The description of this CustomOperation. + :type description: str + """ + + self._description = description diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/data_format.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/data_format.py new file mode 100644 index 0000000000000000000000000000000000000000..31356c75f62458cf7dc8bbf7e1dd99f8932040e1 --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/data_format.py @@ -0,0 +1,33 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from openapi_server import util +from openapi_server.models.base_model import Model + + +class DataFormat(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self): # noqa: E501 + """DataFormat - a model defined in OpenAPI + + """ + self.openapi_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'DataFormat': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The DataFormat of this DataFormat. # noqa: E501 + :rtype: DataFormat + """ + return util.deserialize_model(dikt, cls) diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/ellipsoid_arc.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/ellipsoid_arc.py new file mode 100644 index 0000000000000000000000000000000000000000..6bf50cfb4a81aa46dd6a514958dadb42d6396f15 --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/ellipsoid_arc.py @@ -0,0 +1,263 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from openapi_server import util +from openapi_server.models.base_model import Model +from openapi_server.models.gad_shape import GADShape # noqa: E501 +from openapi_server.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from openapi_server.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 + + +class EllipsoidArc(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, shape=None, point=None, inner_radius=None, uncertainty_radius=None, offset_angle=None, included_angle=None, confidence=None): # noqa: E501 + """EllipsoidArc - a model defined in OpenAPI + + :param shape: The shape of this EllipsoidArc. # noqa: E501 + :type shape: SupportedGADShapes + :param point: The point of this EllipsoidArc. # noqa: E501 + :type point: GeographicalCoordinates + :param inner_radius: The inner_radius of this EllipsoidArc. # noqa: E501 + :type inner_radius: int + :param uncertainty_radius: The uncertainty_radius of this EllipsoidArc. # noqa: E501 + :type uncertainty_radius: float + :param offset_angle: The offset_angle of this EllipsoidArc. # noqa: E501 + :type offset_angle: int + :param included_angle: The included_angle of this EllipsoidArc. # noqa: E501 + :type included_angle: int + :param confidence: The confidence of this EllipsoidArc. # noqa: E501 + :type confidence: int + """ + self.openapi_types = { + 'shape': SupportedGADShapes, + 'point': GeographicalCoordinates, + 'inner_radius': int, + 'uncertainty_radius': float, + 'offset_angle': int, + 'included_angle': int, + 'confidence': int + } + + self.attribute_map = { + 'shape': 'shape', + 'point': 'point', + 'inner_radius': 'innerRadius', + 'uncertainty_radius': 'uncertaintyRadius', + 'offset_angle': 'offsetAngle', + 'included_angle': 'includedAngle', + 'confidence': 'confidence' + } + + self._shape = shape + self._point = point + self._inner_radius = inner_radius + self._uncertainty_radius = uncertainty_radius + self._offset_angle = offset_angle + self._included_angle = included_angle + self._confidence = confidence + + @classmethod + def from_dict(cls, dikt) -> 'EllipsoidArc': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The EllipsoidArc of this EllipsoidArc. # noqa: E501 + :rtype: EllipsoidArc + """ + return util.deserialize_model(dikt, cls) + + @property + def shape(self) -> SupportedGADShapes: + """Gets the shape of this EllipsoidArc. + + + :return: The shape of this EllipsoidArc. + :rtype: SupportedGADShapes + """ + return self._shape + + @shape.setter + def shape(self, shape: SupportedGADShapes): + """Sets the shape of this EllipsoidArc. + + + :param shape: The shape of this EllipsoidArc. + :type shape: SupportedGADShapes + """ + if shape is None: + raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 + + self._shape = shape + + @property + def point(self) -> GeographicalCoordinates: + """Gets the point of this EllipsoidArc. + + + :return: The point of this EllipsoidArc. + :rtype: GeographicalCoordinates + """ + return self._point + + @point.setter + def point(self, point: GeographicalCoordinates): + """Sets the point of this EllipsoidArc. + + + :param point: The point of this EllipsoidArc. + :type point: GeographicalCoordinates + """ + if point is None: + raise ValueError("Invalid value for `point`, must not be `None`") # noqa: E501 + + self._point = point + + @property + def inner_radius(self) -> int: + """Gets the inner_radius of this EllipsoidArc. + + Indicates value of the inner radius. # noqa: E501 + + :return: The inner_radius of this EllipsoidArc. + :rtype: int + """ + return self._inner_radius + + @inner_radius.setter + def inner_radius(self, inner_radius: int): + """Sets the inner_radius of this EllipsoidArc. + + Indicates value of the inner radius. # noqa: E501 + + :param inner_radius: The inner_radius of this EllipsoidArc. + :type inner_radius: int + """ + if inner_radius is None: + raise ValueError("Invalid value for `inner_radius`, must not be `None`") # noqa: E501 + if inner_radius is not None and inner_radius > 327675: # noqa: E501 + raise ValueError("Invalid value for `inner_radius`, must be a value less than or equal to `327675`") # noqa: E501 + if inner_radius is not None and inner_radius < 0: # noqa: E501 + raise ValueError("Invalid value for `inner_radius`, must be a value greater than or equal to `0`") # noqa: E501 + + self._inner_radius = inner_radius + + @property + def uncertainty_radius(self) -> float: + """Gets the uncertainty_radius of this EllipsoidArc. + + Indicates value of uncertainty. # noqa: E501 + + :return: The uncertainty_radius of this EllipsoidArc. + :rtype: float + """ + return self._uncertainty_radius + + @uncertainty_radius.setter + def uncertainty_radius(self, uncertainty_radius: float): + """Sets the uncertainty_radius of this EllipsoidArc. + + Indicates value of uncertainty. # noqa: E501 + + :param uncertainty_radius: The uncertainty_radius of this EllipsoidArc. + :type uncertainty_radius: float + """ + if uncertainty_radius is None: + raise ValueError("Invalid value for `uncertainty_radius`, must not be `None`") # noqa: E501 + if uncertainty_radius is not None and uncertainty_radius < 0: # noqa: E501 + raise ValueError("Invalid value for `uncertainty_radius`, must be a value greater than or equal to `0`") # noqa: E501 + + self._uncertainty_radius = uncertainty_radius + + @property + def offset_angle(self) -> int: + """Gets the offset_angle of this EllipsoidArc. + + Indicates value of angle. # noqa: E501 + + :return: The offset_angle of this EllipsoidArc. + :rtype: int + """ + return self._offset_angle + + @offset_angle.setter + def offset_angle(self, offset_angle: int): + """Sets the offset_angle of this EllipsoidArc. + + Indicates value of angle. # noqa: E501 + + :param offset_angle: The offset_angle of this EllipsoidArc. + :type offset_angle: int + """ + if offset_angle is None: + raise ValueError("Invalid value for `offset_angle`, must not be `None`") # noqa: E501 + if offset_angle is not None and offset_angle > 360: # noqa: E501 + raise ValueError("Invalid value for `offset_angle`, must be a value less than or equal to `360`") # noqa: E501 + if offset_angle is not None and offset_angle < 0: # noqa: E501 + raise ValueError("Invalid value for `offset_angle`, must be a value greater than or equal to `0`") # noqa: E501 + + self._offset_angle = offset_angle + + @property + def included_angle(self) -> int: + """Gets the included_angle of this EllipsoidArc. + + Indicates value of angle. # noqa: E501 + + :return: The included_angle of this EllipsoidArc. + :rtype: int + """ + return self._included_angle + + @included_angle.setter + def included_angle(self, included_angle: int): + """Sets the included_angle of this EllipsoidArc. + + Indicates value of angle. # noqa: E501 + + :param included_angle: The included_angle of this EllipsoidArc. + :type included_angle: int + """ + if included_angle is None: + raise ValueError("Invalid value for `included_angle`, must not be `None`") # noqa: E501 + if included_angle is not None and included_angle > 360: # noqa: E501 + raise ValueError("Invalid value for `included_angle`, must be a value less than or equal to `360`") # noqa: E501 + if included_angle is not None and included_angle < 0: # noqa: E501 + raise ValueError("Invalid value for `included_angle`, must be a value greater than or equal to `0`") # noqa: E501 + + self._included_angle = included_angle + + @property + def confidence(self) -> int: + """Gets the confidence of this EllipsoidArc. + + Indicates value of confidence. # noqa: E501 + + :return: The confidence of this EllipsoidArc. + :rtype: int + """ + return self._confidence + + @confidence.setter + def confidence(self, confidence: int): + """Sets the confidence of this EllipsoidArc. + + Indicates value of confidence. # noqa: E501 + + :param confidence: The confidence of this EllipsoidArc. + :type confidence: int + """ + if confidence is None: + raise ValueError("Invalid value for `confidence`, must not be `None`") # noqa: E501 + if confidence is not None and confidence > 100: # noqa: E501 + raise ValueError("Invalid value for `confidence`, must be a value less than or equal to `100`") # noqa: E501 + if confidence is not None and confidence < 0: # noqa: E501 + raise ValueError("Invalid value for `confidence`, must be a value greater than or equal to `0`") # noqa: E501 + + self._confidence = confidence diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/gad_shape.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/gad_shape.py new file mode 100644 index 0000000000000000000000000000000000000000..9ac0d19726b1eeb0b4e4380aa02bef1e67859394 --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/gad_shape.py @@ -0,0 +1,64 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from openapi_server import util +from openapi_server.models.base_model import Model +from openapi_server.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 + + +class GADShape(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, shape=None): # noqa: E501 + """GADShape - a model defined in OpenAPI + + :param shape: The shape of this GADShape. # noqa: E501 + :type shape: SupportedGADShapes + """ + self.openapi_types = { + 'shape': SupportedGADShapes + } + + self.attribute_map = { + 'shape': 'shape' + } + + self._shape = shape + + @classmethod + def from_dict(cls, dikt) -> 'GADShape': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The GADShape of this GADShape. # noqa: E501 + :rtype: GADShape + """ + return util.deserialize_model(dikt, cls) + + @property + def shape(self) -> SupportedGADShapes: + """Gets the shape of this GADShape. + + + :return: The shape of this GADShape. + :rtype: SupportedGADShapes + """ + return self._shape + + @shape.setter + def shape(self, shape: SupportedGADShapes): + """Sets the shape of this GADShape. + + + :param shape: The shape of this GADShape. + :type shape: SupportedGADShapes + """ + if shape is None: + raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 + + self._shape = shape diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/geographic_area.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/geographic_area.py new file mode 100644 index 0000000000000000000000000000000000000000..ea775a1f1856ebe1798a8112139e7e758208bbc2 --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/geographic_area.py @@ -0,0 +1,466 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from openapi_server import util +from openapi_server.models.base_model import Model +from openapi_server.models.ellipsoid_arc import EllipsoidArc # noqa: E501 +from openapi_server.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from openapi_server.models.point import Point # noqa: E501 +from openapi_server.models.point_altitude import PointAltitude # noqa: E501 +from openapi_server.models.point_altitude_uncertainty import \ + PointAltitudeUncertainty # noqa: E501 +from openapi_server.models.point_uncertainty_circle import \ + PointUncertaintyCircle # noqa: E501 +from openapi_server.models.point_uncertainty_ellipse import \ + PointUncertaintyEllipse # noqa: E501 +from openapi_server.models.polygon import Polygon # noqa: E501 +from openapi_server.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 +from openapi_server.models.uncertainty_ellipse import \ + UncertaintyEllipse # noqa: E501 + + +class GeographicArea(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, shape=None, point=None, uncertainty=None, uncertainty_ellipse=None, confidence=None, point_list=None, altitude=None, uncertainty_altitude=None, v_confidence=None, inner_radius=None, uncertainty_radius=None, offset_angle=None, included_angle=None): # noqa: E501 + """GeographicArea - a model defined in OpenAPI + + :param shape: The shape of this GeographicArea. # noqa: E501 + :type shape: SupportedGADShapes + :param point: The point of this GeographicArea. # noqa: E501 + :type point: GeographicalCoordinates + :param uncertainty: The uncertainty of this GeographicArea. # noqa: E501 + :type uncertainty: float + :param uncertainty_ellipse: The uncertainty_ellipse of this GeographicArea. # noqa: E501 + :type uncertainty_ellipse: UncertaintyEllipse + :param confidence: The confidence of this GeographicArea. # noqa: E501 + :type confidence: int + :param point_list: The point_list of this GeographicArea. # noqa: E501 + :type point_list: List[GeographicalCoordinates] + :param altitude: The altitude of this GeographicArea. # noqa: E501 + :type altitude: float + :param uncertainty_altitude: The uncertainty_altitude of this GeographicArea. # noqa: E501 + :type uncertainty_altitude: float + :param v_confidence: The v_confidence of this GeographicArea. # noqa: E501 + :type v_confidence: int + :param inner_radius: The inner_radius of this GeographicArea. # noqa: E501 + :type inner_radius: int + :param uncertainty_radius: The uncertainty_radius of this GeographicArea. # noqa: E501 + :type uncertainty_radius: float + :param offset_angle: The offset_angle of this GeographicArea. # noqa: E501 + :type offset_angle: int + :param included_angle: The included_angle of this GeographicArea. # noqa: E501 + :type included_angle: int + """ + self.openapi_types = { + 'shape': SupportedGADShapes, + 'point': GeographicalCoordinates, + 'uncertainty': float, + 'uncertainty_ellipse': UncertaintyEllipse, + 'confidence': int, + 'point_list': List[GeographicalCoordinates], + 'altitude': float, + 'uncertainty_altitude': float, + 'v_confidence': int, + 'inner_radius': int, + 'uncertainty_radius': float, + 'offset_angle': int, + 'included_angle': int + } + + self.attribute_map = { + 'shape': 'shape', + 'point': 'point', + 'uncertainty': 'uncertainty', + 'uncertainty_ellipse': 'uncertaintyEllipse', + 'confidence': 'confidence', + 'point_list': 'pointList', + 'altitude': 'altitude', + 'uncertainty_altitude': 'uncertaintyAltitude', + 'v_confidence': 'vConfidence', + 'inner_radius': 'innerRadius', + 'uncertainty_radius': 'uncertaintyRadius', + 'offset_angle': 'offsetAngle', + 'included_angle': 'includedAngle' + } + + self._shape = shape + self._point = point + self._uncertainty = uncertainty + self._uncertainty_ellipse = uncertainty_ellipse + self._confidence = confidence + self._point_list = point_list + self._altitude = altitude + self._uncertainty_altitude = uncertainty_altitude + self._v_confidence = v_confidence + self._inner_radius = inner_radius + self._uncertainty_radius = uncertainty_radius + self._offset_angle = offset_angle + self._included_angle = included_angle + + @classmethod + def from_dict(cls, dikt) -> 'GeographicArea': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The GeographicArea of this GeographicArea. # noqa: E501 + :rtype: GeographicArea + """ + return util.deserialize_model(dikt, cls) + + @property + def shape(self) -> SupportedGADShapes: + """Gets the shape of this GeographicArea. + + + :return: The shape of this GeographicArea. + :rtype: SupportedGADShapes + """ + return self._shape + + @shape.setter + def shape(self, shape: SupportedGADShapes): + """Sets the shape of this GeographicArea. + + + :param shape: The shape of this GeographicArea. + :type shape: SupportedGADShapes + """ + if shape is None: + raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 + + self._shape = shape + + @property + def point(self) -> GeographicalCoordinates: + """Gets the point of this GeographicArea. + + + :return: The point of this GeographicArea. + :rtype: GeographicalCoordinates + """ + return self._point + + @point.setter + def point(self, point: GeographicalCoordinates): + """Sets the point of this GeographicArea. + + + :param point: The point of this GeographicArea. + :type point: GeographicalCoordinates + """ + if point is None: + raise ValueError("Invalid value for `point`, must not be `None`") # noqa: E501 + + self._point = point + + @property + def uncertainty(self) -> float: + """Gets the uncertainty of this GeographicArea. + + Indicates value of uncertainty. # noqa: E501 + + :return: The uncertainty of this GeographicArea. + :rtype: float + """ + return self._uncertainty + + @uncertainty.setter + def uncertainty(self, uncertainty: float): + """Sets the uncertainty of this GeographicArea. + + Indicates value of uncertainty. # noqa: E501 + + :param uncertainty: The uncertainty of this GeographicArea. + :type uncertainty: float + """ + if uncertainty is None: + raise ValueError("Invalid value for `uncertainty`, must not be `None`") # noqa: E501 + if uncertainty is not None and uncertainty < 0: # noqa: E501 + raise ValueError("Invalid value for `uncertainty`, must be a value greater than or equal to `0`") # noqa: E501 + + self._uncertainty = uncertainty + + @property + def uncertainty_ellipse(self) -> UncertaintyEllipse: + """Gets the uncertainty_ellipse of this GeographicArea. + + + :return: The uncertainty_ellipse of this GeographicArea. + :rtype: UncertaintyEllipse + """ + return self._uncertainty_ellipse + + @uncertainty_ellipse.setter + def uncertainty_ellipse(self, uncertainty_ellipse: UncertaintyEllipse): + """Sets the uncertainty_ellipse of this GeographicArea. + + + :param uncertainty_ellipse: The uncertainty_ellipse of this GeographicArea. + :type uncertainty_ellipse: UncertaintyEllipse + """ + if uncertainty_ellipse is None: + raise ValueError("Invalid value for `uncertainty_ellipse`, must not be `None`") # noqa: E501 + + self._uncertainty_ellipse = uncertainty_ellipse + + @property + def confidence(self) -> int: + """Gets the confidence of this GeographicArea. + + Indicates value of confidence. # noqa: E501 + + :return: The confidence of this GeographicArea. + :rtype: int + """ + return self._confidence + + @confidence.setter + def confidence(self, confidence: int): + """Sets the confidence of this GeographicArea. + + Indicates value of confidence. # noqa: E501 + + :param confidence: The confidence of this GeographicArea. + :type confidence: int + """ + if confidence is None: + raise ValueError("Invalid value for `confidence`, must not be `None`") # noqa: E501 + if confidence is not None and confidence > 100: # noqa: E501 + raise ValueError("Invalid value for `confidence`, must be a value less than or equal to `100`") # noqa: E501 + if confidence is not None and confidence < 0: # noqa: E501 + raise ValueError("Invalid value for `confidence`, must be a value greater than or equal to `0`") # noqa: E501 + + self._confidence = confidence + + @property + def point_list(self) -> List[GeographicalCoordinates]: + """Gets the point_list of this GeographicArea. + + List of points. # noqa: E501 + + :return: The point_list of this GeographicArea. + :rtype: List[GeographicalCoordinates] + """ + return self._point_list + + @point_list.setter + def point_list(self, point_list: List[GeographicalCoordinates]): + """Sets the point_list of this GeographicArea. + + List of points. # noqa: E501 + + :param point_list: The point_list of this GeographicArea. + :type point_list: List[GeographicalCoordinates] + """ + if point_list is None: + raise ValueError("Invalid value for `point_list`, must not be `None`") # noqa: E501 + if point_list is not None and len(point_list) > 15: + raise ValueError("Invalid value for `point_list`, number of items must be less than or equal to `15`") # noqa: E501 + if point_list is not None and len(point_list) < 3: + raise ValueError("Invalid value for `point_list`, number of items must be greater than or equal to `3`") # noqa: E501 + + self._point_list = point_list + + @property + def altitude(self) -> float: + """Gets the altitude of this GeographicArea. + + Indicates value of altitude. # noqa: E501 + + :return: The altitude of this GeographicArea. + :rtype: float + """ + return self._altitude + + @altitude.setter + def altitude(self, altitude: float): + """Sets the altitude of this GeographicArea. + + Indicates value of altitude. # noqa: E501 + + :param altitude: The altitude of this GeographicArea. + :type altitude: float + """ + if altitude is None: + raise ValueError("Invalid value for `altitude`, must not be `None`") # noqa: E501 + if altitude is not None and altitude > 32767: # noqa: E501 + raise ValueError("Invalid value for `altitude`, must be a value less than or equal to `32767`") # noqa: E501 + if altitude is not None and altitude < -32767: # noqa: E501 + raise ValueError("Invalid value for `altitude`, must be a value greater than or equal to `-32767`") # noqa: E501 + + self._altitude = altitude + + @property + def uncertainty_altitude(self) -> float: + """Gets the uncertainty_altitude of this GeographicArea. + + Indicates value of uncertainty. # noqa: E501 + + :return: The uncertainty_altitude of this GeographicArea. + :rtype: float + """ + return self._uncertainty_altitude + + @uncertainty_altitude.setter + def uncertainty_altitude(self, uncertainty_altitude: float): + """Sets the uncertainty_altitude of this GeographicArea. + + Indicates value of uncertainty. # noqa: E501 + + :param uncertainty_altitude: The uncertainty_altitude of this GeographicArea. + :type uncertainty_altitude: float + """ + if uncertainty_altitude is None: + raise ValueError("Invalid value for `uncertainty_altitude`, must not be `None`") # noqa: E501 + if uncertainty_altitude is not None and uncertainty_altitude < 0: # noqa: E501 + raise ValueError("Invalid value for `uncertainty_altitude`, must be a value greater than or equal to `0`") # noqa: E501 + + self._uncertainty_altitude = uncertainty_altitude + + @property + def v_confidence(self) -> int: + """Gets the v_confidence of this GeographicArea. + + Indicates value of confidence. # noqa: E501 + + :return: The v_confidence of this GeographicArea. + :rtype: int + """ + return self._v_confidence + + @v_confidence.setter + def v_confidence(self, v_confidence: int): + """Sets the v_confidence of this GeographicArea. + + Indicates value of confidence. # noqa: E501 + + :param v_confidence: The v_confidence of this GeographicArea. + :type v_confidence: int + """ + if v_confidence is not None and v_confidence > 100: # noqa: E501 + raise ValueError("Invalid value for `v_confidence`, must be a value less than or equal to `100`") # noqa: E501 + if v_confidence is not None and v_confidence < 0: # noqa: E501 + raise ValueError("Invalid value for `v_confidence`, must be a value greater than or equal to `0`") # noqa: E501 + + self._v_confidence = v_confidence + + @property + def inner_radius(self) -> int: + """Gets the inner_radius of this GeographicArea. + + Indicates value of the inner radius. # noqa: E501 + + :return: The inner_radius of this GeographicArea. + :rtype: int + """ + return self._inner_radius + + @inner_radius.setter + def inner_radius(self, inner_radius: int): + """Sets the inner_radius of this GeographicArea. + + Indicates value of the inner radius. # noqa: E501 + + :param inner_radius: The inner_radius of this GeographicArea. + :type inner_radius: int + """ + if inner_radius is None: + raise ValueError("Invalid value for `inner_radius`, must not be `None`") # noqa: E501 + if inner_radius is not None and inner_radius > 327675: # noqa: E501 + raise ValueError("Invalid value for `inner_radius`, must be a value less than or equal to `327675`") # noqa: E501 + if inner_radius is not None and inner_radius < 0: # noqa: E501 + raise ValueError("Invalid value for `inner_radius`, must be a value greater than or equal to `0`") # noqa: E501 + + self._inner_radius = inner_radius + + @property + def uncertainty_radius(self) -> float: + """Gets the uncertainty_radius of this GeographicArea. + + Indicates value of uncertainty. # noqa: E501 + + :return: The uncertainty_radius of this GeographicArea. + :rtype: float + """ + return self._uncertainty_radius + + @uncertainty_radius.setter + def uncertainty_radius(self, uncertainty_radius: float): + """Sets the uncertainty_radius of this GeographicArea. + + Indicates value of uncertainty. # noqa: E501 + + :param uncertainty_radius: The uncertainty_radius of this GeographicArea. + :type uncertainty_radius: float + """ + if uncertainty_radius is None: + raise ValueError("Invalid value for `uncertainty_radius`, must not be `None`") # noqa: E501 + if uncertainty_radius is not None and uncertainty_radius < 0: # noqa: E501 + raise ValueError("Invalid value for `uncertainty_radius`, must be a value greater than or equal to `0`") # noqa: E501 + + self._uncertainty_radius = uncertainty_radius + + @property + def offset_angle(self) -> int: + """Gets the offset_angle of this GeographicArea. + + Indicates value of angle. # noqa: E501 + + :return: The offset_angle of this GeographicArea. + :rtype: int + """ + return self._offset_angle + + @offset_angle.setter + def offset_angle(self, offset_angle: int): + """Sets the offset_angle of this GeographicArea. + + Indicates value of angle. # noqa: E501 + + :param offset_angle: The offset_angle of this GeographicArea. + :type offset_angle: int + """ + if offset_angle is None: + raise ValueError("Invalid value for `offset_angle`, must not be `None`") # noqa: E501 + if offset_angle is not None and offset_angle > 360: # noqa: E501 + raise ValueError("Invalid value for `offset_angle`, must be a value less than or equal to `360`") # noqa: E501 + if offset_angle is not None and offset_angle < 0: # noqa: E501 + raise ValueError("Invalid value for `offset_angle`, must be a value greater than or equal to `0`") # noqa: E501 + + self._offset_angle = offset_angle + + @property + def included_angle(self) -> int: + """Gets the included_angle of this GeographicArea. + + Indicates value of angle. # noqa: E501 + + :return: The included_angle of this GeographicArea. + :rtype: int + """ + return self._included_angle + + @included_angle.setter + def included_angle(self, included_angle: int): + """Sets the included_angle of this GeographicArea. + + Indicates value of angle. # noqa: E501 + + :param included_angle: The included_angle of this GeographicArea. + :type included_angle: int + """ + if included_angle is None: + raise ValueError("Invalid value for `included_angle`, must not be `None`") # noqa: E501 + if included_angle is not None and included_angle > 360: # noqa: E501 + raise ValueError("Invalid value for `included_angle`, must be a value less than or equal to `360`") # noqa: E501 + if included_angle is not None and included_angle < 0: # noqa: E501 + raise ValueError("Invalid value for `included_angle`, must be a value greater than or equal to `0`") # noqa: E501 + + self._included_angle = included_angle diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/geographical_coordinates.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/geographical_coordinates.py new file mode 100644 index 0000000000000000000000000000000000000000..06b7275f388f33296a87fa002390e58b742c92fa --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/geographical_coordinates.py @@ -0,0 +1,98 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from openapi_server import util +from openapi_server.models.base_model import Model + + +class GeographicalCoordinates(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, lon=None, lat=None): # noqa: E501 + """GeographicalCoordinates - a model defined in OpenAPI + + :param lon: The lon of this GeographicalCoordinates. # noqa: E501 + :type lon: float + :param lat: The lat of this GeographicalCoordinates. # noqa: E501 + :type lat: float + """ + self.openapi_types = { + 'lon': float, + 'lat': float + } + + self.attribute_map = { + 'lon': 'lon', + 'lat': 'lat' + } + + self._lon = lon + self._lat = lat + + @classmethod + def from_dict(cls, dikt) -> 'GeographicalCoordinates': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The GeographicalCoordinates of this GeographicalCoordinates. # noqa: E501 + :rtype: GeographicalCoordinates + """ + return util.deserialize_model(dikt, cls) + + @property + def lon(self) -> float: + """Gets the lon of this GeographicalCoordinates. + + + :return: The lon of this GeographicalCoordinates. + :rtype: float + """ + return self._lon + + @lon.setter + def lon(self, lon: float): + """Sets the lon of this GeographicalCoordinates. + + + :param lon: The lon of this GeographicalCoordinates. + :type lon: float + """ + if lon is None: + raise ValueError("Invalid value for `lon`, must not be `None`") # noqa: E501 + if lon is not None and lon > 180: # noqa: E501 + raise ValueError("Invalid value for `lon`, must be a value less than or equal to `180`") # noqa: E501 + if lon is not None and lon < -180: # noqa: E501 + raise ValueError("Invalid value for `lon`, must be a value greater than or equal to `-180`") # noqa: E501 + + self._lon = lon + + @property + def lat(self) -> float: + """Gets the lat of this GeographicalCoordinates. + + + :return: The lat of this GeographicalCoordinates. + :rtype: float + """ + return self._lat + + @lat.setter + def lat(self, lat: float): + """Sets the lat of this GeographicalCoordinates. + + + :param lat: The lat of this GeographicalCoordinates. + :type lat: float + """ + if lat is None: + raise ValueError("Invalid value for `lat`, must not be `None`") # noqa: E501 + if lat is not None and lat > 90: # noqa: E501 + raise ValueError("Invalid value for `lat`, must be a value less than or equal to `90`") # noqa: E501 + if lat is not None and lat < -90: # noqa: E501 + raise ValueError("Invalid value for `lat`, must be a value greater than or equal to `-90`") # noqa: E501 + + self._lat = lat diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/invalid_param.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/invalid_param.py new file mode 100644 index 0000000000000000000000000000000000000000..16085367312b196b49d79137264b165cf2d5727c --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/invalid_param.py @@ -0,0 +1,92 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from openapi_server import util +from openapi_server.models.base_model import Model + + +class InvalidParam(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, param=None, reason=None): # noqa: E501 + """InvalidParam - a model defined in OpenAPI + + :param param: The param of this InvalidParam. # noqa: E501 + :type param: str + :param reason: The reason of this InvalidParam. # noqa: E501 + :type reason: str + """ + self.openapi_types = { + 'param': str, + 'reason': str + } + + self.attribute_map = { + 'param': 'param', + 'reason': 'reason' + } + + self._param = param + self._reason = reason + + @classmethod + def from_dict(cls, dikt) -> 'InvalidParam': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The InvalidParam of this InvalidParam. # noqa: E501 + :rtype: InvalidParam + """ + return util.deserialize_model(dikt, cls) + + @property + def param(self) -> str: + """Gets the param of this InvalidParam. + + Attribute's name encoded as a JSON Pointer, or header's name. # noqa: E501 + + :return: The param of this InvalidParam. + :rtype: str + """ + return self._param + + @param.setter + def param(self, param: str): + """Sets the param of this InvalidParam. + + Attribute's name encoded as a JSON Pointer, or header's name. # noqa: E501 + + :param param: The param of this InvalidParam. + :type param: str + """ + if param is None: + raise ValueError("Invalid value for `param`, must not be `None`") # noqa: E501 + + self._param = param + + @property + def reason(self) -> str: + """Gets the reason of this InvalidParam. + + A human-readable reason, e.g. \"must be a positive integer\". # noqa: E501 + + :return: The reason of this InvalidParam. + :rtype: str + """ + return self._reason + + @reason.setter + def reason(self, reason: str): + """Sets the reason of this InvalidParam. + + A human-readable reason, e.g. \"must be a positive integer\". # noqa: E501 + + :param reason: The reason of this InvalidParam. + :type reason: str + """ + + self._reason = reason diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/local2d_point_uncertainty_ellipse.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/local2d_point_uncertainty_ellipse.py new file mode 100644 index 0000000000000000000000000000000000000000..0d040baf5cd5688e946c68d4b3e7a2249621ea63 --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/local2d_point_uncertainty_ellipse.py @@ -0,0 +1,188 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from openapi_server import util +from openapi_server.models.base_model import Model +from openapi_server.models.gad_shape import GADShape # noqa: E501 +from openapi_server.models.local_origin import LocalOrigin # noqa: E501 +from openapi_server.models.relative_cartesian_location import \ + RelativeCartesianLocation # noqa: E501 +from openapi_server.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 +from openapi_server.models.uncertainty_ellipse import \ + UncertaintyEllipse # noqa: E501 + + +class Local2dPointUncertaintyEllipse(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, shape=None, local_origin=None, point=None, uncertainty_ellipse=None, confidence=None): # noqa: E501 + """Local2dPointUncertaintyEllipse - a model defined in OpenAPI + + :param shape: The shape of this Local2dPointUncertaintyEllipse. # noqa: E501 + :type shape: SupportedGADShapes + :param local_origin: The local_origin of this Local2dPointUncertaintyEllipse. # noqa: E501 + :type local_origin: LocalOrigin + :param point: The point of this Local2dPointUncertaintyEllipse. # noqa: E501 + :type point: RelativeCartesianLocation + :param uncertainty_ellipse: The uncertainty_ellipse of this Local2dPointUncertaintyEllipse. # noqa: E501 + :type uncertainty_ellipse: UncertaintyEllipse + :param confidence: The confidence of this Local2dPointUncertaintyEllipse. # noqa: E501 + :type confidence: int + """ + self.openapi_types = { + 'shape': SupportedGADShapes, + 'local_origin': LocalOrigin, + 'point': RelativeCartesianLocation, + 'uncertainty_ellipse': UncertaintyEllipse, + 'confidence': int + } + + self.attribute_map = { + 'shape': 'shape', + 'local_origin': 'localOrigin', + 'point': 'point', + 'uncertainty_ellipse': 'uncertaintyEllipse', + 'confidence': 'confidence' + } + + self._shape = shape + self._local_origin = local_origin + self._point = point + self._uncertainty_ellipse = uncertainty_ellipse + self._confidence = confidence + + @classmethod + def from_dict(cls, dikt) -> 'Local2dPointUncertaintyEllipse': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The Local2dPointUncertaintyEllipse of this Local2dPointUncertaintyEllipse. # noqa: E501 + :rtype: Local2dPointUncertaintyEllipse + """ + return util.deserialize_model(dikt, cls) + + @property + def shape(self) -> SupportedGADShapes: + """Gets the shape of this Local2dPointUncertaintyEllipse. + + + :return: The shape of this Local2dPointUncertaintyEllipse. + :rtype: SupportedGADShapes + """ + return self._shape + + @shape.setter + def shape(self, shape: SupportedGADShapes): + """Sets the shape of this Local2dPointUncertaintyEllipse. + + + :param shape: The shape of this Local2dPointUncertaintyEllipse. + :type shape: SupportedGADShapes + """ + if shape is None: + raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 + + self._shape = shape + + @property + def local_origin(self) -> LocalOrigin: + """Gets the local_origin of this Local2dPointUncertaintyEllipse. + + + :return: The local_origin of this Local2dPointUncertaintyEllipse. + :rtype: LocalOrigin + """ + return self._local_origin + + @local_origin.setter + def local_origin(self, local_origin: LocalOrigin): + """Sets the local_origin of this Local2dPointUncertaintyEllipse. + + + :param local_origin: The local_origin of this Local2dPointUncertaintyEllipse. + :type local_origin: LocalOrigin + """ + if local_origin is None: + raise ValueError("Invalid value for `local_origin`, must not be `None`") # noqa: E501 + + self._local_origin = local_origin + + @property + def point(self) -> RelativeCartesianLocation: + """Gets the point of this Local2dPointUncertaintyEllipse. + + + :return: The point of this Local2dPointUncertaintyEllipse. + :rtype: RelativeCartesianLocation + """ + return self._point + + @point.setter + def point(self, point: RelativeCartesianLocation): + """Sets the point of this Local2dPointUncertaintyEllipse. + + + :param point: The point of this Local2dPointUncertaintyEllipse. + :type point: RelativeCartesianLocation + """ + if point is None: + raise ValueError("Invalid value for `point`, must not be `None`") # noqa: E501 + + self._point = point + + @property + def uncertainty_ellipse(self) -> UncertaintyEllipse: + """Gets the uncertainty_ellipse of this Local2dPointUncertaintyEllipse. + + + :return: The uncertainty_ellipse of this Local2dPointUncertaintyEllipse. + :rtype: UncertaintyEllipse + """ + return self._uncertainty_ellipse + + @uncertainty_ellipse.setter + def uncertainty_ellipse(self, uncertainty_ellipse: UncertaintyEllipse): + """Sets the uncertainty_ellipse of this Local2dPointUncertaintyEllipse. + + + :param uncertainty_ellipse: The uncertainty_ellipse of this Local2dPointUncertaintyEllipse. + :type uncertainty_ellipse: UncertaintyEllipse + """ + if uncertainty_ellipse is None: + raise ValueError("Invalid value for `uncertainty_ellipse`, must not be `None`") # noqa: E501 + + self._uncertainty_ellipse = uncertainty_ellipse + + @property + def confidence(self) -> int: + """Gets the confidence of this Local2dPointUncertaintyEllipse. + + Indicates value of confidence. # noqa: E501 + + :return: The confidence of this Local2dPointUncertaintyEllipse. + :rtype: int + """ + return self._confidence + + @confidence.setter + def confidence(self, confidence: int): + """Sets the confidence of this Local2dPointUncertaintyEllipse. + + Indicates value of confidence. # noqa: E501 + + :param confidence: The confidence of this Local2dPointUncertaintyEllipse. + :type confidence: int + """ + if confidence is None: + raise ValueError("Invalid value for `confidence`, must not be `None`") # noqa: E501 + if confidence is not None and confidence > 100: # noqa: E501 + raise ValueError("Invalid value for `confidence`, must be a value less than or equal to `100`") # noqa: E501 + if confidence is not None and confidence < 0: # noqa: E501 + raise ValueError("Invalid value for `confidence`, must be a value greater than or equal to `0`") # noqa: E501 + + self._confidence = confidence diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/local3d_point_uncertainty_ellipsoid.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/local3d_point_uncertainty_ellipsoid.py new file mode 100644 index 0000000000000000000000000000000000000000..28cbd1e8985d3ea41956c33712af5c7e6639a85b --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/local3d_point_uncertainty_ellipsoid.py @@ -0,0 +1,220 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from openapi_server import util +from openapi_server.models.base_model import Model +from openapi_server.models.gad_shape import GADShape # noqa: E501 +from openapi_server.models.local_origin import LocalOrigin # noqa: E501 +from openapi_server.models.relative_cartesian_location import \ + RelativeCartesianLocation # noqa: E501 +from openapi_server.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 +from openapi_server.models.uncertainty_ellipsoid import \ + UncertaintyEllipsoid # noqa: E501 + + +class Local3dPointUncertaintyEllipsoid(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, shape=None, local_origin=None, point=None, uncertainty_ellipsoid=None, confidence=None, v_confidence=None): # noqa: E501 + """Local3dPointUncertaintyEllipsoid - a model defined in OpenAPI + + :param shape: The shape of this Local3dPointUncertaintyEllipsoid. # noqa: E501 + :type shape: SupportedGADShapes + :param local_origin: The local_origin of this Local3dPointUncertaintyEllipsoid. # noqa: E501 + :type local_origin: LocalOrigin + :param point: The point of this Local3dPointUncertaintyEllipsoid. # noqa: E501 + :type point: RelativeCartesianLocation + :param uncertainty_ellipsoid: The uncertainty_ellipsoid of this Local3dPointUncertaintyEllipsoid. # noqa: E501 + :type uncertainty_ellipsoid: UncertaintyEllipsoid + :param confidence: The confidence of this Local3dPointUncertaintyEllipsoid. # noqa: E501 + :type confidence: int + :param v_confidence: The v_confidence of this Local3dPointUncertaintyEllipsoid. # noqa: E501 + :type v_confidence: int + """ + self.openapi_types = { + 'shape': SupportedGADShapes, + 'local_origin': LocalOrigin, + 'point': RelativeCartesianLocation, + 'uncertainty_ellipsoid': UncertaintyEllipsoid, + 'confidence': int, + 'v_confidence': int + } + + self.attribute_map = { + 'shape': 'shape', + 'local_origin': 'localOrigin', + 'point': 'point', + 'uncertainty_ellipsoid': 'uncertaintyEllipsoid', + 'confidence': 'confidence', + 'v_confidence': 'vConfidence' + } + + self._shape = shape + self._local_origin = local_origin + self._point = point + self._uncertainty_ellipsoid = uncertainty_ellipsoid + self._confidence = confidence + self._v_confidence = v_confidence + + @classmethod + def from_dict(cls, dikt) -> 'Local3dPointUncertaintyEllipsoid': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The Local3dPointUncertaintyEllipsoid of this Local3dPointUncertaintyEllipsoid. # noqa: E501 + :rtype: Local3dPointUncertaintyEllipsoid + """ + return util.deserialize_model(dikt, cls) + + @property + def shape(self) -> SupportedGADShapes: + """Gets the shape of this Local3dPointUncertaintyEllipsoid. + + + :return: The shape of this Local3dPointUncertaintyEllipsoid. + :rtype: SupportedGADShapes + """ + return self._shape + + @shape.setter + def shape(self, shape: SupportedGADShapes): + """Sets the shape of this Local3dPointUncertaintyEllipsoid. + + + :param shape: The shape of this Local3dPointUncertaintyEllipsoid. + :type shape: SupportedGADShapes + """ + if shape is None: + raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 + + self._shape = shape + + @property + def local_origin(self) -> LocalOrigin: + """Gets the local_origin of this Local3dPointUncertaintyEllipsoid. + + + :return: The local_origin of this Local3dPointUncertaintyEllipsoid. + :rtype: LocalOrigin + """ + return self._local_origin + + @local_origin.setter + def local_origin(self, local_origin: LocalOrigin): + """Sets the local_origin of this Local3dPointUncertaintyEllipsoid. + + + :param local_origin: The local_origin of this Local3dPointUncertaintyEllipsoid. + :type local_origin: LocalOrigin + """ + if local_origin is None: + raise ValueError("Invalid value for `local_origin`, must not be `None`") # noqa: E501 + + self._local_origin = local_origin + + @property + def point(self) -> RelativeCartesianLocation: + """Gets the point of this Local3dPointUncertaintyEllipsoid. + + + :return: The point of this Local3dPointUncertaintyEllipsoid. + :rtype: RelativeCartesianLocation + """ + return self._point + + @point.setter + def point(self, point: RelativeCartesianLocation): + """Sets the point of this Local3dPointUncertaintyEllipsoid. + + + :param point: The point of this Local3dPointUncertaintyEllipsoid. + :type point: RelativeCartesianLocation + """ + if point is None: + raise ValueError("Invalid value for `point`, must not be `None`") # noqa: E501 + + self._point = point + + @property + def uncertainty_ellipsoid(self) -> UncertaintyEllipsoid: + """Gets the uncertainty_ellipsoid of this Local3dPointUncertaintyEllipsoid. + + + :return: The uncertainty_ellipsoid of this Local3dPointUncertaintyEllipsoid. + :rtype: UncertaintyEllipsoid + """ + return self._uncertainty_ellipsoid + + @uncertainty_ellipsoid.setter + def uncertainty_ellipsoid(self, uncertainty_ellipsoid: UncertaintyEllipsoid): + """Sets the uncertainty_ellipsoid of this Local3dPointUncertaintyEllipsoid. + + + :param uncertainty_ellipsoid: The uncertainty_ellipsoid of this Local3dPointUncertaintyEllipsoid. + :type uncertainty_ellipsoid: UncertaintyEllipsoid + """ + if uncertainty_ellipsoid is None: + raise ValueError("Invalid value for `uncertainty_ellipsoid`, must not be `None`") # noqa: E501 + + self._uncertainty_ellipsoid = uncertainty_ellipsoid + + @property + def confidence(self) -> int: + """Gets the confidence of this Local3dPointUncertaintyEllipsoid. + + Indicates value of confidence. # noqa: E501 + + :return: The confidence of this Local3dPointUncertaintyEllipsoid. + :rtype: int + """ + return self._confidence + + @confidence.setter + def confidence(self, confidence: int): + """Sets the confidence of this Local3dPointUncertaintyEllipsoid. + + Indicates value of confidence. # noqa: E501 + + :param confidence: The confidence of this Local3dPointUncertaintyEllipsoid. + :type confidence: int + """ + if confidence is None: + raise ValueError("Invalid value for `confidence`, must not be `None`") # noqa: E501 + if confidence is not None and confidence > 100: # noqa: E501 + raise ValueError("Invalid value for `confidence`, must be a value less than or equal to `100`") # noqa: E501 + if confidence is not None and confidence < 0: # noqa: E501 + raise ValueError("Invalid value for `confidence`, must be a value greater than or equal to `0`") # noqa: E501 + + self._confidence = confidence + + @property + def v_confidence(self) -> int: + """Gets the v_confidence of this Local3dPointUncertaintyEllipsoid. + + Indicates value of confidence. # noqa: E501 + + :return: The v_confidence of this Local3dPointUncertaintyEllipsoid. + :rtype: int + """ + return self._v_confidence + + @v_confidence.setter + def v_confidence(self, v_confidence: int): + """Sets the v_confidence of this Local3dPointUncertaintyEllipsoid. + + Indicates value of confidence. # noqa: E501 + + :param v_confidence: The v_confidence of this Local3dPointUncertaintyEllipsoid. + :type v_confidence: int + """ + if v_confidence is not None and v_confidence > 100: # noqa: E501 + raise ValueError("Invalid value for `v_confidence`, must be a value less than or equal to `100`") # noqa: E501 + if v_confidence is not None and v_confidence < 0: # noqa: E501 + raise ValueError("Invalid value for `v_confidence`, must be a value greater than or equal to `0`") # noqa: E501 + + self._v_confidence = v_confidence diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/local_origin.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/local_origin.py new file mode 100644 index 0000000000000000000000000000000000000000..75df97d1c46a7033184fdf530d3837a07f77086e --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/local_origin.py @@ -0,0 +1,149 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from openapi_server import util +from openapi_server.models.base_model import Model +from openapi_server.models.geographic_area import GeographicArea # noqa: E501 +from openapi_server.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 + + +class LocalOrigin(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, coordinate_id=None, point=None, area=None, horiz_axes_orientation=None): # noqa: E501 + """LocalOrigin - a model defined in OpenAPI + + :param coordinate_id: The coordinate_id of this LocalOrigin. # noqa: E501 + :type coordinate_id: str + :param point: The point of this LocalOrigin. # noqa: E501 + :type point: GeographicalCoordinates + :param area: The area of this LocalOrigin. # noqa: E501 + :type area: GeographicArea + :param horiz_axes_orientation: The horiz_axes_orientation of this LocalOrigin. # noqa: E501 + :type horiz_axes_orientation: int + """ + self.openapi_types = { + 'coordinate_id': str, + 'point': GeographicalCoordinates, + 'area': GeographicArea, + 'horiz_axes_orientation': int + } + + self.attribute_map = { + 'coordinate_id': 'coordinateId', + 'point': 'point', + 'area': 'area', + 'horiz_axes_orientation': 'horizAxesOrientation' + } + + self._coordinate_id = coordinate_id + self._point = point + self._area = area + self._horiz_axes_orientation = horiz_axes_orientation + + @classmethod + def from_dict(cls, dikt) -> 'LocalOrigin': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The LocalOrigin of this LocalOrigin. # noqa: E501 + :rtype: LocalOrigin + """ + return util.deserialize_model(dikt, cls) + + @property + def coordinate_id(self) -> str: + """Gets the coordinate_id of this LocalOrigin. + + + :return: The coordinate_id of this LocalOrigin. + :rtype: str + """ + return self._coordinate_id + + @coordinate_id.setter + def coordinate_id(self, coordinate_id: str): + """Sets the coordinate_id of this LocalOrigin. + + + :param coordinate_id: The coordinate_id of this LocalOrigin. + :type coordinate_id: str + """ + if coordinate_id is None: + raise ValueError("Invalid value for `coordinate_id`, must not be `None`") # noqa: E501 + + self._coordinate_id = coordinate_id + + @property + def point(self) -> GeographicalCoordinates: + """Gets the point of this LocalOrigin. + + + :return: The point of this LocalOrigin. + :rtype: GeographicalCoordinates + """ + return self._point + + @point.setter + def point(self, point: GeographicalCoordinates): + """Sets the point of this LocalOrigin. + + + :param point: The point of this LocalOrigin. + :type point: GeographicalCoordinates + """ + + self._point = point + + @property + def area(self) -> GeographicArea: + """Gets the area of this LocalOrigin. + + + :return: The area of this LocalOrigin. + :rtype: GeographicArea + """ + return self._area + + @area.setter + def area(self, area: GeographicArea): + """Sets the area of this LocalOrigin. + + + :param area: The area of this LocalOrigin. + :type area: GeographicArea + """ + + self._area = area + + @property + def horiz_axes_orientation(self) -> int: + """Gets the horiz_axes_orientation of this LocalOrigin. + + Horizontal axes orientation angle clockwise from northing in 0.1 degrees. # noqa: E501 + + :return: The horiz_axes_orientation of this LocalOrigin. + :rtype: int + """ + return self._horiz_axes_orientation + + @horiz_axes_orientation.setter + def horiz_axes_orientation(self, horiz_axes_orientation: int): + """Sets the horiz_axes_orientation of this LocalOrigin. + + Horizontal axes orientation angle clockwise from northing in 0.1 degrees. # noqa: E501 + + :param horiz_axes_orientation: The horiz_axes_orientation of this LocalOrigin. + :type horiz_axes_orientation: int + """ + if horiz_axes_orientation is not None and horiz_axes_orientation > 3600: # noqa: E501 + raise ValueError("Invalid value for `horiz_axes_orientation`, must be a value less than or equal to `3600`") # noqa: E501 + if horiz_axes_orientation is not None and horiz_axes_orientation < 0: # noqa: E501 + raise ValueError("Invalid value for `horiz_axes_orientation`, must be a value greater than or equal to `0`") # noqa: E501 + + self._horiz_axes_orientation = horiz_axes_orientation diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/open_aef_profile.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/open_aef_profile.py new file mode 100644 index 0000000000000000000000000000000000000000..24bcc454eefbc31eea8d44e7345c97f2a51a4260 --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/open_aef_profile.py @@ -0,0 +1,197 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from openapi_server import util +from openapi_server.models.aef_location import AefLocation # noqa: E501 +from openapi_server.models.base_model import Model +from openapi_server.models.data_format import DataFormat # noqa: E501 +from openapi_server.models.protocol import Protocol # noqa: E501 +from openapi_server.models.service_kpis import ServiceKpis # noqa: E501 +from openapi_server.models.version import Version # noqa: E501 + + +class OpenAefProfile(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, aef_id=None, versions=None, protocol=None, data_format=None, aef_location=None, service_kpis=None): # noqa: E501 + """OpenAefProfile - a model defined in OpenAPI + + :param aef_id: The aef_id of this OpenAefProfile. # noqa: E501 + :type aef_id: str + :param versions: The versions of this OpenAefProfile. # noqa: E501 + :type versions: List[Version] + :param protocol: The protocol of this OpenAefProfile. # noqa: E501 + :type protocol: Protocol + :param data_format: The data_format of this OpenAefProfile. # noqa: E501 + :type data_format: DataFormat + :param aef_location: The aef_location of this OpenAefProfile. # noqa: E501 + :type aef_location: AefLocation + :param service_kpis: The service_kpis of this OpenAefProfile. # noqa: E501 + :type service_kpis: ServiceKpis + """ + self.openapi_types = { + 'aef_id': str, + 'versions': List[Version], + 'protocol': Protocol, + 'data_format': DataFormat, + 'aef_location': AefLocation, + 'service_kpis': ServiceKpis + } + + self.attribute_map = { + 'aef_id': 'aefId', + 'versions': 'versions', + 'protocol': 'protocol', + 'data_format': 'dataFormat', + 'aef_location': 'aefLocation', + 'service_kpis': 'serviceKpis' + } + + self._aef_id = aef_id + self._versions = versions + self._protocol = protocol + self._data_format = data_format + self._aef_location = aef_location + self._service_kpis = service_kpis + + @classmethod + def from_dict(cls, dikt) -> 'OpenAefProfile': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The OpenAefProfile of this OpenAefProfile. # noqa: E501 + :rtype: OpenAefProfile + """ + return util.deserialize_model(dikt, cls) + + @property + def aef_id(self) -> str: + """Gets the aef_id of this OpenAefProfile. + + + :return: The aef_id of this OpenAefProfile. + :rtype: str + """ + return self._aef_id + + @aef_id.setter + def aef_id(self, aef_id: str): + """Sets the aef_id of this OpenAefProfile. + + + :param aef_id: The aef_id of this OpenAefProfile. + :type aef_id: str + """ + + self._aef_id = aef_id + + @property + def versions(self) -> List[Version]: + """Gets the versions of this OpenAefProfile. + + + :return: The versions of this OpenAefProfile. + :rtype: List[Version] + """ + return self._versions + + @versions.setter + def versions(self, versions: List[Version]): + """Sets the versions of this OpenAefProfile. + + + :param versions: The versions of this OpenAefProfile. + :type versions: List[Version] + """ + if versions is not None and len(versions) < 1: + raise ValueError("Invalid value for `versions`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._versions = versions + + @property + def protocol(self) -> Protocol: + """Gets the protocol of this OpenAefProfile. + + + :return: The protocol of this OpenAefProfile. + :rtype: Protocol + """ + return self._protocol + + @protocol.setter + def protocol(self, protocol: Protocol): + """Sets the protocol of this OpenAefProfile. + + + :param protocol: The protocol of this OpenAefProfile. + :type protocol: Protocol + """ + + self._protocol = protocol + + @property + def data_format(self) -> DataFormat: + """Gets the data_format of this OpenAefProfile. + + + :return: The data_format of this OpenAefProfile. + :rtype: DataFormat + """ + return self._data_format + + @data_format.setter + def data_format(self, data_format: DataFormat): + """Sets the data_format of this OpenAefProfile. + + + :param data_format: The data_format of this OpenAefProfile. + :type data_format: DataFormat + """ + + self._data_format = data_format + + @property + def aef_location(self) -> AefLocation: + """Gets the aef_location of this OpenAefProfile. + + + :return: The aef_location of this OpenAefProfile. + :rtype: AefLocation + """ + return self._aef_location + + @aef_location.setter + def aef_location(self, aef_location: AefLocation): + """Sets the aef_location of this OpenAefProfile. + + + :param aef_location: The aef_location of this OpenAefProfile. + :type aef_location: AefLocation + """ + + self._aef_location = aef_location + + @property + def service_kpis(self) -> ServiceKpis: + """Gets the service_kpis of this OpenAefProfile. + + + :return: The service_kpis of this OpenAefProfile. + :rtype: ServiceKpis + """ + return self._service_kpis + + @service_kpis.setter + def service_kpis(self, service_kpis: ServiceKpis): + """Sets the service_kpis of this OpenAefProfile. + + + :param service_kpis: The service_kpis of this OpenAefProfile. + :type service_kpis: ServiceKpis + """ + + self._service_kpis = service_kpis diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/open_api_details.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/open_api_details.py new file mode 100644 index 0000000000000000000000000000000000000000..a01eb66facc2e00218d276ec6005bb490ad52b5d --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/open_api_details.py @@ -0,0 +1,253 @@ +import re # noqa: E501 +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from openapi_server import util +from openapi_server.models.api_status import ApiStatus # noqa: E501 +from openapi_server.models.base_model import Model +from openapi_server.models.open_aef_profile import OpenAefProfile # noqa: E501 + + +class OpenAPIDetails(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, api_name=None, api_id=None, api_status=None, description=None, service_api_category=None, api_supp_feats=None, api_prov_name=None, aef_profiles=None): # noqa: E501 + """OpenAPIDetails - a model defined in OpenAPI + + :param api_name: The api_name of this OpenAPIDetails. # noqa: E501 + :type api_name: str + :param api_id: The api_id of this OpenAPIDetails. # noqa: E501 + :type api_id: str + :param api_status: The api_status of this OpenAPIDetails. # noqa: E501 + :type api_status: ApiStatus + :param description: The description of this OpenAPIDetails. # noqa: E501 + :type description: str + :param service_api_category: The service_api_category of this OpenAPIDetails. # noqa: E501 + :type service_api_category: str + :param api_supp_feats: The api_supp_feats of this OpenAPIDetails. # noqa: E501 + :type api_supp_feats: str + :param api_prov_name: The api_prov_name of this OpenAPIDetails. # noqa: E501 + :type api_prov_name: str + :param aef_profiles: The aef_profiles of this OpenAPIDetails. # noqa: E501 + :type aef_profiles: List[OpenAefProfile] + """ + self.openapi_types = { + 'api_name': str, + 'api_id': str, + 'api_status': ApiStatus, + 'description': str, + 'service_api_category': str, + 'api_supp_feats': str, + 'api_prov_name': str, + 'aef_profiles': List[OpenAefProfile] + } + + self.attribute_map = { + 'api_name': 'apiName', + 'api_id': 'apiId', + 'api_status': 'apiStatus', + 'description': 'description', + 'service_api_category': 'serviceAPICategory', + 'api_supp_feats': 'apiSuppFeats', + 'api_prov_name': 'apiProvName', + 'aef_profiles': 'aefProfiles' + } + + self._api_name = api_name + self._api_id = api_id + self._api_status = api_status + self._description = description + self._service_api_category = service_api_category + self._api_supp_feats = api_supp_feats + self._api_prov_name = api_prov_name + self._aef_profiles = aef_profiles + + @classmethod + def from_dict(cls, dikt) -> 'OpenAPIDetails': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The OpenAPIDetails of this OpenAPIDetails. # noqa: E501 + :rtype: OpenAPIDetails + """ + return util.deserialize_model(dikt, cls) + + @property + def api_name(self) -> str: + """Gets the api_name of this OpenAPIDetails. + + + :return: The api_name of this OpenAPIDetails. + :rtype: str + """ + return self._api_name + + @api_name.setter + def api_name(self, api_name: str): + """Sets the api_name of this OpenAPIDetails. + + + :param api_name: The api_name of this OpenAPIDetails. + :type api_name: str + """ + if api_name is None: + raise ValueError("Invalid value for `api_name`, must not be `None`") # noqa: E501 + + self._api_name = api_name + + @property + def api_id(self) -> str: + """Gets the api_id of this OpenAPIDetails. + + + :return: The api_id of this OpenAPIDetails. + :rtype: str + """ + return self._api_id + + @api_id.setter + def api_id(self, api_id: str): + """Sets the api_id of this OpenAPIDetails. + + + :param api_id: The api_id of this OpenAPIDetails. + :type api_id: str + """ + + self._api_id = api_id + + @property + def api_status(self) -> ApiStatus: + """Gets the api_status of this OpenAPIDetails. + + + :return: The api_status of this OpenAPIDetails. + :rtype: ApiStatus + """ + return self._api_status + + @api_status.setter + def api_status(self, api_status: ApiStatus): + """Sets the api_status of this OpenAPIDetails. + + + :param api_status: The api_status of this OpenAPIDetails. + :type api_status: ApiStatus + """ + + self._api_status = api_status + + @property + def description(self) -> str: + """Gets the description of this OpenAPIDetails. + + + :return: The description of this OpenAPIDetails. + :rtype: str + """ + return self._description + + @description.setter + def description(self, description: str): + """Sets the description of this OpenAPIDetails. + + + :param description: The description of this OpenAPIDetails. + :type description: str + """ + + self._description = description + + @property + def service_api_category(self) -> str: + """Gets the service_api_category of this OpenAPIDetails. + + + :return: The service_api_category of this OpenAPIDetails. + :rtype: str + """ + return self._service_api_category + + @service_api_category.setter + def service_api_category(self, service_api_category: str): + """Sets the service_api_category of this OpenAPIDetails. + + + :param service_api_category: The service_api_category of this OpenAPIDetails. + :type service_api_category: str + """ + + self._service_api_category = service_api_category + + @property + def api_supp_feats(self) -> str: + """Gets the api_supp_feats of this OpenAPIDetails. + + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. # noqa: E501 + + :return: The api_supp_feats of this OpenAPIDetails. + :rtype: str + """ + return self._api_supp_feats + + @api_supp_feats.setter + def api_supp_feats(self, api_supp_feats: str): + """Sets the api_supp_feats of this OpenAPIDetails. + + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. # noqa: E501 + + :param api_supp_feats: The api_supp_feats of this OpenAPIDetails. + :type api_supp_feats: str + """ + if api_supp_feats is not None and not re.search(r'^[A-Fa-f0-9]*$', api_supp_feats): # noqa: E501 + raise ValueError(r"Invalid value for `api_supp_feats`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + + self._api_supp_feats = api_supp_feats + + @property + def api_prov_name(self) -> str: + """Gets the api_prov_name of this OpenAPIDetails. + + + :return: The api_prov_name of this OpenAPIDetails. + :rtype: str + """ + return self._api_prov_name + + @api_prov_name.setter + def api_prov_name(self, api_prov_name: str): + """Sets the api_prov_name of this OpenAPIDetails. + + + :param api_prov_name: The api_prov_name of this OpenAPIDetails. + :type api_prov_name: str + """ + + self._api_prov_name = api_prov_name + + @property + def aef_profiles(self) -> List[OpenAefProfile]: + """Gets the aef_profiles of this OpenAPIDetails. + + + :return: The aef_profiles of this OpenAPIDetails. + :rtype: List[OpenAefProfile] + """ + return self._aef_profiles + + @aef_profiles.setter + def aef_profiles(self, aef_profiles: List[OpenAefProfile]): + """Sets the aef_profiles of this OpenAPIDetails. + + + :param aef_profiles: The aef_profiles of this OpenAPIDetails. + :type aef_profiles: List[OpenAefProfile] + """ + if aef_profiles is not None and len(aef_profiles) < 1: + raise ValueError("Invalid value for `aef_profiles`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._aef_profiles = aef_profiles diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/open_discovery_resp.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/open_discovery_resp.py new file mode 100644 index 0000000000000000000000000000000000000000..cf16e8c836a20d384a61d8986109798c3218406f --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/open_discovery_resp.py @@ -0,0 +1,96 @@ +import re # noqa: E501 +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from openapi_server import util +from openapi_server.models.base_model import Model +from openapi_server.models.open_api_details import OpenAPIDetails # noqa: E501 + + +class OpenDiscoveryResp(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, disc_apis=None, supp_feat=None): # noqa: E501 + """OpenDiscoveryResp - a model defined in OpenAPI + + :param disc_apis: The disc_apis of this OpenDiscoveryResp. # noqa: E501 + :type disc_apis: List[OpenAPIDetails] + :param supp_feat: The supp_feat of this OpenDiscoveryResp. # noqa: E501 + :type supp_feat: str + """ + self.openapi_types = { + 'disc_apis': List[OpenAPIDetails], + 'supp_feat': str + } + + self.attribute_map = { + 'disc_apis': 'discApis', + 'supp_feat': 'suppFeat' + } + + self._disc_apis = disc_apis + self._supp_feat = supp_feat + + @classmethod + def from_dict(cls, dikt) -> 'OpenDiscoveryResp': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The OpenDiscoveryResp of this OpenDiscoveryResp. # noqa: E501 + :rtype: OpenDiscoveryResp + """ + return util.deserialize_model(dikt, cls) + + @property + def disc_apis(self) -> List[OpenAPIDetails]: + """Gets the disc_apis of this OpenDiscoveryResp. + + + :return: The disc_apis of this OpenDiscoveryResp. + :rtype: List[OpenAPIDetails] + """ + return self._disc_apis + + @disc_apis.setter + def disc_apis(self, disc_apis: List[OpenAPIDetails]): + """Sets the disc_apis of this OpenDiscoveryResp. + + + :param disc_apis: The disc_apis of this OpenDiscoveryResp. + :type disc_apis: List[OpenAPIDetails] + """ + if disc_apis is None: + raise ValueError("Invalid value for `disc_apis`, must not be `None`") # noqa: E501 + if disc_apis is not None and len(disc_apis) < 0: + raise ValueError("Invalid value for `disc_apis`, number of items must be greater than or equal to `0`") # noqa: E501 + + self._disc_apis = disc_apis + + @property + def supp_feat(self) -> str: + """Gets the supp_feat of this OpenDiscoveryResp. + + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. # noqa: E501 + + :return: The supp_feat of this OpenDiscoveryResp. + :rtype: str + """ + return self._supp_feat + + @supp_feat.setter + def supp_feat(self, supp_feat: str): + """Sets the supp_feat of this OpenDiscoveryResp. + + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. # noqa: E501 + + :param supp_feat: The supp_feat of this OpenDiscoveryResp. + :type supp_feat: str + """ + if supp_feat is not None and not re.search(r'^[A-Fa-f0-9]*$', supp_feat): # noqa: E501 + raise ValueError(r"Invalid value for `supp_feat`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + + self._supp_feat = supp_feat diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/operation.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/operation.py new file mode 100644 index 0000000000000000000000000000000000000000..0b44da1520e13739b4ca60b05fce9b48557adecf --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/operation.py @@ -0,0 +1,33 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from openapi_server import util +from openapi_server.models.base_model import Model + + +class Operation(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self): # noqa: E501 + """Operation - a model defined in OpenAPI + + """ + self.openapi_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'Operation': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The Operation of this Operation. # noqa: E501 + :rtype: Operation + """ + return util.deserialize_model(dikt, cls) diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/point.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/point.py new file mode 100644 index 0000000000000000000000000000000000000000..4d45a0c1618735b71f5010e3049d826f6a805259 --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/point.py @@ -0,0 +1,95 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from openapi_server import util +from openapi_server.models.base_model import Model +from openapi_server.models.gad_shape import GADShape # noqa: E501 +from openapi_server.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from openapi_server.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 + + +class Point(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, shape=None, point=None): # noqa: E501 + """Point - a model defined in OpenAPI + + :param shape: The shape of this Point. # noqa: E501 + :type shape: SupportedGADShapes + :param point: The point of this Point. # noqa: E501 + :type point: GeographicalCoordinates + """ + self.openapi_types = { + 'shape': SupportedGADShapes, + 'point': GeographicalCoordinates + } + + self.attribute_map = { + 'shape': 'shape', + 'point': 'point' + } + + self._shape = shape + self._point = point + + @classmethod + def from_dict(cls, dikt) -> 'Point': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The Point of this Point. # noqa: E501 + :rtype: Point + """ + return util.deserialize_model(dikt, cls) + + @property + def shape(self) -> SupportedGADShapes: + """Gets the shape of this Point. + + + :return: The shape of this Point. + :rtype: SupportedGADShapes + """ + return self._shape + + @shape.setter + def shape(self, shape: SupportedGADShapes): + """Sets the shape of this Point. + + + :param shape: The shape of this Point. + :type shape: SupportedGADShapes + """ + if shape is None: + raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 + + self._shape = shape + + @property + def point(self) -> GeographicalCoordinates: + """Gets the point of this Point. + + + :return: The point of this Point. + :rtype: GeographicalCoordinates + """ + return self._point + + @point.setter + def point(self, point: GeographicalCoordinates): + """Sets the point of this Point. + + + :param point: The point of this Point. + :type point: GeographicalCoordinates + """ + if point is None: + raise ValueError("Invalid value for `point`, must not be `None`") # noqa: E501 + + self._point = point diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/point_altitude.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/point_altitude.py new file mode 100644 index 0000000000000000000000000000000000000000..13acf21e04678fb441ba0003086b3eec28f4d61d --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/point_altitude.py @@ -0,0 +1,129 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from openapi_server import util +from openapi_server.models.base_model import Model +from openapi_server.models.gad_shape import GADShape # noqa: E501 +from openapi_server.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from openapi_server.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 + + +class PointAltitude(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, shape=None, point=None, altitude=None): # noqa: E501 + """PointAltitude - a model defined in OpenAPI + + :param shape: The shape of this PointAltitude. # noqa: E501 + :type shape: SupportedGADShapes + :param point: The point of this PointAltitude. # noqa: E501 + :type point: GeographicalCoordinates + :param altitude: The altitude of this PointAltitude. # noqa: E501 + :type altitude: float + """ + self.openapi_types = { + 'shape': SupportedGADShapes, + 'point': GeographicalCoordinates, + 'altitude': float + } + + self.attribute_map = { + 'shape': 'shape', + 'point': 'point', + 'altitude': 'altitude' + } + + self._shape = shape + self._point = point + self._altitude = altitude + + @classmethod + def from_dict(cls, dikt) -> 'PointAltitude': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The PointAltitude of this PointAltitude. # noqa: E501 + :rtype: PointAltitude + """ + return util.deserialize_model(dikt, cls) + + @property + def shape(self) -> SupportedGADShapes: + """Gets the shape of this PointAltitude. + + + :return: The shape of this PointAltitude. + :rtype: SupportedGADShapes + """ + return self._shape + + @shape.setter + def shape(self, shape: SupportedGADShapes): + """Sets the shape of this PointAltitude. + + + :param shape: The shape of this PointAltitude. + :type shape: SupportedGADShapes + """ + if shape is None: + raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 + + self._shape = shape + + @property + def point(self) -> GeographicalCoordinates: + """Gets the point of this PointAltitude. + + + :return: The point of this PointAltitude. + :rtype: GeographicalCoordinates + """ + return self._point + + @point.setter + def point(self, point: GeographicalCoordinates): + """Sets the point of this PointAltitude. + + + :param point: The point of this PointAltitude. + :type point: GeographicalCoordinates + """ + if point is None: + raise ValueError("Invalid value for `point`, must not be `None`") # noqa: E501 + + self._point = point + + @property + def altitude(self) -> float: + """Gets the altitude of this PointAltitude. + + Indicates value of altitude. # noqa: E501 + + :return: The altitude of this PointAltitude. + :rtype: float + """ + return self._altitude + + @altitude.setter + def altitude(self, altitude: float): + """Sets the altitude of this PointAltitude. + + Indicates value of altitude. # noqa: E501 + + :param altitude: The altitude of this PointAltitude. + :type altitude: float + """ + if altitude is None: + raise ValueError("Invalid value for `altitude`, must not be `None`") # noqa: E501 + if altitude is not None and altitude > 32767: # noqa: E501 + raise ValueError("Invalid value for `altitude`, must be a value less than or equal to `32767`") # noqa: E501 + if altitude is not None and altitude < -32767: # noqa: E501 + raise ValueError("Invalid value for `altitude`, must be a value greater than or equal to `-32767`") # noqa: E501 + + self._altitude = altitude diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/point_altitude_uncertainty.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/point_altitude_uncertainty.py new file mode 100644 index 0000000000000000000000000000000000000000..b3cbd4e803f21d03b88e3dd8b826e33a1b5741f0 --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/point_altitude_uncertainty.py @@ -0,0 +1,257 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from openapi_server import util +from openapi_server.models.base_model import Model +from openapi_server.models.gad_shape import GADShape # noqa: E501 +from openapi_server.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from openapi_server.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 +from openapi_server.models.uncertainty_ellipse import \ + UncertaintyEllipse # noqa: E501 + + +class PointAltitudeUncertainty(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, shape=None, point=None, altitude=None, uncertainty_ellipse=None, uncertainty_altitude=None, confidence=None, v_confidence=None): # noqa: E501 + """PointAltitudeUncertainty - a model defined in OpenAPI + + :param shape: The shape of this PointAltitudeUncertainty. # noqa: E501 + :type shape: SupportedGADShapes + :param point: The point of this PointAltitudeUncertainty. # noqa: E501 + :type point: GeographicalCoordinates + :param altitude: The altitude of this PointAltitudeUncertainty. # noqa: E501 + :type altitude: float + :param uncertainty_ellipse: The uncertainty_ellipse of this PointAltitudeUncertainty. # noqa: E501 + :type uncertainty_ellipse: UncertaintyEllipse + :param uncertainty_altitude: The uncertainty_altitude of this PointAltitudeUncertainty. # noqa: E501 + :type uncertainty_altitude: float + :param confidence: The confidence of this PointAltitudeUncertainty. # noqa: E501 + :type confidence: int + :param v_confidence: The v_confidence of this PointAltitudeUncertainty. # noqa: E501 + :type v_confidence: int + """ + self.openapi_types = { + 'shape': SupportedGADShapes, + 'point': GeographicalCoordinates, + 'altitude': float, + 'uncertainty_ellipse': UncertaintyEllipse, + 'uncertainty_altitude': float, + 'confidence': int, + 'v_confidence': int + } + + self.attribute_map = { + 'shape': 'shape', + 'point': 'point', + 'altitude': 'altitude', + 'uncertainty_ellipse': 'uncertaintyEllipse', + 'uncertainty_altitude': 'uncertaintyAltitude', + 'confidence': 'confidence', + 'v_confidence': 'vConfidence' + } + + self._shape = shape + self._point = point + self._altitude = altitude + self._uncertainty_ellipse = uncertainty_ellipse + self._uncertainty_altitude = uncertainty_altitude + self._confidence = confidence + self._v_confidence = v_confidence + + @classmethod + def from_dict(cls, dikt) -> 'PointAltitudeUncertainty': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The PointAltitudeUncertainty of this PointAltitudeUncertainty. # noqa: E501 + :rtype: PointAltitudeUncertainty + """ + return util.deserialize_model(dikt, cls) + + @property + def shape(self) -> SupportedGADShapes: + """Gets the shape of this PointAltitudeUncertainty. + + + :return: The shape of this PointAltitudeUncertainty. + :rtype: SupportedGADShapes + """ + return self._shape + + @shape.setter + def shape(self, shape: SupportedGADShapes): + """Sets the shape of this PointAltitudeUncertainty. + + + :param shape: The shape of this PointAltitudeUncertainty. + :type shape: SupportedGADShapes + """ + if shape is None: + raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 + + self._shape = shape + + @property + def point(self) -> GeographicalCoordinates: + """Gets the point of this PointAltitudeUncertainty. + + + :return: The point of this PointAltitudeUncertainty. + :rtype: GeographicalCoordinates + """ + return self._point + + @point.setter + def point(self, point: GeographicalCoordinates): + """Sets the point of this PointAltitudeUncertainty. + + + :param point: The point of this PointAltitudeUncertainty. + :type point: GeographicalCoordinates + """ + if point is None: + raise ValueError("Invalid value for `point`, must not be `None`") # noqa: E501 + + self._point = point + + @property + def altitude(self) -> float: + """Gets the altitude of this PointAltitudeUncertainty. + + Indicates value of altitude. # noqa: E501 + + :return: The altitude of this PointAltitudeUncertainty. + :rtype: float + """ + return self._altitude + + @altitude.setter + def altitude(self, altitude: float): + """Sets the altitude of this PointAltitudeUncertainty. + + Indicates value of altitude. # noqa: E501 + + :param altitude: The altitude of this PointAltitudeUncertainty. + :type altitude: float + """ + if altitude is None: + raise ValueError("Invalid value for `altitude`, must not be `None`") # noqa: E501 + if altitude is not None and altitude > 32767: # noqa: E501 + raise ValueError("Invalid value for `altitude`, must be a value less than or equal to `32767`") # noqa: E501 + if altitude is not None and altitude < -32767: # noqa: E501 + raise ValueError("Invalid value for `altitude`, must be a value greater than or equal to `-32767`") # noqa: E501 + + self._altitude = altitude + + @property + def uncertainty_ellipse(self) -> UncertaintyEllipse: + """Gets the uncertainty_ellipse of this PointAltitudeUncertainty. + + + :return: The uncertainty_ellipse of this PointAltitudeUncertainty. + :rtype: UncertaintyEllipse + """ + return self._uncertainty_ellipse + + @uncertainty_ellipse.setter + def uncertainty_ellipse(self, uncertainty_ellipse: UncertaintyEllipse): + """Sets the uncertainty_ellipse of this PointAltitudeUncertainty. + + + :param uncertainty_ellipse: The uncertainty_ellipse of this PointAltitudeUncertainty. + :type uncertainty_ellipse: UncertaintyEllipse + """ + if uncertainty_ellipse is None: + raise ValueError("Invalid value for `uncertainty_ellipse`, must not be `None`") # noqa: E501 + + self._uncertainty_ellipse = uncertainty_ellipse + + @property + def uncertainty_altitude(self) -> float: + """Gets the uncertainty_altitude of this PointAltitudeUncertainty. + + Indicates value of uncertainty. # noqa: E501 + + :return: The uncertainty_altitude of this PointAltitudeUncertainty. + :rtype: float + """ + return self._uncertainty_altitude + + @uncertainty_altitude.setter + def uncertainty_altitude(self, uncertainty_altitude: float): + """Sets the uncertainty_altitude of this PointAltitudeUncertainty. + + Indicates value of uncertainty. # noqa: E501 + + :param uncertainty_altitude: The uncertainty_altitude of this PointAltitudeUncertainty. + :type uncertainty_altitude: float + """ + if uncertainty_altitude is None: + raise ValueError("Invalid value for `uncertainty_altitude`, must not be `None`") # noqa: E501 + if uncertainty_altitude is not None and uncertainty_altitude < 0: # noqa: E501 + raise ValueError("Invalid value for `uncertainty_altitude`, must be a value greater than or equal to `0`") # noqa: E501 + + self._uncertainty_altitude = uncertainty_altitude + + @property + def confidence(self) -> int: + """Gets the confidence of this PointAltitudeUncertainty. + + Indicates value of confidence. # noqa: E501 + + :return: The confidence of this PointAltitudeUncertainty. + :rtype: int + """ + return self._confidence + + @confidence.setter + def confidence(self, confidence: int): + """Sets the confidence of this PointAltitudeUncertainty. + + Indicates value of confidence. # noqa: E501 + + :param confidence: The confidence of this PointAltitudeUncertainty. + :type confidence: int + """ + if confidence is None: + raise ValueError("Invalid value for `confidence`, must not be `None`") # noqa: E501 + if confidence is not None and confidence > 100: # noqa: E501 + raise ValueError("Invalid value for `confidence`, must be a value less than or equal to `100`") # noqa: E501 + if confidence is not None and confidence < 0: # noqa: E501 + raise ValueError("Invalid value for `confidence`, must be a value greater than or equal to `0`") # noqa: E501 + + self._confidence = confidence + + @property + def v_confidence(self) -> int: + """Gets the v_confidence of this PointAltitudeUncertainty. + + Indicates value of confidence. # noqa: E501 + + :return: The v_confidence of this PointAltitudeUncertainty. + :rtype: int + """ + return self._v_confidence + + @v_confidence.setter + def v_confidence(self, v_confidence: int): + """Sets the v_confidence of this PointAltitudeUncertainty. + + Indicates value of confidence. # noqa: E501 + + :param v_confidence: The v_confidence of this PointAltitudeUncertainty. + :type v_confidence: int + """ + if v_confidence is not None and v_confidence > 100: # noqa: E501 + raise ValueError("Invalid value for `v_confidence`, must be a value less than or equal to `100`") # noqa: E501 + if v_confidence is not None and v_confidence < 0: # noqa: E501 + raise ValueError("Invalid value for `v_confidence`, must be a value greater than or equal to `0`") # noqa: E501 + + self._v_confidence = v_confidence diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/point_uncertainty_circle.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/point_uncertainty_circle.py new file mode 100644 index 0000000000000000000000000000000000000000..9f1330ebbfc7719003b1cebb41dbb6492c2c8017 --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/point_uncertainty_circle.py @@ -0,0 +1,127 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from openapi_server import util +from openapi_server.models.base_model import Model +from openapi_server.models.gad_shape import GADShape # noqa: E501 +from openapi_server.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from openapi_server.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 + + +class PointUncertaintyCircle(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, shape=None, point=None, uncertainty=None): # noqa: E501 + """PointUncertaintyCircle - a model defined in OpenAPI + + :param shape: The shape of this PointUncertaintyCircle. # noqa: E501 + :type shape: SupportedGADShapes + :param point: The point of this PointUncertaintyCircle. # noqa: E501 + :type point: GeographicalCoordinates + :param uncertainty: The uncertainty of this PointUncertaintyCircle. # noqa: E501 + :type uncertainty: float + """ + self.openapi_types = { + 'shape': SupportedGADShapes, + 'point': GeographicalCoordinates, + 'uncertainty': float + } + + self.attribute_map = { + 'shape': 'shape', + 'point': 'point', + 'uncertainty': 'uncertainty' + } + + self._shape = shape + self._point = point + self._uncertainty = uncertainty + + @classmethod + def from_dict(cls, dikt) -> 'PointUncertaintyCircle': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The PointUncertaintyCircle of this PointUncertaintyCircle. # noqa: E501 + :rtype: PointUncertaintyCircle + """ + return util.deserialize_model(dikt, cls) + + @property + def shape(self) -> SupportedGADShapes: + """Gets the shape of this PointUncertaintyCircle. + + + :return: The shape of this PointUncertaintyCircle. + :rtype: SupportedGADShapes + """ + return self._shape + + @shape.setter + def shape(self, shape: SupportedGADShapes): + """Sets the shape of this PointUncertaintyCircle. + + + :param shape: The shape of this PointUncertaintyCircle. + :type shape: SupportedGADShapes + """ + if shape is None: + raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 + + self._shape = shape + + @property + def point(self) -> GeographicalCoordinates: + """Gets the point of this PointUncertaintyCircle. + + + :return: The point of this PointUncertaintyCircle. + :rtype: GeographicalCoordinates + """ + return self._point + + @point.setter + def point(self, point: GeographicalCoordinates): + """Sets the point of this PointUncertaintyCircle. + + + :param point: The point of this PointUncertaintyCircle. + :type point: GeographicalCoordinates + """ + if point is None: + raise ValueError("Invalid value for `point`, must not be `None`") # noqa: E501 + + self._point = point + + @property + def uncertainty(self) -> float: + """Gets the uncertainty of this PointUncertaintyCircle. + + Indicates value of uncertainty. # noqa: E501 + + :return: The uncertainty of this PointUncertaintyCircle. + :rtype: float + """ + return self._uncertainty + + @uncertainty.setter + def uncertainty(self, uncertainty: float): + """Sets the uncertainty of this PointUncertaintyCircle. + + Indicates value of uncertainty. # noqa: E501 + + :param uncertainty: The uncertainty of this PointUncertaintyCircle. + :type uncertainty: float + """ + if uncertainty is None: + raise ValueError("Invalid value for `uncertainty`, must not be `None`") # noqa: E501 + if uncertainty is not None and uncertainty < 0: # noqa: E501 + raise ValueError("Invalid value for `uncertainty`, must be a value greater than or equal to `0`") # noqa: E501 + + self._uncertainty = uncertainty diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/point_uncertainty_ellipse.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/point_uncertainty_ellipse.py new file mode 100644 index 0000000000000000000000000000000000000000..a0149b2984bd4a8a18c67bcf21ae23e888118d59 --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/point_uncertainty_ellipse.py @@ -0,0 +1,159 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from openapi_server import util +from openapi_server.models.base_model import Model +from openapi_server.models.gad_shape import GADShape # noqa: E501 +from openapi_server.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from openapi_server.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 +from openapi_server.models.uncertainty_ellipse import \ + UncertaintyEllipse # noqa: E501 + + +class PointUncertaintyEllipse(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, shape=None, point=None, uncertainty_ellipse=None, confidence=None): # noqa: E501 + """PointUncertaintyEllipse - a model defined in OpenAPI + + :param shape: The shape of this PointUncertaintyEllipse. # noqa: E501 + :type shape: SupportedGADShapes + :param point: The point of this PointUncertaintyEllipse. # noqa: E501 + :type point: GeographicalCoordinates + :param uncertainty_ellipse: The uncertainty_ellipse of this PointUncertaintyEllipse. # noqa: E501 + :type uncertainty_ellipse: UncertaintyEllipse + :param confidence: The confidence of this PointUncertaintyEllipse. # noqa: E501 + :type confidence: int + """ + self.openapi_types = { + 'shape': SupportedGADShapes, + 'point': GeographicalCoordinates, + 'uncertainty_ellipse': UncertaintyEllipse, + 'confidence': int + } + + self.attribute_map = { + 'shape': 'shape', + 'point': 'point', + 'uncertainty_ellipse': 'uncertaintyEllipse', + 'confidence': 'confidence' + } + + self._shape = shape + self._point = point + self._uncertainty_ellipse = uncertainty_ellipse + self._confidence = confidence + + @classmethod + def from_dict(cls, dikt) -> 'PointUncertaintyEllipse': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The PointUncertaintyEllipse of this PointUncertaintyEllipse. # noqa: E501 + :rtype: PointUncertaintyEllipse + """ + return util.deserialize_model(dikt, cls) + + @property + def shape(self) -> SupportedGADShapes: + """Gets the shape of this PointUncertaintyEllipse. + + + :return: The shape of this PointUncertaintyEllipse. + :rtype: SupportedGADShapes + """ + return self._shape + + @shape.setter + def shape(self, shape: SupportedGADShapes): + """Sets the shape of this PointUncertaintyEllipse. + + + :param shape: The shape of this PointUncertaintyEllipse. + :type shape: SupportedGADShapes + """ + if shape is None: + raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 + + self._shape = shape + + @property + def point(self) -> GeographicalCoordinates: + """Gets the point of this PointUncertaintyEllipse. + + + :return: The point of this PointUncertaintyEllipse. + :rtype: GeographicalCoordinates + """ + return self._point + + @point.setter + def point(self, point: GeographicalCoordinates): + """Sets the point of this PointUncertaintyEllipse. + + + :param point: The point of this PointUncertaintyEllipse. + :type point: GeographicalCoordinates + """ + if point is None: + raise ValueError("Invalid value for `point`, must not be `None`") # noqa: E501 + + self._point = point + + @property + def uncertainty_ellipse(self) -> UncertaintyEllipse: + """Gets the uncertainty_ellipse of this PointUncertaintyEllipse. + + + :return: The uncertainty_ellipse of this PointUncertaintyEllipse. + :rtype: UncertaintyEllipse + """ + return self._uncertainty_ellipse + + @uncertainty_ellipse.setter + def uncertainty_ellipse(self, uncertainty_ellipse: UncertaintyEllipse): + """Sets the uncertainty_ellipse of this PointUncertaintyEllipse. + + + :param uncertainty_ellipse: The uncertainty_ellipse of this PointUncertaintyEllipse. + :type uncertainty_ellipse: UncertaintyEllipse + """ + if uncertainty_ellipse is None: + raise ValueError("Invalid value for `uncertainty_ellipse`, must not be `None`") # noqa: E501 + + self._uncertainty_ellipse = uncertainty_ellipse + + @property + def confidence(self) -> int: + """Gets the confidence of this PointUncertaintyEllipse. + + Indicates value of confidence. # noqa: E501 + + :return: The confidence of this PointUncertaintyEllipse. + :rtype: int + """ + return self._confidence + + @confidence.setter + def confidence(self, confidence: int): + """Sets the confidence of this PointUncertaintyEllipse. + + Indicates value of confidence. # noqa: E501 + + :param confidence: The confidence of this PointUncertaintyEllipse. + :type confidence: int + """ + if confidence is None: + raise ValueError("Invalid value for `confidence`, must not be `None`") # noqa: E501 + if confidence is not None and confidence > 100: # noqa: E501 + raise ValueError("Invalid value for `confidence`, must be a value less than or equal to `100`") # noqa: E501 + if confidence is not None and confidence < 0: # noqa: E501 + raise ValueError("Invalid value for `confidence`, must be a value greater than or equal to `0`") # noqa: E501 + + self._confidence = confidence diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/polygon.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/polygon.py new file mode 100644 index 0000000000000000000000000000000000000000..34e16e8ea103f1e263d096988606f4b00400cb4a --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/polygon.py @@ -0,0 +1,101 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from openapi_server import util +from openapi_server.models.base_model import Model +from openapi_server.models.gad_shape import GADShape # noqa: E501 +from openapi_server.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from openapi_server.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 + + +class Polygon(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, shape=None, point_list=None): # noqa: E501 + """Polygon - a model defined in OpenAPI + + :param shape: The shape of this Polygon. # noqa: E501 + :type shape: SupportedGADShapes + :param point_list: The point_list of this Polygon. # noqa: E501 + :type point_list: List[GeographicalCoordinates] + """ + self.openapi_types = { + 'shape': SupportedGADShapes, + 'point_list': List[GeographicalCoordinates] + } + + self.attribute_map = { + 'shape': 'shape', + 'point_list': 'pointList' + } + + self._shape = shape + self._point_list = point_list + + @classmethod + def from_dict(cls, dikt) -> 'Polygon': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The Polygon of this Polygon. # noqa: E501 + :rtype: Polygon + """ + return util.deserialize_model(dikt, cls) + + @property + def shape(self) -> SupportedGADShapes: + """Gets the shape of this Polygon. + + + :return: The shape of this Polygon. + :rtype: SupportedGADShapes + """ + return self._shape + + @shape.setter + def shape(self, shape: SupportedGADShapes): + """Sets the shape of this Polygon. + + + :param shape: The shape of this Polygon. + :type shape: SupportedGADShapes + """ + if shape is None: + raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 + + self._shape = shape + + @property + def point_list(self) -> List[GeographicalCoordinates]: + """Gets the point_list of this Polygon. + + List of points. # noqa: E501 + + :return: The point_list of this Polygon. + :rtype: List[GeographicalCoordinates] + """ + return self._point_list + + @point_list.setter + def point_list(self, point_list: List[GeographicalCoordinates]): + """Sets the point_list of this Polygon. + + List of points. # noqa: E501 + + :param point_list: The point_list of this Polygon. + :type point_list: List[GeographicalCoordinates] + """ + if point_list is None: + raise ValueError("Invalid value for `point_list`, must not be `None`") # noqa: E501 + if point_list is not None and len(point_list) > 15: + raise ValueError("Invalid value for `point_list`, number of items must be less than or equal to `15`") # noqa: E501 + if point_list is not None and len(point_list) < 3: + raise ValueError("Invalid value for `point_list`, number of items must be greater than or equal to `3`") # noqa: E501 + + self._point_list = point_list diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/problem_details.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/problem_details.py new file mode 100644 index 0000000000000000000000000000000000000000..d1f6447ed5fe74a3f5344acd8bc671103460ac7d --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/problem_details.py @@ -0,0 +1,264 @@ +import re # noqa: E501 +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from openapi_server import util +from openapi_server.models.base_model import Model +from openapi_server.models.invalid_param import InvalidParam # noqa: E501 + + +class ProblemDetails(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, type=None, title=None, status=None, detail=None, instance=None, cause=None, invalid_params=None, supported_features=None): # noqa: E501 + """ProblemDetails - a model defined in OpenAPI + + :param type: The type of this ProblemDetails. # noqa: E501 + :type type: str + :param title: The title of this ProblemDetails. # noqa: E501 + :type title: str + :param status: The status of this ProblemDetails. # noqa: E501 + :type status: int + :param detail: The detail of this ProblemDetails. # noqa: E501 + :type detail: str + :param instance: The instance of this ProblemDetails. # noqa: E501 + :type instance: str + :param cause: The cause of this ProblemDetails. # noqa: E501 + :type cause: str + :param invalid_params: The invalid_params of this ProblemDetails. # noqa: E501 + :type invalid_params: List[InvalidParam] + :param supported_features: The supported_features of this ProblemDetails. # noqa: E501 + :type supported_features: str + """ + self.openapi_types = { + 'type': str, + 'title': str, + 'status': int, + 'detail': str, + 'instance': str, + 'cause': str, + 'invalid_params': List[InvalidParam], + 'supported_features': str + } + + self.attribute_map = { + 'type': 'type', + 'title': 'title', + 'status': 'status', + 'detail': 'detail', + 'instance': 'instance', + 'cause': 'cause', + 'invalid_params': 'invalidParams', + 'supported_features': 'supportedFeatures' + } + + self._type = type + self._title = title + self._status = status + self._detail = detail + self._instance = instance + self._cause = cause + self._invalid_params = invalid_params + self._supported_features = supported_features + + @classmethod + def from_dict(cls, dikt) -> 'ProblemDetails': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The ProblemDetails of this ProblemDetails. # noqa: E501 + :rtype: ProblemDetails + """ + return util.deserialize_model(dikt, cls) + + @property + def type(self) -> str: + """Gets the type of this ProblemDetails. + + string providing an URI formatted according to IETF RFC 3986. # noqa: E501 + + :return: The type of this ProblemDetails. + :rtype: str + """ + return self._type + + @type.setter + def type(self, type: str): + """Sets the type of this ProblemDetails. + + string providing an URI formatted according to IETF RFC 3986. # noqa: E501 + + :param type: The type of this ProblemDetails. + :type type: str + """ + + self._type = type + + @property + def title(self) -> str: + """Gets the title of this ProblemDetails. + + A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem. # noqa: E501 + + :return: The title of this ProblemDetails. + :rtype: str + """ + return self._title + + @title.setter + def title(self, title: str): + """Sets the title of this ProblemDetails. + + A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem. # noqa: E501 + + :param title: The title of this ProblemDetails. + :type title: str + """ + + self._title = title + + @property + def status(self) -> int: + """Gets the status of this ProblemDetails. + + The HTTP status code for this occurrence of the problem. # noqa: E501 + + :return: The status of this ProblemDetails. + :rtype: int + """ + return self._status + + @status.setter + def status(self, status: int): + """Sets the status of this ProblemDetails. + + The HTTP status code for this occurrence of the problem. # noqa: E501 + + :param status: The status of this ProblemDetails. + :type status: int + """ + + self._status = status + + @property + def detail(self) -> str: + """Gets the detail of this ProblemDetails. + + A human-readable explanation specific to this occurrence of the problem. # noqa: E501 + + :return: The detail of this ProblemDetails. + :rtype: str + """ + return self._detail + + @detail.setter + def detail(self, detail: str): + """Sets the detail of this ProblemDetails. + + A human-readable explanation specific to this occurrence of the problem. # noqa: E501 + + :param detail: The detail of this ProblemDetails. + :type detail: str + """ + + self._detail = detail + + @property + def instance(self) -> str: + """Gets the instance of this ProblemDetails. + + string providing an URI formatted according to IETF RFC 3986. # noqa: E501 + + :return: The instance of this ProblemDetails. + :rtype: str + """ + return self._instance + + @instance.setter + def instance(self, instance: str): + """Sets the instance of this ProblemDetails. + + string providing an URI formatted according to IETF RFC 3986. # noqa: E501 + + :param instance: The instance of this ProblemDetails. + :type instance: str + """ + + self._instance = instance + + @property + def cause(self) -> str: + """Gets the cause of this ProblemDetails. + + A machine-readable application error cause specific to this occurrence of the problem. This IE should be present and provide application-related error information, if available. # noqa: E501 + + :return: The cause of this ProblemDetails. + :rtype: str + """ + return self._cause + + @cause.setter + def cause(self, cause: str): + """Sets the cause of this ProblemDetails. + + A machine-readable application error cause specific to this occurrence of the problem. This IE should be present and provide application-related error information, if available. # noqa: E501 + + :param cause: The cause of this ProblemDetails. + :type cause: str + """ + + self._cause = cause + + @property + def invalid_params(self) -> List[InvalidParam]: + """Gets the invalid_params of this ProblemDetails. + + Description of invalid parameters, for a request rejected due to invalid parameters. # noqa: E501 + + :return: The invalid_params of this ProblemDetails. + :rtype: List[InvalidParam] + """ + return self._invalid_params + + @invalid_params.setter + def invalid_params(self, invalid_params: List[InvalidParam]): + """Sets the invalid_params of this ProblemDetails. + + Description of invalid parameters, for a request rejected due to invalid parameters. # noqa: E501 + + :param invalid_params: The invalid_params of this ProblemDetails. + :type invalid_params: List[InvalidParam] + """ + if invalid_params is not None and len(invalid_params) < 1: + raise ValueError("Invalid value for `invalid_params`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._invalid_params = invalid_params + + @property + def supported_features(self) -> str: + """Gets the supported_features of this ProblemDetails. + + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. # noqa: E501 + + :return: The supported_features of this ProblemDetails. + :rtype: str + """ + return self._supported_features + + @supported_features.setter + def supported_features(self, supported_features: str): + """Sets the supported_features of this ProblemDetails. + + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. # noqa: E501 + + :param supported_features: The supported_features of this ProblemDetails. + :type supported_features: str + """ + if supported_features is not None and not re.search(r'^[A-Fa-f0-9]*$', supported_features): # noqa: E501 + raise ValueError(r"Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + + self._supported_features = supported_features diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/protocol.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/protocol.py new file mode 100644 index 0000000000000000000000000000000000000000..6ee3233b6ddda0348d9b01aac478fa9706b8516e --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/protocol.py @@ -0,0 +1,33 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from openapi_server import util +from openapi_server.models.base_model import Model + + +class Protocol(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self): # noqa: E501 + """Protocol - a model defined in OpenAPI + + """ + self.openapi_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'Protocol': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The Protocol of this Protocol. # noqa: E501 + :rtype: Protocol + """ + return util.deserialize_model(dikt, cls) diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/relative_cartesian_location.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/relative_cartesian_location.py new file mode 100644 index 0000000000000000000000000000000000000000..672c68178011d2378bb2b78a40d31e0d23b3d6ee --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/relative_cartesian_location.py @@ -0,0 +1,122 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from openapi_server import util +from openapi_server.models.base_model import Model + + +class RelativeCartesianLocation(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, x=None, y=None, z=None): # noqa: E501 + """RelativeCartesianLocation - a model defined in OpenAPI + + :param x: The x of this RelativeCartesianLocation. # noqa: E501 + :type x: float + :param y: The y of this RelativeCartesianLocation. # noqa: E501 + :type y: float + :param z: The z of this RelativeCartesianLocation. # noqa: E501 + :type z: float + """ + self.openapi_types = { + 'x': float, + 'y': float, + 'z': float + } + + self.attribute_map = { + 'x': 'x', + 'y': 'y', + 'z': 'z' + } + + self._x = x + self._y = y + self._z = z + + @classmethod + def from_dict(cls, dikt) -> 'RelativeCartesianLocation': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The RelativeCartesianLocation of this RelativeCartesianLocation. # noqa: E501 + :rtype: RelativeCartesianLocation + """ + return util.deserialize_model(dikt, cls) + + @property + def x(self) -> float: + """Gets the x of this RelativeCartesianLocation. + + string with format 'float' as defined in OpenAPI. # noqa: E501 + + :return: The x of this RelativeCartesianLocation. + :rtype: float + """ + return self._x + + @x.setter + def x(self, x: float): + """Sets the x of this RelativeCartesianLocation. + + string with format 'float' as defined in OpenAPI. # noqa: E501 + + :param x: The x of this RelativeCartesianLocation. + :type x: float + """ + if x is None: + raise ValueError("Invalid value for `x`, must not be `None`") # noqa: E501 + + self._x = x + + @property + def y(self) -> float: + """Gets the y of this RelativeCartesianLocation. + + string with format 'float' as defined in OpenAPI. # noqa: E501 + + :return: The y of this RelativeCartesianLocation. + :rtype: float + """ + return self._y + + @y.setter + def y(self, y: float): + """Sets the y of this RelativeCartesianLocation. + + string with format 'float' as defined in OpenAPI. # noqa: E501 + + :param y: The y of this RelativeCartesianLocation. + :type y: float + """ + if y is None: + raise ValueError("Invalid value for `y`, must not be `None`") # noqa: E501 + + self._y = y + + @property + def z(self) -> float: + """Gets the z of this RelativeCartesianLocation. + + string with format 'float' as defined in OpenAPI. # noqa: E501 + + :return: The z of this RelativeCartesianLocation. + :rtype: float + """ + return self._z + + @z.setter + def z(self, z: float): + """Sets the z of this RelativeCartesianLocation. + + string with format 'float' as defined in OpenAPI. # noqa: E501 + + :param z: The z of this RelativeCartesianLocation. + :type z: float + """ + + self._z = z diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/res_oper_info.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/res_oper_info.py new file mode 100644 index 0000000000000000000000000000000000000000..c90e86ed4f6f1e4d02e7b53feb2b18a651616aef --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/res_oper_info.py @@ -0,0 +1,119 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from openapi_server import util +from openapi_server.models.base_model import Model +from openapi_server.models.operation import Operation # noqa: E501 + + +class ResOperInfo(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, resource=None, operations=None, custom_serv_opers=None): # noqa: E501 + """ResOperInfo - a model defined in OpenAPI + + :param resource: The resource of this ResOperInfo. # noqa: E501 + :type resource: str + :param operations: The operations of this ResOperInfo. # noqa: E501 + :type operations: List[Operation] + :param custom_serv_opers: The custom_serv_opers of this ResOperInfo. # noqa: E501 + :type custom_serv_opers: List[str] + """ + self.openapi_types = { + 'resource': str, + 'operations': List[Operation], + 'custom_serv_opers': List[str] + } + + self.attribute_map = { + 'resource': 'resource', + 'operations': 'operations', + 'custom_serv_opers': 'customServOpers' + } + + self._resource = resource + self._operations = operations + self._custom_serv_opers = custom_serv_opers + + @classmethod + def from_dict(cls, dikt) -> 'ResOperInfo': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The ResOperInfo of this ResOperInfo. # noqa: E501 + :rtype: ResOperInfo + """ + return util.deserialize_model(dikt, cls) + + @property + def resource(self) -> str: + """Gets the resource of this ResOperInfo. + + string providing an URI formatted according to IETF RFC 3986. # noqa: E501 + + :return: The resource of this ResOperInfo. + :rtype: str + """ + return self._resource + + @resource.setter + def resource(self, resource: str): + """Sets the resource of this ResOperInfo. + + string providing an URI formatted according to IETF RFC 3986. # noqa: E501 + + :param resource: The resource of this ResOperInfo. + :type resource: str + """ + + self._resource = resource + + @property + def operations(self) -> List[Operation]: + """Gets the operations of this ResOperInfo. + + + :return: The operations of this ResOperInfo. + :rtype: List[Operation] + """ + return self._operations + + @operations.setter + def operations(self, operations: List[Operation]): + """Sets the operations of this ResOperInfo. + + + :param operations: The operations of this ResOperInfo. + :type operations: List[Operation] + """ + if operations is not None and len(operations) < 1: + raise ValueError("Invalid value for `operations`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._operations = operations + + @property + def custom_serv_opers(self) -> List[str]: + """Gets the custom_serv_opers of this ResOperInfo. + + + :return: The custom_serv_opers of this ResOperInfo. + :rtype: List[str] + """ + return self._custom_serv_opers + + @custom_serv_opers.setter + def custom_serv_opers(self, custom_serv_opers: List[str]): + """Sets the custom_serv_opers of this ResOperInfo. + + + :param custom_serv_opers: The custom_serv_opers of this ResOperInfo. + :type custom_serv_opers: List[str] + """ + if custom_serv_opers is not None and len(custom_serv_opers) < 1: + raise ValueError("Invalid value for `custom_serv_opers`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._custom_serv_opers = custom_serv_opers diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/resource.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/resource.py new file mode 100644 index 0000000000000000000000000000000000000000..34afd1b68ab2b125a21adbc498e07f6984319f5e --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/resource.py @@ -0,0 +1,243 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from openapi_server import util +from openapi_server.models.base_model import Model +from openapi_server.models.communication_type import \ + CommunicationType # noqa: E501 +from openapi_server.models.custom_operation import \ + CustomOperation # noqa: E501 +from openapi_server.models.operation import Operation # noqa: E501 + + +class Resource(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, resource_name=None, comm_type=None, uri=None, cust_op_name=None, cust_operations=None, operations=None, description=None): # noqa: E501 + """Resource - a model defined in OpenAPI + + :param resource_name: The resource_name of this Resource. # noqa: E501 + :type resource_name: str + :param comm_type: The comm_type of this Resource. # noqa: E501 + :type comm_type: CommunicationType + :param uri: The uri of this Resource. # noqa: E501 + :type uri: str + :param cust_op_name: The cust_op_name of this Resource. # noqa: E501 + :type cust_op_name: str + :param cust_operations: The cust_operations of this Resource. # noqa: E501 + :type cust_operations: List[CustomOperation] + :param operations: The operations of this Resource. # noqa: E501 + :type operations: List[Operation] + :param description: The description of this Resource. # noqa: E501 + :type description: str + """ + self.openapi_types = { + 'resource_name': str, + 'comm_type': CommunicationType, + 'uri': str, + 'cust_op_name': str, + 'cust_operations': List[CustomOperation], + 'operations': List[Operation], + 'description': str + } + + self.attribute_map = { + 'resource_name': 'resourceName', + 'comm_type': 'commType', + 'uri': 'uri', + 'cust_op_name': 'custOpName', + 'cust_operations': 'custOperations', + 'operations': 'operations', + 'description': 'description' + } + + self._resource_name = resource_name + self._comm_type = comm_type + self._uri = uri + self._cust_op_name = cust_op_name + self._cust_operations = cust_operations + self._operations = operations + self._description = description + + @classmethod + def from_dict(cls, dikt) -> 'Resource': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The Resource of this Resource. # noqa: E501 + :rtype: Resource + """ + return util.deserialize_model(dikt, cls) + + @property + def resource_name(self) -> str: + """Gets the resource_name of this Resource. + + Resource name # noqa: E501 + + :return: The resource_name of this Resource. + :rtype: str + """ + return self._resource_name + + @resource_name.setter + def resource_name(self, resource_name: str): + """Sets the resource_name of this Resource. + + Resource name # noqa: E501 + + :param resource_name: The resource_name of this Resource. + :type resource_name: str + """ + if resource_name is None: + raise ValueError("Invalid value for `resource_name`, must not be `None`") # noqa: E501 + + self._resource_name = resource_name + + @property + def comm_type(self) -> CommunicationType: + """Gets the comm_type of this Resource. + + + :return: The comm_type of this Resource. + :rtype: CommunicationType + """ + return self._comm_type + + @comm_type.setter + def comm_type(self, comm_type: CommunicationType): + """Sets the comm_type of this Resource. + + + :param comm_type: The comm_type of this Resource. + :type comm_type: CommunicationType + """ + if comm_type is None: + raise ValueError("Invalid value for `comm_type`, must not be `None`") # noqa: E501 + + self._comm_type = comm_type + + @property + def uri(self) -> str: + """Gets the uri of this Resource. + + Relative URI of the API resource, it is set as {apiSpecificSuffixes} part of the URI structure as defined in clause 5.2.4 of 3GPP TS 29.122. # noqa: E501 + + :return: The uri of this Resource. + :rtype: str + """ + return self._uri + + @uri.setter + def uri(self, uri: str): + """Sets the uri of this Resource. + + Relative URI of the API resource, it is set as {apiSpecificSuffixes} part of the URI structure as defined in clause 5.2.4 of 3GPP TS 29.122. # noqa: E501 + + :param uri: The uri of this Resource. + :type uri: str + """ + if uri is None: + raise ValueError("Invalid value for `uri`, must not be `None`") # noqa: E501 + + self._uri = uri + + @property + def cust_op_name(self) -> str: + """Gets the cust_op_name of this Resource. + + it is set as {custOpName} part of the URI structure for a custom operation associated with a resource as defined in clause 5.2.4 of 3GPP TS 29.122. # noqa: E501 + + :return: The cust_op_name of this Resource. + :rtype: str + """ + return self._cust_op_name + + @cust_op_name.setter + def cust_op_name(self, cust_op_name: str): + """Sets the cust_op_name of this Resource. + + it is set as {custOpName} part of the URI structure for a custom operation associated with a resource as defined in clause 5.2.4 of 3GPP TS 29.122. # noqa: E501 + + :param cust_op_name: The cust_op_name of this Resource. + :type cust_op_name: str + """ + + self._cust_op_name = cust_op_name + + @property + def cust_operations(self) -> List[CustomOperation]: + """Gets the cust_operations of this Resource. + + Custom operations associated with this resource. # noqa: E501 + + :return: The cust_operations of this Resource. + :rtype: List[CustomOperation] + """ + return self._cust_operations + + @cust_operations.setter + def cust_operations(self, cust_operations: List[CustomOperation]): + """Sets the cust_operations of this Resource. + + Custom operations associated with this resource. # noqa: E501 + + :param cust_operations: The cust_operations of this Resource. + :type cust_operations: List[CustomOperation] + """ + if cust_operations is not None and len(cust_operations) < 1: + raise ValueError("Invalid value for `cust_operations`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._cust_operations = cust_operations + + @property + def operations(self) -> List[Operation]: + """Gets the operations of this Resource. + + Supported HTTP methods for the API resource. Only applicable when the protocol in AefProfile indicates HTTP. # noqa: E501 + + :return: The operations of this Resource. + :rtype: List[Operation] + """ + return self._operations + + @operations.setter + def operations(self, operations: List[Operation]): + """Sets the operations of this Resource. + + Supported HTTP methods for the API resource. Only applicable when the protocol in AefProfile indicates HTTP. # noqa: E501 + + :param operations: The operations of this Resource. + :type operations: List[Operation] + """ + if operations is not None and len(operations) < 1: + raise ValueError("Invalid value for `operations`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._operations = operations + + @property + def description(self) -> str: + """Gets the description of this Resource. + + Text description of the API resource # noqa: E501 + + :return: The description of this Resource. + :rtype: str + """ + return self._description + + @description.setter + def description(self, description: str): + """Sets the description of this Resource. + + Text description of the API resource # noqa: E501 + + :param description: The description of this Resource. + :type description: str + """ + + self._description = description diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/service_kpis.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/service_kpis.py new file mode 100644 index 0000000000000000000000000000000000000000..3b80d30abda1d9bc120f78de4d7f6a3014d9a346 --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/service_kpis.py @@ -0,0 +1,275 @@ +import re # noqa: E501 +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from openapi_server import util +from openapi_server.models.base_model import Model + + +class ServiceKpis(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, max_req_rate=None, max_restime=None, availability=None, aval_comp=None, aval_gra_comp=None, aval_mem=None, aval_stor=None, con_band=None): # noqa: E501 + """ServiceKpis - a model defined in OpenAPI + + :param max_req_rate: The max_req_rate of this ServiceKpis. # noqa: E501 + :type max_req_rate: int + :param max_restime: The max_restime of this ServiceKpis. # noqa: E501 + :type max_restime: int + :param availability: The availability of this ServiceKpis. # noqa: E501 + :type availability: int + :param aval_comp: The aval_comp of this ServiceKpis. # noqa: E501 + :type aval_comp: str + :param aval_gra_comp: The aval_gra_comp of this ServiceKpis. # noqa: E501 + :type aval_gra_comp: str + :param aval_mem: The aval_mem of this ServiceKpis. # noqa: E501 + :type aval_mem: str + :param aval_stor: The aval_stor of this ServiceKpis. # noqa: E501 + :type aval_stor: str + :param con_band: The con_band of this ServiceKpis. # noqa: E501 + :type con_band: int + """ + self.openapi_types = { + 'max_req_rate': int, + 'max_restime': int, + 'availability': int, + 'aval_comp': str, + 'aval_gra_comp': str, + 'aval_mem': str, + 'aval_stor': str, + 'con_band': int + } + + self.attribute_map = { + 'max_req_rate': 'maxReqRate', + 'max_restime': 'maxRestime', + 'availability': 'availability', + 'aval_comp': 'avalComp', + 'aval_gra_comp': 'avalGraComp', + 'aval_mem': 'avalMem', + 'aval_stor': 'avalStor', + 'con_band': 'conBand' + } + + self._max_req_rate = max_req_rate + self._max_restime = max_restime + self._availability = availability + self._aval_comp = aval_comp + self._aval_gra_comp = aval_gra_comp + self._aval_mem = aval_mem + self._aval_stor = aval_stor + self._con_band = con_band + + @classmethod + def from_dict(cls, dikt) -> 'ServiceKpis': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The ServiceKpis of this ServiceKpis. # noqa: E501 + :rtype: ServiceKpis + """ + return util.deserialize_model(dikt, cls) + + @property + def max_req_rate(self) -> int: + """Gets the max_req_rate of this ServiceKpis. + + Unsigned Integer, i.e. only value 0 and integers above 0 are permissible. # noqa: E501 + + :return: The max_req_rate of this ServiceKpis. + :rtype: int + """ + return self._max_req_rate + + @max_req_rate.setter + def max_req_rate(self, max_req_rate: int): + """Sets the max_req_rate of this ServiceKpis. + + Unsigned Integer, i.e. only value 0 and integers above 0 are permissible. # noqa: E501 + + :param max_req_rate: The max_req_rate of this ServiceKpis. + :type max_req_rate: int + """ + if max_req_rate is not None and max_req_rate < 0: # noqa: E501 + raise ValueError("Invalid value for `max_req_rate`, must be a value greater than or equal to `0`") # noqa: E501 + + self._max_req_rate = max_req_rate + + @property + def max_restime(self) -> int: + """Gets the max_restime of this ServiceKpis. + + Unsigned integer identifying a period of time in units of seconds. # noqa: E501 + + :return: The max_restime of this ServiceKpis. + :rtype: int + """ + return self._max_restime + + @max_restime.setter + def max_restime(self, max_restime: int): + """Sets the max_restime of this ServiceKpis. + + Unsigned integer identifying a period of time in units of seconds. # noqa: E501 + + :param max_restime: The max_restime of this ServiceKpis. + :type max_restime: int + """ + if max_restime is not None and max_restime < 0: # noqa: E501 + raise ValueError("Invalid value for `max_restime`, must be a value greater than or equal to `0`") # noqa: E501 + + self._max_restime = max_restime + + @property + def availability(self) -> int: + """Gets the availability of this ServiceKpis. + + Unsigned Integer, i.e. only value 0 and integers above 0 are permissible. # noqa: E501 + + :return: The availability of this ServiceKpis. + :rtype: int + """ + return self._availability + + @availability.setter + def availability(self, availability: int): + """Sets the availability of this ServiceKpis. + + Unsigned Integer, i.e. only value 0 and integers above 0 are permissible. # noqa: E501 + + :param availability: The availability of this ServiceKpis. + :type availability: int + """ + if availability is not None and availability < 0: # noqa: E501 + raise ValueError("Invalid value for `availability`, must be a value greater than or equal to `0`") # noqa: E501 + + self._availability = availability + + @property + def aval_comp(self) -> str: + """Gets the aval_comp of this ServiceKpis. + + The maximum compute resource available in FLOPS for the API Invoker. # noqa: E501 + + :return: The aval_comp of this ServiceKpis. + :rtype: str + """ + return self._aval_comp + + @aval_comp.setter + def aval_comp(self, aval_comp: str): + """Sets the aval_comp of this ServiceKpis. + + The maximum compute resource available in FLOPS for the API Invoker. # noqa: E501 + + :param aval_comp: The aval_comp of this ServiceKpis. + :type aval_comp: str + """ + if aval_comp is not None and not re.search(r'^\d+(\.\d+)? (kFLOPS|MFLOPS|GFLOPS|TFLOPS|PFLOPS|EFLOPS|ZFLOPS)$', aval_comp): # noqa: E501 + raise ValueError(r"Invalid value for `aval_comp`, must be a follow pattern or equal to `/^\d+(\.\d+)? (kFLOPS|MFLOPS|GFLOPS|TFLOPS|PFLOPS|EFLOPS|ZFLOPS)$/`") # noqa: E501 + + self._aval_comp = aval_comp + + @property + def aval_gra_comp(self) -> str: + """Gets the aval_gra_comp of this ServiceKpis. + + The maximum graphical compute resource in FLOPS available for the API Invoker. # noqa: E501 + + :return: The aval_gra_comp of this ServiceKpis. + :rtype: str + """ + return self._aval_gra_comp + + @aval_gra_comp.setter + def aval_gra_comp(self, aval_gra_comp: str): + """Sets the aval_gra_comp of this ServiceKpis. + + The maximum graphical compute resource in FLOPS available for the API Invoker. # noqa: E501 + + :param aval_gra_comp: The aval_gra_comp of this ServiceKpis. + :type aval_gra_comp: str + """ + if aval_gra_comp is not None and not re.search(r'^\d+(\.\d+)? (kFLOPS|MFLOPS|GFLOPS|TFLOPS|PFLOPS|EFLOPS|ZFLOPS)$', aval_gra_comp): # noqa: E501 + raise ValueError(r"Invalid value for `aval_gra_comp`, must be a follow pattern or equal to `/^\d+(\.\d+)? (kFLOPS|MFLOPS|GFLOPS|TFLOPS|PFLOPS|EFLOPS|ZFLOPS)$/`") # noqa: E501 + + self._aval_gra_comp = aval_gra_comp + + @property + def aval_mem(self) -> str: + """Gets the aval_mem of this ServiceKpis. + + The maximum memory resource available for the API Invoker. # noqa: E501 + + :return: The aval_mem of this ServiceKpis. + :rtype: str + """ + return self._aval_mem + + @aval_mem.setter + def aval_mem(self, aval_mem: str): + """Sets the aval_mem of this ServiceKpis. + + The maximum memory resource available for the API Invoker. # noqa: E501 + + :param aval_mem: The aval_mem of this ServiceKpis. + :type aval_mem: str + """ + if aval_mem is not None and not re.search(r'^\d+(\.\d+)? (KB|MB|GB|TB|PB|EB|ZB|YB)$', aval_mem): # noqa: E501 + raise ValueError(r"Invalid value for `aval_mem`, must be a follow pattern or equal to `/^\d+(\.\d+)? (KB|MB|GB|TB|PB|EB|ZB|YB)$/`") # noqa: E501 + + self._aval_mem = aval_mem + + @property + def aval_stor(self) -> str: + """Gets the aval_stor of this ServiceKpis. + + The maximum storage resource available for the API Invoker. # noqa: E501 + + :return: The aval_stor of this ServiceKpis. + :rtype: str + """ + return self._aval_stor + + @aval_stor.setter + def aval_stor(self, aval_stor: str): + """Sets the aval_stor of this ServiceKpis. + + The maximum storage resource available for the API Invoker. # noqa: E501 + + :param aval_stor: The aval_stor of this ServiceKpis. + :type aval_stor: str + """ + if aval_stor is not None and not re.search(r'^\d+(\.\d+)? (KB|MB|GB|TB|PB|EB|ZB|YB)$', aval_stor): # noqa: E501 + raise ValueError(r"Invalid value for `aval_stor`, must be a follow pattern or equal to `/^\d+(\.\d+)? (KB|MB|GB|TB|PB|EB|ZB|YB)$/`") # noqa: E501 + + self._aval_stor = aval_stor + + @property + def con_band(self) -> int: + """Gets the con_band of this ServiceKpis. + + Unsigned Integer, i.e. only value 0 and integers above 0 are permissible. # noqa: E501 + + :return: The con_band of this ServiceKpis. + :rtype: int + """ + return self._con_band + + @con_band.setter + def con_band(self, con_band: int): + """Sets the con_band of this ServiceKpis. + + Unsigned Integer, i.e. only value 0 and integers above 0 are permissible. # noqa: E501 + + :param con_band: The con_band of this ServiceKpis. + :type con_band: int + """ + if con_band is not None and con_band < 0: # noqa: E501 + raise ValueError("Invalid value for `con_band`, must be a value greater than or equal to `0`") # noqa: E501 + + self._con_band = con_band diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/supported_gad_shapes.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/supported_gad_shapes.py new file mode 100644 index 0000000000000000000000000000000000000000..971f35ed681d1bb6d462a49e377065bb31f1f64d --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/supported_gad_shapes.py @@ -0,0 +1,33 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from openapi_server import util +from openapi_server.models.base_model import Model + + +class SupportedGADShapes(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self): # noqa: E501 + """SupportedGADShapes - a model defined in OpenAPI + + """ + self.openapi_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'SupportedGADShapes': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The SupportedGADShapes of this SupportedGADShapes. # noqa: E501 + :rtype: SupportedGADShapes + """ + return util.deserialize_model(dikt, cls) diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/uncertainty_ellipse.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/uncertainty_ellipse.py new file mode 100644 index 0000000000000000000000000000000000000000..20dbc8e8d2ce3748539eb2fa7e5bf1b3bd399ba3 --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/uncertainty_ellipse.py @@ -0,0 +1,132 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from openapi_server import util +from openapi_server.models.base_model import Model + + +class UncertaintyEllipse(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, semi_major=None, semi_minor=None, orientation_major=None): # noqa: E501 + """UncertaintyEllipse - a model defined in OpenAPI + + :param semi_major: The semi_major of this UncertaintyEllipse. # noqa: E501 + :type semi_major: float + :param semi_minor: The semi_minor of this UncertaintyEllipse. # noqa: E501 + :type semi_minor: float + :param orientation_major: The orientation_major of this UncertaintyEllipse. # noqa: E501 + :type orientation_major: int + """ + self.openapi_types = { + 'semi_major': float, + 'semi_minor': float, + 'orientation_major': int + } + + self.attribute_map = { + 'semi_major': 'semiMajor', + 'semi_minor': 'semiMinor', + 'orientation_major': 'orientationMajor' + } + + self._semi_major = semi_major + self._semi_minor = semi_minor + self._orientation_major = orientation_major + + @classmethod + def from_dict(cls, dikt) -> 'UncertaintyEllipse': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The UncertaintyEllipse of this UncertaintyEllipse. # noqa: E501 + :rtype: UncertaintyEllipse + """ + return util.deserialize_model(dikt, cls) + + @property + def semi_major(self) -> float: + """Gets the semi_major of this UncertaintyEllipse. + + Indicates value of uncertainty. # noqa: E501 + + :return: The semi_major of this UncertaintyEllipse. + :rtype: float + """ + return self._semi_major + + @semi_major.setter + def semi_major(self, semi_major: float): + """Sets the semi_major of this UncertaintyEllipse. + + Indicates value of uncertainty. # noqa: E501 + + :param semi_major: The semi_major of this UncertaintyEllipse. + :type semi_major: float + """ + if semi_major is None: + raise ValueError("Invalid value for `semi_major`, must not be `None`") # noqa: E501 + if semi_major is not None and semi_major < 0: # noqa: E501 + raise ValueError("Invalid value for `semi_major`, must be a value greater than or equal to `0`") # noqa: E501 + + self._semi_major = semi_major + + @property + def semi_minor(self) -> float: + """Gets the semi_minor of this UncertaintyEllipse. + + Indicates value of uncertainty. # noqa: E501 + + :return: The semi_minor of this UncertaintyEllipse. + :rtype: float + """ + return self._semi_minor + + @semi_minor.setter + def semi_minor(self, semi_minor: float): + """Sets the semi_minor of this UncertaintyEllipse. + + Indicates value of uncertainty. # noqa: E501 + + :param semi_minor: The semi_minor of this UncertaintyEllipse. + :type semi_minor: float + """ + if semi_minor is None: + raise ValueError("Invalid value for `semi_minor`, must not be `None`") # noqa: E501 + if semi_minor is not None and semi_minor < 0: # noqa: E501 + raise ValueError("Invalid value for `semi_minor`, must be a value greater than or equal to `0`") # noqa: E501 + + self._semi_minor = semi_minor + + @property + def orientation_major(self) -> int: + """Gets the orientation_major of this UncertaintyEllipse. + + Indicates value of orientation angle. # noqa: E501 + + :return: The orientation_major of this UncertaintyEllipse. + :rtype: int + """ + return self._orientation_major + + @orientation_major.setter + def orientation_major(self, orientation_major: int): + """Sets the orientation_major of this UncertaintyEllipse. + + Indicates value of orientation angle. # noqa: E501 + + :param orientation_major: The orientation_major of this UncertaintyEllipse. + :type orientation_major: int + """ + if orientation_major is None: + raise ValueError("Invalid value for `orientation_major`, must not be `None`") # noqa: E501 + if orientation_major is not None and orientation_major > 180: # noqa: E501 + raise ValueError("Invalid value for `orientation_major`, must be a value less than or equal to `180`") # noqa: E501 + if orientation_major is not None and orientation_major < 0: # noqa: E501 + raise ValueError("Invalid value for `orientation_major`, must be a value greater than or equal to `0`") # noqa: E501 + + self._orientation_major = orientation_major diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/uncertainty_ellipsoid.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/uncertainty_ellipsoid.py new file mode 100644 index 0000000000000000000000000000000000000000..5b1466d4955635781a5e71e88e20da64b05dfc2d --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/uncertainty_ellipsoid.py @@ -0,0 +1,164 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from openapi_server import util +from openapi_server.models.base_model import Model + + +class UncertaintyEllipsoid(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, semi_major=None, semi_minor=None, vertical=None, orientation_major=None): # noqa: E501 + """UncertaintyEllipsoid - a model defined in OpenAPI + + :param semi_major: The semi_major of this UncertaintyEllipsoid. # noqa: E501 + :type semi_major: float + :param semi_minor: The semi_minor of this UncertaintyEllipsoid. # noqa: E501 + :type semi_minor: float + :param vertical: The vertical of this UncertaintyEllipsoid. # noqa: E501 + :type vertical: float + :param orientation_major: The orientation_major of this UncertaintyEllipsoid. # noqa: E501 + :type orientation_major: int + """ + self.openapi_types = { + 'semi_major': float, + 'semi_minor': float, + 'vertical': float, + 'orientation_major': int + } + + self.attribute_map = { + 'semi_major': 'semiMajor', + 'semi_minor': 'semiMinor', + 'vertical': 'vertical', + 'orientation_major': 'orientationMajor' + } + + self._semi_major = semi_major + self._semi_minor = semi_minor + self._vertical = vertical + self._orientation_major = orientation_major + + @classmethod + def from_dict(cls, dikt) -> 'UncertaintyEllipsoid': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The UncertaintyEllipsoid of this UncertaintyEllipsoid. # noqa: E501 + :rtype: UncertaintyEllipsoid + """ + return util.deserialize_model(dikt, cls) + + @property + def semi_major(self) -> float: + """Gets the semi_major of this UncertaintyEllipsoid. + + Indicates value of uncertainty. # noqa: E501 + + :return: The semi_major of this UncertaintyEllipsoid. + :rtype: float + """ + return self._semi_major + + @semi_major.setter + def semi_major(self, semi_major: float): + """Sets the semi_major of this UncertaintyEllipsoid. + + Indicates value of uncertainty. # noqa: E501 + + :param semi_major: The semi_major of this UncertaintyEllipsoid. + :type semi_major: float + """ + if semi_major is None: + raise ValueError("Invalid value for `semi_major`, must not be `None`") # noqa: E501 + if semi_major is not None and semi_major < 0: # noqa: E501 + raise ValueError("Invalid value for `semi_major`, must be a value greater than or equal to `0`") # noqa: E501 + + self._semi_major = semi_major + + @property + def semi_minor(self) -> float: + """Gets the semi_minor of this UncertaintyEllipsoid. + + Indicates value of uncertainty. # noqa: E501 + + :return: The semi_minor of this UncertaintyEllipsoid. + :rtype: float + """ + return self._semi_minor + + @semi_minor.setter + def semi_minor(self, semi_minor: float): + """Sets the semi_minor of this UncertaintyEllipsoid. + + Indicates value of uncertainty. # noqa: E501 + + :param semi_minor: The semi_minor of this UncertaintyEllipsoid. + :type semi_minor: float + """ + if semi_minor is None: + raise ValueError("Invalid value for `semi_minor`, must not be `None`") # noqa: E501 + if semi_minor is not None and semi_minor < 0: # noqa: E501 + raise ValueError("Invalid value for `semi_minor`, must be a value greater than or equal to `0`") # noqa: E501 + + self._semi_minor = semi_minor + + @property + def vertical(self) -> float: + """Gets the vertical of this UncertaintyEllipsoid. + + Indicates value of uncertainty. # noqa: E501 + + :return: The vertical of this UncertaintyEllipsoid. + :rtype: float + """ + return self._vertical + + @vertical.setter + def vertical(self, vertical: float): + """Sets the vertical of this UncertaintyEllipsoid. + + Indicates value of uncertainty. # noqa: E501 + + :param vertical: The vertical of this UncertaintyEllipsoid. + :type vertical: float + """ + if vertical is None: + raise ValueError("Invalid value for `vertical`, must not be `None`") # noqa: E501 + if vertical is not None and vertical < 0: # noqa: E501 + raise ValueError("Invalid value for `vertical`, must be a value greater than or equal to `0`") # noqa: E501 + + self._vertical = vertical + + @property + def orientation_major(self) -> int: + """Gets the orientation_major of this UncertaintyEllipsoid. + + Indicates value of orientation angle. # noqa: E501 + + :return: The orientation_major of this UncertaintyEllipsoid. + :rtype: int + """ + return self._orientation_major + + @orientation_major.setter + def orientation_major(self, orientation_major: int): + """Sets the orientation_major of this UncertaintyEllipsoid. + + Indicates value of orientation angle. # noqa: E501 + + :param orientation_major: The orientation_major of this UncertaintyEllipsoid. + :type orientation_major: int + """ + if orientation_major is None: + raise ValueError("Invalid value for `orientation_major`, must not be `None`") # noqa: E501 + if orientation_major is not None and orientation_major > 180: # noqa: E501 + raise ValueError("Invalid value for `orientation_major`, must be a value less than or equal to `180`") # noqa: E501 + if orientation_major is not None and orientation_major < 0: # noqa: E501 + raise ValueError("Invalid value for `orientation_major`, must be a value greater than or equal to `0`") # noqa: E501 + + self._orientation_major = orientation_major diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/version.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/version.py new file mode 100644 index 0000000000000000000000000000000000000000..b35e424620ef98ab52845b53e1376c3585367624 --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/models/version.py @@ -0,0 +1,155 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from openapi_server import util +from openapi_server.models.base_model import Model +from openapi_server.models.custom_operation import \ + CustomOperation # noqa: E501 +from openapi_server.models.resource import Resource # noqa: E501 + + +class Version(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, api_version=None, expiry=None, resources=None, cust_operations=None): # noqa: E501 + """Version - a model defined in OpenAPI + + :param api_version: The api_version of this Version. # noqa: E501 + :type api_version: str + :param expiry: The expiry of this Version. # noqa: E501 + :type expiry: datetime + :param resources: The resources of this Version. # noqa: E501 + :type resources: List[Resource] + :param cust_operations: The cust_operations of this Version. # noqa: E501 + :type cust_operations: List[CustomOperation] + """ + self.openapi_types = { + 'api_version': str, + 'expiry': datetime, + 'resources': List[Resource], + 'cust_operations': List[CustomOperation] + } + + self.attribute_map = { + 'api_version': 'apiVersion', + 'expiry': 'expiry', + 'resources': 'resources', + 'cust_operations': 'custOperations' + } + + self._api_version = api_version + self._expiry = expiry + self._resources = resources + self._cust_operations = cust_operations + + @classmethod + def from_dict(cls, dikt) -> 'Version': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The Version of this Version. # noqa: E501 + :rtype: Version + """ + return util.deserialize_model(dikt, cls) + + @property + def api_version(self) -> str: + """Gets the api_version of this Version. + + API major version in URI (e.g. v1) # noqa: E501 + + :return: The api_version of this Version. + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version: str): + """Sets the api_version of this Version. + + API major version in URI (e.g. v1) # noqa: E501 + + :param api_version: The api_version of this Version. + :type api_version: str + """ + if api_version is None: + raise ValueError("Invalid value for `api_version`, must not be `None`") # noqa: E501 + + self._api_version = api_version + + @property + def expiry(self) -> datetime: + """Gets the expiry of this Version. + + string with format \"date-time\" as defined in OpenAPI. # noqa: E501 + + :return: The expiry of this Version. + :rtype: datetime + """ + return self._expiry + + @expiry.setter + def expiry(self, expiry: datetime): + """Sets the expiry of this Version. + + string with format \"date-time\" as defined in OpenAPI. # noqa: E501 + + :param expiry: The expiry of this Version. + :type expiry: datetime + """ + + self._expiry = expiry + + @property + def resources(self) -> List[Resource]: + """Gets the resources of this Version. + + Resources supported by the API. # noqa: E501 + + :return: The resources of this Version. + :rtype: List[Resource] + """ + return self._resources + + @resources.setter + def resources(self, resources: List[Resource]): + """Sets the resources of this Version. + + Resources supported by the API. # noqa: E501 + + :param resources: The resources of this Version. + :type resources: List[Resource] + """ + if resources is not None and len(resources) < 1: + raise ValueError("Invalid value for `resources`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._resources = resources + + @property + def cust_operations(self) -> List[CustomOperation]: + """Gets the cust_operations of this Version. + + Custom operations without resource association. # noqa: E501 + + :return: The cust_operations of this Version. + :rtype: List[CustomOperation] + """ + return self._cust_operations + + @cust_operations.setter + def cust_operations(self, cust_operations: List[CustomOperation]): + """Sets the cust_operations of this Version. + + Custom operations without resource association. # noqa: E501 + + :param cust_operations: The cust_operations of this Version. + :type cust_operations: List[CustomOperation] + """ + if cust_operations is not None and len(cust_operations) < 1: + raise ValueError("Invalid value for `cust_operations`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._cust_operations = cust_operations diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/openapi/openapi.yaml b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/openapi/openapi.yaml new file mode 100644 index 0000000000000000000000000000000000000000..fba66de57353cef24719bc40037526fda010039b --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/openapi/openapi.yaml @@ -0,0 +1,2675 @@ +openapi: 3.0.0 +info: + description: "API for Routing information. \n© 2025, 3GPP Organizational Partners\ + \ (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). \nAll rights reserved.\n" + title: CAPIF_Open_Discover_Service_API + version: 1.0.0-alpha.1 +externalDocs: + description: 3GPP TS 29.222 V19.4.0 Common API Framework for 3GPP Northbound APIs + url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.222/ +servers: +- url: "{apiRoot}/open-api-disc/v1" + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 7.5 of 3GPP TS 29.222. +paths: + /service-apis: + get: + description: | + Enables Open discovery of the currently registered at the CCF and satisfying a number of filter criteria. + operationId: service_apis_get + parameters: + - description: | + Contains the name(s) of the target Service API(s). + explode: false + in: query + name: api-names + required: false + schema: + items: + type: string + minItems: 1 + type: array + style: form + - description: | + Contains the major version(s) (e.g., v1) of the target Service API(s). + explode: true + in: query + name: api-versions + required: false + schema: + additionalProperties: + items: + type: string + minItems: 1 + type: array + minProperties: 1 + type: object + style: form + - description: | + Contains the communication type supported by the target Service API(s). + explode: true + in: query + name: comm-type + required: false + schema: + $ref: '#/components/schemas/CommunicationType' + style: form + - description: "Contains the protocol(s) supported by the target Service API(s).\ + \ \n" + explode: false + in: query + name: protocols + required: false + schema: + items: + $ref: '#/components/schemas/Protocol' + minItems: 1 + type: array + style: form + - description: "Contains data format(s) supported by the target Service API(s).\ + \ \n" + explode: true + in: query + name: data-format + required: false + schema: + $ref: '#/components/schemas/DataFormat' + style: form + - description: | + Contains the category(ies) of the target Service API(s). + explode: false + in: query + name: api-cats + required: false + schema: + items: + type: string + minItems: 1 + type: array + style: form + - content: + application/json: + schema: + $ref: '#/components/schemas/AefLocation' + description: | + Contains the preferred location information for AEF(s) exposing the target Service API(s). This query parameter is ignored by the CCF if there are no matching records at the CCF. + in: query + name: preferred-aef-loc + required: false + - description: | + Contains the name(s) of the provider(s) of the target Service API(s). + explode: false + in: query + name: api-prov-names + required: false + schema: + items: + type: string + minItems: 1 + type: array + style: form + - description: | + Contains the features supported by the discovered service API indicated by api-name parameter. This may only be present if api-name query parameter is present. + explode: true + in: query + name: api-supported-features + required: false + schema: + additionalProperties: + $ref: '#/components/schemas/SupportedFeatures' + minProperties: 1 + type: object + style: form + - description: | + Contains the identifier(s) of the targeted service APIs. + explode: false + in: query + name: api-ids + required: false + schema: + items: + type: string + minItems: 1 + type: array + style: form + - description: "Contains iInformation about service characteristics provided\ + \ by the targeted service API(s). \n" + explode: true + in: query + name: service-kpis + required: false + schema: + $ref: '#/components/schemas/ServiceKpis' + style: form + - description: | + Contains the list of supported API resource(s) and service operation(s). + explode: false + in: query + name: res-ops + required: false + schema: + items: + $ref: '#/components/schemas/ResOperInfo' + minItems: 1 + type: array + style: form + - description: | + Contains a list of supported features among the ones defined in clause 8.1.6. This attributed shall be present only when feature negotiation needs to take place. + explode: true + in: query + name: supported-features + required: false + schema: + $ref: '#/components/schemas/SupportedFeatures' + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/OpenDiscoveryResp' + description: | + The response body contains the result of the search over the list of the registered APIs. + "307": + description: Temporary Redirect + headers: + Location: + description: An alternative URI of the resource. + required: true + schema: + type: string + "308": + description: Permanent Redirect + headers: + Location: + description: An alternative URI of the resource. + required: true + schema: + type: string + "400": + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Bad request + "401": + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Unauthorized + "403": + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Forbidden + "404": + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Not Found + "406": + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Not Acceptable + "414": + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: URI Too Long + "429": + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Too Many Requests + "500": + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Internal Server Error + "503": + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Service Unavailable + default: + description: Generic Error + x-openapi-router-controller: openapi_server.controllers.default_controller +components: + responses: + "307": + description: Temporary Redirect + headers: + Location: + description: An alternative URI of the resource. + required: true + schema: + type: string + "308": + description: Permanent Redirect + headers: + Location: + description: An alternative URI of the resource. + required: true + schema: + type: string + "400": + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Bad request + "401": + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Unauthorized + "403": + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Forbidden + "404": + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Not Found + "406": + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Not Acceptable + "414": + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: URI Too Long + "429": + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Too Many Requests + "500": + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Internal Server Error + "503": + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + description: Service Unavailable + default: + description: Generic Error + schemas: + OpenDiscoveryResp: + description: | + Represents the Open Service API Discovery response.. + example: + discApis: + - serviceAPICategory: serviceAPICategory + apiName: apiName + apiProvName: apiProvName + description: description + apiSuppFeats: apiSuppFeats + apiId: apiId + apiStatus: + aefIds: + - aefIds + - aefIds + aefProfiles: + - protocol: HTTP_1_1 + versions: + - apiVersion: apiVersion + resources: + - operations: + - null + - null + commType: REQUEST_RESPONSE + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - null + - null + commType: REQUEST_RESPONSE + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + - apiVersion: apiVersion + resources: + - operations: + - null + - null + commType: REQUEST_RESPONSE + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - null + - null + commType: REQUEST_RESPONSE + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + dataFormat: JSON + aefLocation: + dcId: dcId + geoArea: + shape: POINT + point: + lon: -151.1701851434036 + lat: 18.494211295267263 + civicAddr: + POBOX: POBOX + usageRules: usageRules + country: country + PRD: PRD + PLC: PLC + HNO: HNO + PRM: PRM + HNS: HNS + FLR: FLR + A1: A1 + A2: A2 + A3: A3 + A4: A4 + STS: STS + A5: A5 + A6: A6 + RDSEC: RDSEC + providedBy: providedBy + LOC: LOC + UNIT: UNIT + SEAT: SEAT + POD: POD + RDBR: RDBR + method: method + LMK: LMK + POM: POM + ADDCODE: ADDCODE + RD: RD + PC: PC + PCN: PCN + NAM: NAM + BLD: BLD + ROOM: ROOM + RDSUBBR: RDSUBBR + aefId: aefId + serviceKpis: + avalMem: avalMem + avalStor: avalStor + avalComp: avalComp + conBand: 0 + maxRestime: 0 + availability: 0 + maxReqRate: 0 + avalGraComp: avalGraComp + - protocol: HTTP_1_1 + versions: + - apiVersion: apiVersion + resources: + - operations: + - null + - null + commType: REQUEST_RESPONSE + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - null + - null + commType: REQUEST_RESPONSE + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + - apiVersion: apiVersion + resources: + - operations: + - null + - null + commType: REQUEST_RESPONSE + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - null + - null + commType: REQUEST_RESPONSE + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + dataFormat: JSON + aefLocation: + dcId: dcId + geoArea: + shape: POINT + point: + lon: -151.1701851434036 + lat: 18.494211295267263 + civicAddr: + POBOX: POBOX + usageRules: usageRules + country: country + PRD: PRD + PLC: PLC + HNO: HNO + PRM: PRM + HNS: HNS + FLR: FLR + A1: A1 + A2: A2 + A3: A3 + A4: A4 + STS: STS + A5: A5 + A6: A6 + RDSEC: RDSEC + providedBy: providedBy + LOC: LOC + UNIT: UNIT + SEAT: SEAT + POD: POD + RDBR: RDBR + method: method + LMK: LMK + POM: POM + ADDCODE: ADDCODE + RD: RD + PC: PC + PCN: PCN + NAM: NAM + BLD: BLD + ROOM: ROOM + RDSUBBR: RDSUBBR + aefId: aefId + serviceKpis: + avalMem: avalMem + avalStor: avalStor + avalComp: avalComp + conBand: 0 + maxRestime: 0 + availability: 0 + maxReqRate: 0 + avalGraComp: avalGraComp + - serviceAPICategory: serviceAPICategory + apiName: apiName + apiProvName: apiProvName + description: description + apiSuppFeats: apiSuppFeats + apiId: apiId + apiStatus: + aefIds: + - aefIds + - aefIds + aefProfiles: + - protocol: HTTP_1_1 + versions: + - apiVersion: apiVersion + resources: + - operations: + - null + - null + commType: REQUEST_RESPONSE + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - null + - null + commType: REQUEST_RESPONSE + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + - apiVersion: apiVersion + resources: + - operations: + - null + - null + commType: REQUEST_RESPONSE + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - null + - null + commType: REQUEST_RESPONSE + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + dataFormat: JSON + aefLocation: + dcId: dcId + geoArea: + shape: POINT + point: + lon: -151.1701851434036 + lat: 18.494211295267263 + civicAddr: + POBOX: POBOX + usageRules: usageRules + country: country + PRD: PRD + PLC: PLC + HNO: HNO + PRM: PRM + HNS: HNS + FLR: FLR + A1: A1 + A2: A2 + A3: A3 + A4: A4 + STS: STS + A5: A5 + A6: A6 + RDSEC: RDSEC + providedBy: providedBy + LOC: LOC + UNIT: UNIT + SEAT: SEAT + POD: POD + RDBR: RDBR + method: method + LMK: LMK + POM: POM + ADDCODE: ADDCODE + RD: RD + PC: PC + PCN: PCN + NAM: NAM + BLD: BLD + ROOM: ROOM + RDSUBBR: RDSUBBR + aefId: aefId + serviceKpis: + avalMem: avalMem + avalStor: avalStor + avalComp: avalComp + conBand: 0 + maxRestime: 0 + availability: 0 + maxReqRate: 0 + avalGraComp: avalGraComp + - protocol: HTTP_1_1 + versions: + - apiVersion: apiVersion + resources: + - operations: + - null + - null + commType: REQUEST_RESPONSE + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - null + - null + commType: REQUEST_RESPONSE + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + - apiVersion: apiVersion + resources: + - operations: + - null + - null + commType: REQUEST_RESPONSE + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - null + - null + commType: REQUEST_RESPONSE + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + dataFormat: JSON + aefLocation: + dcId: dcId + geoArea: + shape: POINT + point: + lon: -151.1701851434036 + lat: 18.494211295267263 + civicAddr: + POBOX: POBOX + usageRules: usageRules + country: country + PRD: PRD + PLC: PLC + HNO: HNO + PRM: PRM + HNS: HNS + FLR: FLR + A1: A1 + A2: A2 + A3: A3 + A4: A4 + STS: STS + A5: A5 + A6: A6 + RDSEC: RDSEC + providedBy: providedBy + LOC: LOC + UNIT: UNIT + SEAT: SEAT + POD: POD + RDBR: RDBR + method: method + LMK: LMK + POM: POM + ADDCODE: ADDCODE + RD: RD + PC: PC + PCN: PCN + NAM: NAM + BLD: BLD + ROOM: ROOM + RDSUBBR: RDSUBBR + aefId: aefId + serviceKpis: + avalMem: avalMem + avalStor: avalStor + avalComp: avalComp + conBand: 0 + maxRestime: 0 + availability: 0 + maxReqRate: 0 + avalGraComp: avalGraComp + suppFeat: suppFeat + properties: + discApis: + items: + $ref: '#/components/schemas/OpenAPIDetails' + minItems: 0 + title: discApis + type: array + suppFeat: + description: | + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of "0" to "9", "a" to "f" or "A" to "F" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. + pattern: "^[A-Fa-f0-9]*$" + title: SupportedFeatures + type: string + required: + - discApis + title: OpenDiscoveryResp + type: object + OpenAPIDetails: + description: | + Represents the Service API details provided within an Open Service API Discovery response. + example: + serviceAPICategory: serviceAPICategory + apiName: apiName + apiProvName: apiProvName + description: description + apiSuppFeats: apiSuppFeats + apiId: apiId + apiStatus: + aefIds: + - aefIds + - aefIds + aefProfiles: + - protocol: HTTP_1_1 + versions: + - apiVersion: apiVersion + resources: + - operations: + - null + - null + commType: REQUEST_RESPONSE + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - null + - null + commType: REQUEST_RESPONSE + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + - apiVersion: apiVersion + resources: + - operations: + - null + - null + commType: REQUEST_RESPONSE + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - null + - null + commType: REQUEST_RESPONSE + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + dataFormat: JSON + aefLocation: + dcId: dcId + geoArea: + shape: POINT + point: + lon: -151.1701851434036 + lat: 18.494211295267263 + civicAddr: + POBOX: POBOX + usageRules: usageRules + country: country + PRD: PRD + PLC: PLC + HNO: HNO + PRM: PRM + HNS: HNS + FLR: FLR + A1: A1 + A2: A2 + A3: A3 + A4: A4 + STS: STS + A5: A5 + A6: A6 + RDSEC: RDSEC + providedBy: providedBy + LOC: LOC + UNIT: UNIT + SEAT: SEAT + POD: POD + RDBR: RDBR + method: method + LMK: LMK + POM: POM + ADDCODE: ADDCODE + RD: RD + PC: PC + PCN: PCN + NAM: NAM + BLD: BLD + ROOM: ROOM + RDSUBBR: RDSUBBR + aefId: aefId + serviceKpis: + avalMem: avalMem + avalStor: avalStor + avalComp: avalComp + conBand: 0 + maxRestime: 0 + availability: 0 + maxReqRate: 0 + avalGraComp: avalGraComp + - protocol: HTTP_1_1 + versions: + - apiVersion: apiVersion + resources: + - operations: + - null + - null + commType: REQUEST_RESPONSE + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - null + - null + commType: REQUEST_RESPONSE + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + - apiVersion: apiVersion + resources: + - operations: + - null + - null + commType: REQUEST_RESPONSE + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - null + - null + commType: REQUEST_RESPONSE + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + dataFormat: JSON + aefLocation: + dcId: dcId + geoArea: + shape: POINT + point: + lon: -151.1701851434036 + lat: 18.494211295267263 + civicAddr: + POBOX: POBOX + usageRules: usageRules + country: country + PRD: PRD + PLC: PLC + HNO: HNO + PRM: PRM + HNS: HNS + FLR: FLR + A1: A1 + A2: A2 + A3: A3 + A4: A4 + STS: STS + A5: A5 + A6: A6 + RDSEC: RDSEC + providedBy: providedBy + LOC: LOC + UNIT: UNIT + SEAT: SEAT + POD: POD + RDBR: RDBR + method: method + LMK: LMK + POM: POM + ADDCODE: ADDCODE + RD: RD + PC: PC + PCN: PCN + NAM: NAM + BLD: BLD + ROOM: ROOM + RDSUBBR: RDSUBBR + aefId: aefId + serviceKpis: + avalMem: avalMem + avalStor: avalStor + avalComp: avalComp + conBand: 0 + maxRestime: 0 + availability: 0 + maxReqRate: 0 + avalGraComp: avalGraComp + properties: + apiName: + title: apiName + type: string + apiId: + title: apiId + type: string + apiStatus: + $ref: '#/components/schemas/ApiStatus' + description: + title: description + type: string + serviceAPICategory: + title: serviceAPICategory + type: string + apiSuppFeats: + description: | + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of "0" to "9", "a" to "f" or "A" to "F" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. + pattern: "^[A-Fa-f0-9]*$" + title: SupportedFeatures + type: string + apiProvName: + title: apiProvName + type: string + aefProfiles: + items: + $ref: '#/components/schemas/OpenAefProfile' + minItems: 1 + title: aefProfiles + type: array + required: + - apiName + title: OpenAPIDetails + type: object + OpenAefProfile: + description: Represents the AEF Profile details provided within an Open Service + API Discovery response. + example: + protocol: HTTP_1_1 + versions: + - apiVersion: apiVersion + resources: + - operations: + - null + - null + commType: REQUEST_RESPONSE + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - null + - null + commType: REQUEST_RESPONSE + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + - apiVersion: apiVersion + resources: + - operations: + - null + - null + commType: REQUEST_RESPONSE + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - null + - null + commType: REQUEST_RESPONSE + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + dataFormat: JSON + aefLocation: + dcId: dcId + geoArea: + shape: POINT + point: + lon: -151.1701851434036 + lat: 18.494211295267263 + civicAddr: + POBOX: POBOX + usageRules: usageRules + country: country + PRD: PRD + PLC: PLC + HNO: HNO + PRM: PRM + HNS: HNS + FLR: FLR + A1: A1 + A2: A2 + A3: A3 + A4: A4 + STS: STS + A5: A5 + A6: A6 + RDSEC: RDSEC + providedBy: providedBy + LOC: LOC + UNIT: UNIT + SEAT: SEAT + POD: POD + RDBR: RDBR + method: method + LMK: LMK + POM: POM + ADDCODE: ADDCODE + RD: RD + PC: PC + PCN: PCN + NAM: NAM + BLD: BLD + ROOM: ROOM + RDSUBBR: RDSUBBR + aefId: aefId + serviceKpis: + avalMem: avalMem + avalStor: avalStor + avalComp: avalComp + conBand: 0 + maxRestime: 0 + availability: 0 + maxReqRate: 0 + avalGraComp: avalGraComp + properties: + aefId: + title: aefId + type: string + versions: + items: + $ref: '#/components/schemas/Version' + minItems: 1 + title: versions + type: array + protocol: + $ref: '#/components/schemas/Protocol' + dataFormat: + $ref: '#/components/schemas/DataFormat' + aefLocation: + $ref: '#/components/schemas/AefLocation' + serviceKpis: + $ref: '#/components/schemas/ServiceKpis' + title: OpenAefProfile + type: object + CommunicationType: + anyOf: + - enum: + - REQUEST_RESPONSE + - SUBSCRIBE_NOTIFY + type: string + - description: | + This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. + type: string + description: "Indicates a communication type of the resource or the custom operation.\ + \ \nPossible values are:\n- REQUEST_RESPONSE: The communication is of the\ + \ type request-response.\n- SUBSCRIBE_NOTIFY: The communication is of the\ + \ type subscribe-notify.\n" + title: CommunicationType + Protocol: + anyOf: + - enum: + - HTTP_1_1 + - HTTP_2 + - MQTT + - WEBSOCKET + type: string + - description: | + This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. + type: string + description: "Indicates a protocol and protocol version used by the API. \n\ + Possible values are:\n- HTTP_1_1: Indicates that the protocol is HTTP version\ + \ 1.1.\n- HTTP_2: Indicates that the protocol is HTTP version 2.\n- MQTT:\ + \ Indicates that the protocol is Message Queuing Telemetry Transport.\n- WEBSOCKET:\ + \ Indicates that the protocol is Websocket.\n" + title: Protocol + DataFormat: + anyOf: + - enum: + - JSON + - XML + - PROTOBUF3 + type: string + - description: | + This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. + type: string + description: "Indicates a data format. \nPossible values are:\n- JSON: Indicates\ + \ that the data format is JSON.\n- XML: Indicates that the data format is\ + \ Extensible Markup Language.\n- PROTOBUF3: Indicates that the data format\ + \ is Protocol buffers version 3.\n" + title: DataFormat + AefLocation: + description: | + Represents the location information (e.g. civic address, GPS coordinates, data center ID) where the AEF providing the service API is located. + example: + dcId: dcId + geoArea: + shape: POINT + point: + lon: -151.1701851434036 + lat: 18.494211295267263 + civicAddr: + POBOX: POBOX + usageRules: usageRules + country: country + PRD: PRD + PLC: PLC + HNO: HNO + PRM: PRM + HNS: HNS + FLR: FLR + A1: A1 + A2: A2 + A3: A3 + A4: A4 + STS: STS + A5: A5 + A6: A6 + RDSEC: RDSEC + providedBy: providedBy + LOC: LOC + UNIT: UNIT + SEAT: SEAT + POD: POD + RDBR: RDBR + method: method + LMK: LMK + POM: POM + ADDCODE: ADDCODE + RD: RD + PC: PC + PCN: PCN + NAM: NAM + BLD: BLD + ROOM: ROOM + RDSUBBR: RDSUBBR + properties: + civicAddr: + $ref: '#/components/schemas/CivicAddress' + geoArea: + $ref: '#/components/schemas/GeographicArea' + dcId: + description: | + Identifies the data center where the AEF providing the service API is located. + title: dcId + type: string + title: AefLocation + type: object + SupportedFeatures: + description: | + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of "0" to "9", "a" to "f" or "A" to "F" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. + pattern: "^[A-Fa-f0-9]*$" + title: SupportedFeatures + type: string + ServiceKpis: + description: | + Represents information about the service characteristics provided by a service API. + example: + avalMem: avalMem + avalStor: avalStor + avalComp: avalComp + conBand: 0 + maxRestime: 0 + availability: 0 + maxReqRate: 0 + avalGraComp: avalGraComp + properties: + maxReqRate: + description: "Unsigned Integer, i.e. only value 0 and integers above 0 are\ + \ permissible." + minimum: 0 + title: Uinteger + type: integer + maxRestime: + description: Unsigned integer identifying a period of time in units of seconds. + minimum: 0 + title: DurationSec + type: integer + availability: + description: "Unsigned Integer, i.e. only value 0 and integers above 0 are\ + \ permissible." + minimum: 0 + title: Uinteger + type: integer + avalComp: + description: | + The maximum compute resource available in FLOPS for the API Invoker. + pattern: ^\d+(\.\d+)? (kFLOPS|MFLOPS|GFLOPS|TFLOPS|PFLOPS|EFLOPS|ZFLOPS)$ + title: avalComp + type: string + avalGraComp: + description: | + The maximum graphical compute resource in FLOPS available for the API Invoker. + pattern: ^\d+(\.\d+)? (kFLOPS|MFLOPS|GFLOPS|TFLOPS|PFLOPS|EFLOPS|ZFLOPS)$ + title: avalGraComp + type: string + avalMem: + description: | + The maximum memory resource available for the API Invoker. + pattern: ^\d+(\.\d+)? (KB|MB|GB|TB|PB|EB|ZB|YB)$ + title: avalMem + type: string + avalStor: + description: | + The maximum storage resource available for the API Invoker. + pattern: ^\d+(\.\d+)? (KB|MB|GB|TB|PB|EB|ZB|YB)$ + title: avalStor + type: string + conBand: + description: "Unsigned Integer, i.e. only value 0 and integers above 0 are\ + \ permissible." + minimum: 0 + title: Uinteger + type: integer + title: ServiceKpis + type: object + ResOperInfo: + description: | + Represents the resourse and/or service operation. + properties: + resource: + description: string providing an URI formatted according to IETF RFC 3986. + title: type + type: string + operations: + items: + $ref: '#/components/schemas/Operation' + minItems: 1 + title: operations + type: array + customServOpers: + items: + type: string + minItems: 1 + title: customServOpers + type: array + title: ResOperInfo + type: object + ProblemDetails: + description: Represents additional information and details on an error response. + properties: + type: + description: string providing an URI formatted according to IETF RFC 3986. + title: type + type: string + title: + description: "A short, human-readable summary of the problem type. It should\ + \ not change from occurrence to occurrence of the problem. \n" + title: title + type: string + status: + description: The HTTP status code for this occurrence of the problem. + title: status + type: integer + detail: + description: A human-readable explanation specific to this occurrence of + the problem. + title: detail + type: string + instance: + description: string providing an URI formatted according to IETF RFC 3986. + title: type + type: string + cause: + description: | + A machine-readable application error cause specific to this occurrence of the problem. This IE should be present and provide application-related error information, if available. + title: cause + type: string + invalidParams: + description: | + Description of invalid parameters, for a request rejected due to invalid parameters. + items: + $ref: '#/components/schemas/InvalidParam' + minItems: 1 + title: invalidParams + type: array + supportedFeatures: + description: | + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of "0" to "9", "a" to "f" or "A" to "F" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. + pattern: "^[A-Fa-f0-9]*$" + title: SupportedFeatures + type: string + title: ProblemDetails + type: object + Uri: + description: string providing an URI formatted according to IETF RFC 3986. + title: type + type: string + InvalidParam: + description: | + Represents the description of invalid parameters, for a request rejected due to invalid parameters. + properties: + param: + description: "Attribute's name encoded as a JSON Pointer, or header's name." + title: param + type: string + reason: + description: "A human-readable reason, e.g. \"must be a positive integer\"\ + ." + title: reason + type: string + required: + - param + title: InvalidParam + type: object + ApiStatus: + description: | + Represents the API status. + example: + aefIds: + - aefIds + - aefIds + properties: + aefIds: + description: "Indicates the list of AEF ID(s) where the API is active. If\ + \ an empty array is provided, it indicates that the API is inactive in\ + \ all AEF(s). \n" + items: + type: string + title: aefIds + type: array + required: + - aefIds + title: ApiStatus + type: object + Version: + description: Represents the API version information. + example: + apiVersion: apiVersion + resources: + - operations: + - null + - null + commType: REQUEST_RESPONSE + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - null + - null + commType: REQUEST_RESPONSE + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + properties: + apiVersion: + description: API major version in URI (e.g. v1) + title: apiVersion + type: string + expiry: + description: string with format "date-time" as defined in OpenAPI. + format: date-time + title: DateTime + type: string + resources: + description: Resources supported by the API. + items: + $ref: '#/components/schemas/Resource' + minItems: 1 + title: resources + type: array + custOperations: + description: Custom operations without resource association. + items: + $ref: '#/components/schemas/CustomOperation' + minItems: 1 + title: custOperations + type: array + required: + - apiVersion + title: Version + type: object + Resource: + description: Represents the API resource data. + example: + operations: + - null + - null + commType: REQUEST_RESPONSE + custOperations: + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + - operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + properties: + resourceName: + description: Resource name + title: resourceName + type: string + commType: + $ref: '#/components/schemas/CommunicationType' + uri: + description: | + Relative URI of the API resource, it is set as {apiSpecificSuffixes} part of the URI structure as defined in clause 5.2.4 of 3GPP TS 29.122. + title: uri + type: string + custOpName: + description: | + it is set as {custOpName} part of the URI structure for a custom operation associated with a resource as defined in clause 5.2.4 of 3GPP TS 29.122. + title: custOpName + type: string + custOperations: + description: | + Custom operations associated with this resource. + items: + $ref: '#/components/schemas/CustomOperation' + minItems: 1 + title: custOperations + type: array + operations: + description: | + Supported HTTP methods for the API resource. Only applicable when the protocol in AefProfile indicates HTTP. + items: + $ref: '#/components/schemas/Operation' + minItems: 1 + title: operations + type: array + description: + description: Text description of the API resource + title: description + type: string + required: + - commType + - resourceName + - uri + title: Resource + type: object + CustomOperation: + description: Represents the description of a custom operation. + example: + operations: + - GET + - GET + commType: null + description: description + custOpName: custOpName + properties: + commType: + $ref: '#/components/schemas/CommunicationType' + custOpName: + description: | + it is set as {custOpName} part of the URI structure for a custom operation without resource association as defined in clause 5.2.4 of 3GPP TS 29.122. + title: custOpName + type: string + operations: + description: | + Supported HTTP methods for the API resource. Only applicable when the protocol in AefProfile indicates HTTP. + items: + $ref: '#/components/schemas/Operation' + minItems: 1 + title: operations + type: array + description: + description: Text description of the custom operation + title: description + type: string + required: + - commType + - custOpName + title: CustomOperation + type: object + Operation: + anyOf: + - enum: + - GET + - POST + - PUT + - PATCH + - DELETE + type: string + - description: | + This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. + type: string + description: "Indicates an HTTP method. \nPossible values are:\n- GET: HTTP\ + \ GET method.\n- POST: HTTP POST method.\n- PUT: HTTP PUT method.\n- PATCH:\ + \ HTTP PATCH method.\n- DELETE: HTTP DELETE method.\n" + title: Operation + CivicAddress: + description: Indicates a Civic address. + example: + POBOX: POBOX + usageRules: usageRules + country: country + PRD: PRD + PLC: PLC + HNO: HNO + PRM: PRM + HNS: HNS + FLR: FLR + A1: A1 + A2: A2 + A3: A3 + A4: A4 + STS: STS + A5: A5 + A6: A6 + RDSEC: RDSEC + providedBy: providedBy + LOC: LOC + UNIT: UNIT + SEAT: SEAT + POD: POD + RDBR: RDBR + method: method + LMK: LMK + POM: POM + ADDCODE: ADDCODE + RD: RD + PC: PC + PCN: PCN + NAM: NAM + BLD: BLD + ROOM: ROOM + RDSUBBR: RDSUBBR + properties: + country: + title: country + type: string + A1: + title: A1 + type: string + A2: + title: A2 + type: string + A3: + title: A3 + type: string + A4: + title: A4 + type: string + A5: + title: A5 + type: string + A6: + title: A6 + type: string + PRD: + title: PRD + type: string + POD: + title: POD + type: string + STS: + title: STS + type: string + HNO: + title: HNO + type: string + HNS: + title: HNS + type: string + LMK: + title: LMK + type: string + LOC: + title: LOC + type: string + NAM: + title: NAM + type: string + PC: + title: PC + type: string + BLD: + title: BLD + type: string + UNIT: + title: UNIT + type: string + FLR: + title: FLR + type: string + ROOM: + title: ROOM + type: string + PLC: + title: PLC + type: string + PCN: + title: PCN + type: string + POBOX: + title: POBOX + type: string + ADDCODE: + title: ADDCODE + type: string + SEAT: + title: SEAT + type: string + RD: + title: RD + type: string + RDSEC: + title: RDSEC + type: string + RDBR: + title: RDBR + type: string + RDSUBBR: + title: RDSUBBR + type: string + PRM: + title: PRM + type: string + POM: + title: POM + type: string + usageRules: + title: usageRules + type: string + method: + title: method + type: string + providedBy: + title: providedBy + type: string + title: CivicAddress + type: object + GeographicArea: + anyOf: + - $ref: '#/components/schemas/Point' + - $ref: '#/components/schemas/PointUncertaintyCircle' + - $ref: '#/components/schemas/PointUncertaintyEllipse' + - $ref: '#/components/schemas/Polygon' + - $ref: '#/components/schemas/PointAltitude' + - $ref: '#/components/schemas/PointAltitudeUncertainty' + - $ref: '#/components/schemas/EllipsoidArc' + description: Geographic area specified by different shape. + title: GeographicArea + Point: + allOf: + - $ref: '#/components/schemas/GADShape' + - properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + required: + - point + type: object + description: Ellipsoid Point. + example: + shape: POINT + point: + lon: -151.1701851434036 + lat: 18.494211295267263 + title: Point + GADShape: + description: Common base type for GAD shapes. + discriminator: + mapping: + POINT: '#/components/schemas/Point' + POINT_UNCERTAINTY_CIRCLE: '#/components/schemas/PointUncertaintyCircle' + POINT_UNCERTAINTY_ELLIPSE: '#/components/schemas/PointUncertaintyEllipse' + POLYGON: '#/components/schemas/Polygon' + POINT_ALTITUDE: '#/components/schemas/PointAltitude' + POINT_ALTITUDE_UNCERTAINTY: '#/components/schemas/PointAltitudeUncertainty' + ELLIPSOID_ARC: '#/components/schemas/EllipsoidArc' + LOCAL_2D_POINT_UNCERTAINTY_ELLIPSE: '#/components/schemas/Local2dPointUncertaintyEllipse' + LOCAL_3D_POINT_UNCERTAINTY_ELLIPSOID: '#/components/schemas/Local3dPointUncertaintyEllipsoid' + propertyName: shape + properties: + shape: + $ref: '#/components/schemas/SupportedGADShapes' + required: + - shape + title: GADShape + type: object + SupportedGADShapes: + anyOf: + - enum: + - POINT + - POINT_UNCERTAINTY_CIRCLE + - POINT_UNCERTAINTY_ELLIPSE + - POLYGON + - POINT_ALTITUDE + - POINT_ALTITUDE_UNCERTAINTY + - ELLIPSOID_ARC + - LOCAL_2D_POINT_UNCERTAINTY_ELLIPSE + - LOCAL_3D_POINT_UNCERTAINTY_ELLIPSOID + - DISTANCE_DIRECTION + - RELATIVE_2D_LOCATION_UNCERTAINTY_ELLIPSE + - RELATIVE_3D_LOCATION_UNCERTAINTY_ELLIPSOID + type: string + - type: string + description: Indicates supported GAD shapes. + title: SupportedGADShapes + PointUncertaintyCircle: + allOf: + - $ref: '#/components/schemas/GADShape' + - properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + uncertainty: + $ref: '#/components/schemas/Uncertainty' + required: + - point + - uncertainty + type: object + description: Ellipsoid point with uncertainty circle. + title: PointUncertaintyCircle + GeographicalCoordinates: + description: Geographical coordinates. + example: + lon: -151.1701851434036 + lat: 18.494211295267263 + properties: + lon: + format: double + maximum: 180 + minimum: -180 + title: lon + type: number + lat: + format: double + maximum: 90 + minimum: -90 + title: lat + type: number + required: + - lat + - lon + title: GeographicalCoordinates + type: object + Uncertainty: + description: Indicates value of uncertainty. + format: float + minimum: 0 + title: Uncertainty + type: number + PointUncertaintyEllipse: + allOf: + - $ref: '#/components/schemas/GADShape' + - properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + uncertaintyEllipse: + $ref: '#/components/schemas/UncertaintyEllipse' + confidence: + $ref: '#/components/schemas/Confidence' + required: + - confidence + - point + - uncertaintyEllipse + type: object + description: Ellipsoid point with uncertainty ellipse. + title: PointUncertaintyEllipse + UncertaintyEllipse: + description: Ellipse with uncertainty. + properties: + semiMajor: + description: Indicates value of uncertainty. + format: float + minimum: 0 + title: Uncertainty + type: number + semiMinor: + description: Indicates value of uncertainty. + format: float + minimum: 0 + title: Uncertainty + type: number + orientationMajor: + description: Indicates value of orientation angle. + maximum: 180 + minimum: 0 + title: Orientation + type: integer + required: + - orientationMajor + - semiMajor + - semiMinor + title: UncertaintyEllipse + type: object + Orientation: + description: Indicates value of orientation angle. + maximum: 180 + minimum: 0 + title: Orientation + type: integer + Confidence: + description: Indicates value of confidence. + maximum: 100 + minimum: 0 + type: integer + Polygon: + allOf: + - $ref: '#/components/schemas/GADShape' + - properties: + pointList: + $ref: '#/components/schemas/PointList' + required: + - pointList + type: object + description: Polygon. + title: Polygon + PointList: + description: List of points. + items: + $ref: '#/components/schemas/GeographicalCoordinates' + maxItems: 15 + minItems: 3 + type: array + PointAltitude: + allOf: + - $ref: '#/components/schemas/GADShape' + - properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + altitude: + $ref: '#/components/schemas/Altitude' + required: + - altitude + - point + type: object + description: Ellipsoid point with altitude. + title: PointAltitude + Altitude: + description: Indicates value of altitude. + format: double + maximum: 32767 + minimum: -32767 + type: number + PointAltitudeUncertainty: + allOf: + - $ref: '#/components/schemas/GADShape' + - properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + altitude: + $ref: '#/components/schemas/Altitude' + uncertaintyEllipse: + $ref: '#/components/schemas/UncertaintyEllipse' + uncertaintyAltitude: + $ref: '#/components/schemas/Uncertainty' + confidence: + $ref: '#/components/schemas/Confidence' + vConfidence: + $ref: '#/components/schemas/Confidence' + required: + - altitude + - confidence + - point + - uncertaintyAltitude + - uncertaintyEllipse + type: object + description: Ellipsoid point with altitude and uncertainty ellipsoid. + title: PointAltitudeUncertainty + EllipsoidArc: + allOf: + - $ref: '#/components/schemas/GADShape' + - properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + innerRadius: + $ref: '#/components/schemas/InnerRadius' + uncertaintyRadius: + $ref: '#/components/schemas/Uncertainty' + offsetAngle: + $ref: '#/components/schemas/Angle' + includedAngle: + $ref: '#/components/schemas/Angle' + confidence: + $ref: '#/components/schemas/Confidence' + required: + - confidence + - includedAngle + - innerRadius + - offsetAngle + - point + - uncertaintyRadius + type: object + description: Ellipsoid Arc. + title: EllipsoidArc + InnerRadius: + description: Indicates value of the inner radius. + format: int32 + maximum: 327675 + minimum: 0 + type: integer + Angle: + description: Indicates value of angle. + maximum: 360 + minimum: 0 + type: integer + Local2dPointUncertaintyEllipse: + allOf: + - $ref: '#/components/schemas/GADShape' + - properties: + localOrigin: + $ref: '#/components/schemas/LocalOrigin' + point: + $ref: '#/components/schemas/RelativeCartesianLocation' + uncertaintyEllipse: + $ref: '#/components/schemas/UncertaintyEllipse' + confidence: + $ref: '#/components/schemas/Confidence' + required: + - confidence + - localOrigin + - point + - uncertaintyEllipse + type: object + description: Local 2D point with uncertainty ellipse + LocalOrigin: + description: Indicates a Local origin in a reference system + properties: + coordinateId: + title: coordinateId + type: string + point: + $ref: '#/components/schemas/GeographicalCoordinates' + area: + $ref: '#/components/schemas/GeographicArea' + horizAxesOrientation: + description: Horizontal axes orientation angle clockwise from northing in + 0.1 degrees. + maximum: 3600 + minimum: 0 + title: HorizAxesOrientation + type: integer + required: + - coordinateId + title: LocalOrigin + type: object + HorizAxesOrientation: + description: Horizontal axes orientation angle clockwise from northing in 0.1 + degrees. + maximum: 3600 + minimum: 0 + title: HorizAxesOrientation + type: integer + RelativeCartesianLocation: + description: Relative Cartesian Location + properties: + x: + description: string with format 'float' as defined in OpenAPI. + format: float + title: Float + type: number + "y": + description: string with format 'float' as defined in OpenAPI. + format: float + title: Float + type: number + z: + description: string with format 'float' as defined in OpenAPI. + format: float + title: Float + type: number + required: + - x + - "y" + title: RelativeCartesianLocation + type: object + Local3dPointUncertaintyEllipsoid: + allOf: + - $ref: '#/components/schemas/GADShape' + - properties: + localOrigin: + $ref: '#/components/schemas/LocalOrigin' + point: + $ref: '#/components/schemas/RelativeCartesianLocation' + uncertaintyEllipsoid: + $ref: '#/components/schemas/UncertaintyEllipsoid' + confidence: + $ref: '#/components/schemas/Confidence' + vConfidence: + $ref: '#/components/schemas/Confidence' + required: + - confidence + - localOrigin + - point + - uncertaintyEllipsoid + type: object + description: Local 3D point with uncertainty ellipsoid + UncertaintyEllipsoid: + description: Ellipsoid with uncertainty + properties: + semiMajor: + description: Indicates value of uncertainty. + format: float + minimum: 0 + title: Uncertainty + type: number + semiMinor: + description: Indicates value of uncertainty. + format: float + minimum: 0 + title: Uncertainty + type: number + vertical: + description: Indicates value of uncertainty. + format: float + minimum: 0 + title: Uncertainty + type: number + orientationMajor: + description: Indicates value of orientation angle. + maximum: 180 + minimum: 0 + title: Orientation + type: integer + required: + - orientationMajor + - semiMajor + - semiMinor + - vertical + title: UncertaintyEllipsoid + type: object + Uinteger: + description: "Unsigned Integer, i.e. only value 0 and integers above 0 are permissible." + minimum: 0 + title: Uinteger + type: integer + DurationSec: + description: Unsigned integer identifying a period of time in units of seconds. + minimum: 0 + title: DurationSec + type: integer + DateTime: + description: string with format "date-time" as defined in OpenAPI. + format: date-time + title: DateTime + type: string + Float: + description: string with format 'float' as defined in OpenAPI. + format: float + title: Float + type: number diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/test/__init__.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/test/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1ff862fdc457550ca2c804bd2bbaa31cfcd54ee2 --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/test/__init__.py @@ -0,0 +1,15 @@ +import logging + +import connexion +from flask_testing import TestCase +from openapi_server.encoder import JSONEncoder + + +class BaseTestCase(TestCase): + + def create_app(self): + logging.getLogger('connexion.operation').setLevel('ERROR') + app = connexion.App(__name__, specification_dir='../openapi/') + app.app.json_encoder = JSONEncoder + app.add_api('openapi.yaml', pythonic_params=True) + return app.app diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/test/test_default_controller.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/test/test_default_controller.py new file mode 100644 index 0000000000000000000000000000000000000000..96e22b12d34423f55c8ca2aeec0e6852717fcc84 --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/test/test_default_controller.py @@ -0,0 +1,50 @@ +import unittest + +from openapi_server.models.aef_location import AefLocation # noqa: E501 +from openapi_server.models.communication_type import \ + CommunicationType # noqa: E501 +from openapi_server.models.data_format import DataFormat # noqa: E501 +from openapi_server.models.open_discovery_resp import \ + OpenDiscoveryResp # noqa: E501 +from openapi_server.models.problem_details import ProblemDetails # noqa: E501 +from openapi_server.models.protocol import Protocol # noqa: E501 +from openapi_server.models.res_oper_info import ResOperInfo # noqa: E501 +from openapi_server.models.service_kpis import ServiceKpis # noqa: E501 +from openapi_server.test import BaseTestCase + + +class TestDefaultController(BaseTestCase): + """DefaultController integration test stubs""" + + def test_service_apis_get(self): + """Test case for service_apis_get + + + """ + query_string = [('api-names', ['api_names_example']), + ('api-versions', {'key': openapi_server.List[str]()}), + ('comm-type', openapi_server.CommunicationType()), + ('protocols', [openapi_server.Protocol()]), + ('data-format', openapi_server.DataFormat()), + ('api-cats', ['api_cats_example']), + ('preferred-aef-loc', openapi_server.AefLocation()), + ('api-prov-names', ['api_prov_names_example']), + ('api-supported-features', {'key': 'api_supported_features_example'}), + ('api-ids', ['api_ids_example']), + ('service-kpis', openapi_server.ServiceKpis()), + ('res-ops', [openapi_server.ResOperInfo()]), + ('supported-features', 'supported_features_example')] + headers = { + 'Accept': 'application/json', + } + response = self.client.open( + '/open-api-disc/v1/service-apis', + method='GET', + headers=headers, + query_string=query_string) + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + +if __name__ == '__main__': + unittest.main() diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/typing_utils.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/typing_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..74e3c913a7db6246bc765f147ca872996112c6bb --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/typing_utils.py @@ -0,0 +1,30 @@ +import sys + +if sys.version_info < (3, 7): + import typing + + def is_generic(klass): + """ Determine whether klass is a generic class """ + return type(klass) == typing.GenericMeta + + def is_dict(klass): + """ Determine whether klass is a Dict """ + return klass.__extra__ == dict + + def is_list(klass): + """ Determine whether klass is a List """ + return klass.__extra__ == list + +else: + + def is_generic(klass): + """ Determine whether klass is a generic class """ + return hasattr(klass, '__origin__') + + def is_dict(klass): + """ Determine whether klass is a Dict """ + return klass.__origin__ == dict + + def is_list(klass): + """ Determine whether klass is a List """ + return klass.__origin__ == list diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/util.py b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/util.py new file mode 100644 index 0000000000000000000000000000000000000000..eed61878494dbe2845da77be79a2d2189e416fd3 --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/openapi_server/util.py @@ -0,0 +1,146 @@ +import datetime + +from openapi_server import typing_utils + + +def _deserialize(data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if klass in (int, float, str, bool, bytearray): + return _deserialize_primitive(data, klass) + elif klass == object: + return _deserialize_object(data) + elif klass == datetime.date: + return deserialize_date(data) + elif klass == datetime.datetime: + return deserialize_datetime(data) + elif typing_utils.is_generic(klass): + if typing_utils.is_list(klass): + return _deserialize_list(data, klass.__args__[0]) + if typing_utils.is_dict(klass): + return _deserialize_dict(data, klass.__args__[1]) + else: + return deserialize_model(data, klass) + + +def _deserialize_primitive(data, klass): + """Deserializes to primitive type. + + :param data: data to deserialize. + :param klass: class literal. + + :return: int, long, float, str, bool. + :rtype: int | long | float | str | bool + """ + try: + value = klass(data) + except UnicodeEncodeError: + value = data + except TypeError: + value = data + return value + + +def _deserialize_object(value): + """Return an original value. + + :return: object. + """ + return value + + +def deserialize_date(string): + """Deserializes string to date. + + :param string: str. + :type string: str + :return: date. + :rtype: date + """ + if string is None: + return None + + try: + from dateutil.parser import parse + return parse(string).date() + except ImportError: + return string + + +def deserialize_datetime(string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :type string: str + :return: datetime. + :rtype: datetime + """ + if string is None: + return None + + try: + from dateutil.parser import parse + return parse(string) + except ImportError: + return string + + +def deserialize_model(data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :type data: dict | list + :param klass: class literal. + :return: model object. + """ + instance = klass() + + if not instance.openapi_types: + return data + + for attr, attr_type in instance.openapi_types.items(): + if data is not None \ + and instance.attribute_map[attr] in data \ + and isinstance(data, (list, dict)): + value = data[instance.attribute_map[attr]] + setattr(instance, attr, _deserialize(value, attr_type)) + + return instance + + +def _deserialize_list(data, boxed_type): + """Deserializes a list and its elements. + + :param data: list to deserialize. + :type data: list + :param boxed_type: class literal. + + :return: deserialized list. + :rtype: list + """ + return [_deserialize(sub_data, boxed_type) + for sub_data in data] + + +def _deserialize_dict(data, boxed_type): + """Deserializes a dict and its elements. + + :param data: dict to deserialize. + :type data: dict + :param boxed_type: class literal. + + :return: deserialized dict. + :rtype: dict + """ + return {k: _deserialize(v, boxed_type) + for k, v in data.items() } diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/requirements.txt b/services/TS29222_CAPIF_Open_Discover_Service_API/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..bad8612ccb9f832523f432a00338a5c540b635eb --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/requirements.txt @@ -0,0 +1,13 @@ +connexion[swagger-ui] >= 2.6.0; python_version>="3.6" +# 2.3 is the last version that supports python 3.4-3.5 +connexion[swagger-ui] <= 2.3.0; python_version=="3.5" or python_version=="3.4" +# prevent breaking dependencies from advent of connexion>=3.0 +connexion[swagger-ui] <= 2.14.2; python_version>"3.4" +# connexion requires werkzeug but connexion < 2.4.0 does not install werkzeug +# we must peg werkzeug versions below to fix connexion +# https://github.com/zalando/connexion/pull/1044 +werkzeug == 0.16.1; python_version=="3.5" or python_version=="3.4" +swagger-ui-bundle >= 0.0.2 +python_dateutil >= 2.6.0 +setuptools == 80.9.0 +Flask == 2.1.1 diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/setup.py b/services/TS29222_CAPIF_Open_Discover_Service_API/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..a83307af28c427b12a4a30f574db820036bf055f --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/setup.py @@ -0,0 +1,37 @@ + +from setuptools import find_packages, setup + +NAME = "openapi_server" +VERSION = "1.0.0" + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools + +REQUIRES = [ + "connexion>=2.0.2", + "swagger-ui-bundle>=0.0.2", + "python_dateutil>=2.6.0" +] + +setup( + name=NAME, + version=VERSION, + description="CAPIF_Open_Discover_Service_API", + author_email="", + url="", + keywords=["OpenAPI", "CAPIF_Open_Discover_Service_API"], + install_requires=REQUIRES, + packages=find_packages(), + package_data={'': ['openapi/openapi.yaml']}, + include_package_data=True, + entry_points={ + 'console_scripts': ['openapi_server=openapi_server.__main__:main']}, + long_description="""\ + API for Routing information. © 2025, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. + """ +) + diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/test-requirements.txt b/services/TS29222_CAPIF_Open_Discover_Service_API/test-requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..58f51d6a00272d7515a20e3618f345b73c68afa0 --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/test-requirements.txt @@ -0,0 +1,4 @@ +pytest~=7.1.0 +pytest-cov>=2.8.1 +pytest-randomly>=1.2.3 +Flask-Testing==0.8.1 diff --git a/services/TS29222_CAPIF_Open_Discover_Service_API/tox.ini b/services/TS29222_CAPIF_Open_Discover_Service_API/tox.ini new file mode 100644 index 0000000000000000000000000000000000000000..7663dfb69e419c3f9e41b6a9da19ed34f1da334b --- /dev/null +++ b/services/TS29222_CAPIF_Open_Discover_Service_API/tox.ini @@ -0,0 +1,11 @@ +[tox] +envlist = py3 +skipsdist=True + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + {toxinidir} + +commands= + pytest --cov=openapi_server diff --git a/services/TS29222_CAPIF_Publish_Service_API/.openapi-generator/FILES b/services/TS29222_CAPIF_Publish_Service_API/.openapi-generator/FILES index 44333b51519691ba1428cad21ca5c707b9b66549..796ae4ed759e4e2b64e605f2f244d1cda4111696 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/.openapi-generator/FILES +++ b/services/TS29222_CAPIF_Publish_Service_API/.openapi-generator/FILES @@ -34,6 +34,7 @@ published_apis/models/ipv6_address_range.py published_apis/models/local2d_point_uncertainty_ellipse.py published_apis/models/local3d_point_uncertainty_ellipsoid.py published_apis/models/local_origin.py +published_apis/models/net_slice_id.py published_apis/models/o_auth_grant_type.py published_apis/models/operation.py published_apis/models/point.py @@ -52,6 +53,7 @@ published_apis/models/service_api_description.py published_apis/models/service_api_description_patch.py published_apis/models/service_kpis.py published_apis/models/shareable_information.py +published_apis/models/snssai.py published_apis/models/supported_gad_shapes.py published_apis/models/uncertainty_ellipse.py published_apis/models/uncertainty_ellipsoid.py diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/app.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/app.py index 46e0941cd496c55614ddff1b3e82c1187d455535..a0f866ad7dda871122ae390d332bc6da766e8fcb 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/app.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/app.py @@ -15,13 +15,15 @@ from flask_executor import Executor from flask_jwt_extended import JWTManager from fluent import sender from opentelemetry import trace -from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter +from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import \ + OTLPSpanExporter from opentelemetry.instrumentation.flask import FlaskInstrumentor from opentelemetry.instrumentation.redis import RedisInstrumentor from opentelemetry.sdk.resources import Resource from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import BatchSpanProcessor -from opentelemetry.trace.propagation.tracecontext import TraceContextTextMapPropagator +from opentelemetry.trace.propagation.tracecontext import \ + TraceContextTextMapPropagator NAME = "Publish-Service" diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/controllers/default_controller.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/controllers/default_controller.py index 29839084d1420d7243c9c1bd655a8f8cdf52a5cf..7908b28e5607d59023a21a47f3f267a0b16713d7 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/controllers/default_controller.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/controllers/default_controller.py @@ -3,13 +3,18 @@ from functools import wraps from cryptography import x509 from cryptography.hazmat.backends import default_backend from flask import current_app, request -from published_apis.vendor_specific import find_attribute_in_body, vendor_specific_key_n_value + +from ..core.responses import bad_request_error, unauthorized_error +from published_apis.models.problem_details import ProblemDetails # noqa: E501 +from published_apis.vendor_specific import (find_attribute_in_body, + vendor_specific_key_n_value) from ..core.responses import bad_request_error -from ..core.serviceapidescriptions import PublishServiceOperations -from ..core.serviceapidescriptions import return_negotiated_supp_feat_dict +from ..core.serviceapidescriptions import (PublishServiceOperations, + return_negotiated_supp_feat_dict) from ..core.validate_user import ControlAccess -from ..models.service_api_description import ServiceAPIDescription # noqa: E501 +from ..models.service_api_description import \ + ServiceAPIDescription # noqa: E501 service_operations = PublishServiceOperations() @@ -21,7 +26,11 @@ def cert_validation(): def __cert_validation(*args, **kwargs): args = request.view_args - cert_tmp = request.headers['X-Ssl-Client-Cert'] + cert_tmp = request.headers.get('X-Ssl-Client-Cert') + + if not cert_tmp: + return unauthorized_error("Client certificate required", "X-Ssl-Client-Cert header is missing") + cert_raw = cert_tmp.replace('\t', '') cert = x509.load_pem_x509_certificate( diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/controllers/individual_apf_published_api_controller.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/controllers/individual_apf_published_api_controller.py index 78336ca4aa2717bb23f1adc21a57fbb828c4d828..291ca99c79fb1dc1cf4aa2549e37ac6dfcf1ebdc 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/controllers/individual_apf_published_api_controller.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/controllers/individual_apf_published_api_controller.py @@ -3,7 +3,10 @@ from functools import wraps from cryptography import x509 from cryptography.hazmat.backends import default_backend from flask import current_app, request -from published_apis.models.service_api_description_patch import ServiceAPIDescriptionPatch # noqa: E501 + +from ..core.responses import unauthorized_error +from published_apis.models.service_api_description_patch import \ + ServiceAPIDescriptionPatch # noqa: E501 from ..core.serviceapidescriptions import PublishServiceOperations from ..core.validate_user import ControlAccess @@ -17,7 +20,11 @@ def cert_validation(): def __cert_validation(*args, **kwargs): args = request.view_args - cert_tmp = request.headers['X-Ssl-Client-Cert'] + cert_tmp = request.headers.get('X-Ssl-Client-Cert') + + if not cert_tmp: + return unauthorized_error("Client certificate required", "X-Ssl-Client-Cert header is missing") + cert_raw = cert_tmp.replace('\t', '') cert = x509.load_pem_x509_certificate( diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/responses.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/responses.py index 1f0302f64b0ac1791aa594b5b16772343af286b9..8ba055f9295f90258ff39547a9f4af1b22a75a30 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/responses.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/responses.py @@ -33,7 +33,7 @@ def bad_request_error(detail, cause, invalid_params): prob = ProblemDetails(title="Bad Request", status=400, detail=detail, cause=cause, invalid_params=invalid_params) prob = serialize_clean_camel_case(prob) - return Response(json.dumps(prob, cls=CustomJSONEncoder), status=400, mimetype=cause) + return Response(json.dumps(prob, cls=CustomJSONEncoder), status=400, mimetype=mimetype) def not_found_error(detail, cause): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/serviceapidescriptions.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/serviceapidescriptions.py index 658957efe4602fe98d6151662c35d52ec95a24af..c2ff0506e213114e89ed5d6d2a52334ae6c09275 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/serviceapidescriptions.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/core/serviceapidescriptions.py @@ -12,15 +12,9 @@ from .auth_manager import AuthManager from .publisher import Publisher from .redis_event import RedisEvent from .resources import Resource -from .responses import ( - bad_request_error, - forbidden_error, - internal_server_error, - make_response, - not_found_error, - unauthorized_error -) - +from .responses import (bad_request_error, forbidden_error, + internal_server_error, make_response, not_found_error, + unauthorized_error) TOTAL_FEATURES = 10 SUPPORTED_FEATURES_HEX = "120" diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/aef_profile.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/aef_profile.py index b50b23b78c674d1b199b65a0ea0f151e9fe416dc..d91a4c6e16da97aab8b95c55a9231075c20f7f64 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/aef_profile.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/aef_profile.py @@ -5,9 +5,11 @@ from published_apis import util from published_apis.models.aef_location import AefLocation # noqa: E501 from published_apis.models.base_model import Model from published_apis.models.data_format import DataFormat # noqa: E501 -from published_apis.models.interface_description import InterfaceDescription # noqa: E501 +from published_apis.models.interface_description import \ + InterfaceDescription # noqa: E501 from published_apis.models.ip_addr_range import IpAddrRange # noqa: E501 -from published_apis.models.o_auth_grant_type import OAuthGrantType # noqa: E501 +from published_apis.models.o_auth_grant_type import \ + OAuthGrantType # noqa: E501 from published_apis.models.protocol import Protocol # noqa: E501 from published_apis.models.security_method import SecurityMethod # noqa: E501 from published_apis.models.service_kpis import ServiceKpis # noqa: E501 diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/api_status.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/api_status.py index 4fcf081767b9ecb1b39cd5d20da889340ca3fbcc..26964f0062695f1450b9f15de69f5550ca6b4f70 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/api_status.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/api_status.py @@ -42,7 +42,7 @@ class ApiStatus(Model): def aef_ids(self) -> List[str]: """Gets the aef_ids of this ApiStatus. - Indicates the list of AEF ID(s) where the API is active. If this attribute is omitted, the API is inactive at all AEF(s) defined in the \"aefProfiles\" attribute within the ServiceAPIDescription data structure. # noqa: E501 + Indicates the list of AEF ID(s) where the API is active. If an empty array is provided, it indicates that the API is inactive in all AEF(s). # noqa: E501 :return: The aef_ids of this ApiStatus. :rtype: List[str] @@ -53,7 +53,7 @@ class ApiStatus(Model): def aef_ids(self, aef_ids: List[str]): """Sets the aef_ids of this ApiStatus. - Indicates the list of AEF ID(s) where the API is active. If this attribute is omitted, the API is inactive at all AEF(s) defined in the \"aefProfiles\" attribute within the ServiceAPIDescription data structure. # noqa: E501 + Indicates the list of AEF ID(s) where the API is active. If an empty array is provided, it indicates that the API is inactive in all AEF(s). # noqa: E501 :param aef_ids: The aef_ids of this ApiStatus. :type aef_ids: List[str] diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/custom_operation.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/custom_operation.py index 2900d43e17262cad2e54846c54435e290ce8b8e7..e9557704a2cb9207011b4d5d615ca9566ecd68d7 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/custom_operation.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/custom_operation.py @@ -3,7 +3,8 @@ from typing import Dict, List # noqa: F401 from published_apis import util from published_apis.models.base_model import Model -from published_apis.models.communication_type import CommunicationType # noqa: E501 +from published_apis.models.communication_type import \ + CommunicationType # noqa: E501 from published_apis.models.operation import Operation # noqa: E501 diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ellipsoid_arc.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ellipsoid_arc.py index 9b065e534e33fc866ce64014a327986c52bf3708..4e6598b38a154f284e31c3273564fd19f77889a3 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ellipsoid_arc.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ellipsoid_arc.py @@ -4,8 +4,10 @@ from typing import Dict, List # noqa: F401 from published_apis import util from published_apis.models.base_model import Model from published_apis.models.gad_shape import GADShape # noqa: E501 -from published_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 -from published_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 +from published_apis.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from published_apis.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 class EllipsoidArc(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/gad_shape.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/gad_shape.py index 370e1da43523b25efd6ff6b24aaf82bb884c62c5..527ea67552c92c5905fe9c21c50a95e93b54dbd1 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/gad_shape.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/gad_shape.py @@ -3,7 +3,8 @@ from typing import Dict, List # noqa: F401 from published_apis import util from published_apis.models.base_model import Model -from published_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 +from published_apis.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 class GADShape(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/geographic_area.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/geographic_area.py index 226225be6b0c16d010f3b706afe4b3480c6c7b21..ac4963d86bb06db0cbc6410ac725b8e141507d7f 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/geographic_area.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/geographic_area.py @@ -4,15 +4,21 @@ from typing import Dict, List # noqa: F401 from published_apis import util from published_apis.models.base_model import Model from published_apis.models.ellipsoid_arc import EllipsoidArc # noqa: E501 -from published_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 +from published_apis.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 from published_apis.models.point import Point # noqa: E501 from published_apis.models.point_altitude import PointAltitude # noqa: E501 -from published_apis.models.point_altitude_uncertainty import PointAltitudeUncertainty # noqa: E501 -from published_apis.models.point_uncertainty_circle import PointUncertaintyCircle # noqa: E501 -from published_apis.models.point_uncertainty_ellipse import PointUncertaintyEllipse # noqa: E501 +from published_apis.models.point_altitude_uncertainty import \ + PointAltitudeUncertainty # noqa: E501 +from published_apis.models.point_uncertainty_circle import \ + PointUncertaintyCircle # noqa: E501 +from published_apis.models.point_uncertainty_ellipse import \ + PointUncertaintyEllipse # noqa: E501 from published_apis.models.polygon import Polygon # noqa: E501 -from published_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 -from published_apis.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 +from published_apis.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 +from published_apis.models.uncertainty_ellipse import \ + UncertaintyEllipse # noqa: E501 class GeographicArea(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/interface_description.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/interface_description.py index 7c8707c4f072fb8cde6149618d79f4268318439d..57beee926c81600c3ecdc697f91c1604379d04c0 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/interface_description.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/interface_description.py @@ -4,7 +4,8 @@ from typing import Dict, List # noqa: F401 from published_apis import util from published_apis.models.base_model import Model -from published_apis.models.o_auth_grant_type import OAuthGrantType # noqa: E501 +from published_apis.models.o_auth_grant_type import \ + OAuthGrantType # noqa: E501 from published_apis.models.security_method import SecurityMethod # noqa: E501 diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ip_addr_range.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ip_addr_range.py index 48c4ede0261690c73fc09e414d7b7b9941c611ed..17227d5177e6dbbdac4d343565b1e9819064c7e4 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ip_addr_range.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/ip_addr_range.py @@ -3,8 +3,10 @@ from typing import Dict, List # noqa: F401 from published_apis import util from published_apis.models.base_model import Model -from published_apis.models.ipv4_address_range import Ipv4AddressRange # noqa: E501 -from published_apis.models.ipv6_address_range import Ipv6AddressRange # noqa: E501 +from published_apis.models.ipv4_address_range import \ + Ipv4AddressRange # noqa: E501 +from published_apis.models.ipv6_address_range import \ + Ipv6AddressRange # noqa: E501 class IpAddrRange(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/local2d_point_uncertainty_ellipse.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/local2d_point_uncertainty_ellipse.py index 2b13ab8c53823918d162de6ef89908954298d456..5d918f096b0938f5b7a0af4fc7543fd786bbab67 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/local2d_point_uncertainty_ellipse.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/local2d_point_uncertainty_ellipse.py @@ -5,9 +5,12 @@ from published_apis import util from published_apis.models.base_model import Model from published_apis.models.gad_shape import GADShape # noqa: E501 from published_apis.models.local_origin import LocalOrigin # noqa: E501 -from published_apis.models.relative_cartesian_location import RelativeCartesianLocation # noqa: E501 -from published_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 -from published_apis.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 +from published_apis.models.relative_cartesian_location import \ + RelativeCartesianLocation # noqa: E501 +from published_apis.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 +from published_apis.models.uncertainty_ellipse import \ + UncertaintyEllipse # noqa: E501 class Local2dPointUncertaintyEllipse(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/local3d_point_uncertainty_ellipsoid.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/local3d_point_uncertainty_ellipsoid.py index ca17643db139f7c8197dc2a855a196c848f6cacc..d10e304d8ce1c68d634061510cb2f1b492c6eff1 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/local3d_point_uncertainty_ellipsoid.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/local3d_point_uncertainty_ellipsoid.py @@ -5,9 +5,12 @@ from published_apis import util from published_apis.models.base_model import Model from published_apis.models.gad_shape import GADShape # noqa: E501 from published_apis.models.local_origin import LocalOrigin # noqa: E501 -from published_apis.models.relative_cartesian_location import RelativeCartesianLocation # noqa: E501 -from published_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 -from published_apis.models.uncertainty_ellipsoid import UncertaintyEllipsoid # noqa: E501 +from published_apis.models.relative_cartesian_location import \ + RelativeCartesianLocation # noqa: E501 +from published_apis.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 +from published_apis.models.uncertainty_ellipsoid import \ + UncertaintyEllipsoid # noqa: E501 class Local3dPointUncertaintyEllipsoid(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/local_origin.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/local_origin.py index d86b7142076691f2bfdad4b5b5b44e1a4afc1017..aaef45f0690d25bb27a5e37f425e009feaee62e1 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/local_origin.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/local_origin.py @@ -4,7 +4,8 @@ from typing import Dict, List # noqa: F401 from published_apis import util from published_apis.models.base_model import Model from published_apis.models.geographic_area import GeographicArea # noqa: E501 -from published_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 +from published_apis.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 class LocalOrigin(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/net_slice_id.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/net_slice_id.py new file mode 100644 index 0000000000000000000000000000000000000000..9f433ff32376376f3dc52e73e7d6b811d1cc116a --- /dev/null +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/net_slice_id.py @@ -0,0 +1,117 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from published_apis import util +from published_apis.models.base_model import Model +from published_apis.models.snssai import Snssai # noqa: E501 + + +class NetSliceId(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, snssai=None, nsi_id=None, ensi=None): # noqa: E501 + """NetSliceId - a model defined in OpenAPI + + :param snssai: The snssai of this NetSliceId. # noqa: E501 + :type snssai: Snssai + :param nsi_id: The nsi_id of this NetSliceId. # noqa: E501 + :type nsi_id: str + :param ensi: The ensi of this NetSliceId. # noqa: E501 + :type ensi: str + """ + self.openapi_types = { + 'snssai': Snssai, + 'nsi_id': str, + 'ensi': str + } + + self.attribute_map = { + 'snssai': 'snssai', + 'nsi_id': 'nsiId', + 'ensi': 'ensi' + } + + self._snssai = snssai + self._nsi_id = nsi_id + self._ensi = ensi + + @classmethod + def from_dict(cls, dikt) -> 'NetSliceId': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The NetSliceId of this NetSliceId. # noqa: E501 + :rtype: NetSliceId + """ + return util.deserialize_model(dikt, cls) + + @property + def snssai(self) -> Snssai: + """Gets the snssai of this NetSliceId. + + + :return: The snssai of this NetSliceId. + :rtype: Snssai + """ + return self._snssai + + @snssai.setter + def snssai(self, snssai: Snssai): + """Sets the snssai of this NetSliceId. + + + :param snssai: The snssai of this NetSliceId. + :type snssai: Snssai + """ + + self._snssai = snssai + + @property + def nsi_id(self) -> str: + """Gets the nsi_id of this NetSliceId. + + Contains the Identifier of the selected Network Slice instance # noqa: E501 + + :return: The nsi_id of this NetSliceId. + :rtype: str + """ + return self._nsi_id + + @nsi_id.setter + def nsi_id(self, nsi_id: str): + """Sets the nsi_id of this NetSliceId. + + Contains the Identifier of the selected Network Slice instance # noqa: E501 + + :param nsi_id: The nsi_id of this NetSliceId. + :type nsi_id: str + """ + + self._nsi_id = nsi_id + + @property + def ensi(self) -> str: + """Gets the ensi of this NetSliceId. + + Represents the External Network Slice Information that is used to identify a network slice, as specified in 3GPP TS 33.501. # noqa: E501 + + :return: The ensi of this NetSliceId. + :rtype: str + """ + return self._ensi + + @ensi.setter + def ensi(self, ensi: str): + """Sets the ensi of this NetSliceId. + + Represents the External Network Slice Information that is used to identify a network slice, as specified in 3GPP TS 33.501. # noqa: E501 + + :param ensi: The ensi of this NetSliceId. + :type ensi: str + """ + + self._ensi = ensi diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point.py index b0d7a764fe3f9ea0c8949c3694bd0c875378b912..a0fdab6bf672da18a13d8ec42fc5ec0b6d30ecf9 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point.py @@ -4,8 +4,10 @@ from typing import Dict, List # noqa: F401 from published_apis import util from published_apis.models.base_model import Model from published_apis.models.gad_shape import GADShape # noqa: E501 -from published_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 -from published_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 +from published_apis.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from published_apis.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 class Point(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_altitude.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_altitude.py index 7fd826c19e66f439059bbf63ce60c22732da0a1f..c1967bcff8aa49be1ad0f15cc13b63971029b3aa 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_altitude.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_altitude.py @@ -4,8 +4,10 @@ from typing import Dict, List # noqa: F401 from published_apis import util from published_apis.models.base_model import Model from published_apis.models.gad_shape import GADShape # noqa: E501 -from published_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 -from published_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 +from published_apis.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from published_apis.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 class PointAltitude(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_altitude_uncertainty.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_altitude_uncertainty.py index 98b36ca7499c574f0c07f8afbb79c3c5373be86d..2cbf072cd65c25c254c2a5876295ea7c7846f819 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_altitude_uncertainty.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_altitude_uncertainty.py @@ -4,9 +4,12 @@ from typing import Dict, List # noqa: F401 from published_apis import util from published_apis.models.base_model import Model from published_apis.models.gad_shape import GADShape # noqa: E501 -from published_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 -from published_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 -from published_apis.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 +from published_apis.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from published_apis.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 +from published_apis.models.uncertainty_ellipse import \ + UncertaintyEllipse # noqa: E501 class PointAltitudeUncertainty(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_uncertainty_circle.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_uncertainty_circle.py index 477dfae0a5dc41fc9de892511f8826cdbf56f0d9..d2dbf9eafd568ddf3d387fd3b879f30372b66d7f 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_uncertainty_circle.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_uncertainty_circle.py @@ -4,8 +4,10 @@ from typing import Dict, List # noqa: F401 from published_apis import util from published_apis.models.base_model import Model from published_apis.models.gad_shape import GADShape # noqa: E501 -from published_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 -from published_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 +from published_apis.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from published_apis.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 class PointUncertaintyCircle(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_uncertainty_ellipse.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_uncertainty_ellipse.py index 1e328c073b5bf6e476e872d24a34fd95e26d0539..9c1094f072c33ec5c0e9f0ab3c3c3d3afe5d8dbc 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_uncertainty_ellipse.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/point_uncertainty_ellipse.py @@ -4,9 +4,12 @@ from typing import Dict, List # noqa: F401 from published_apis import util from published_apis.models.base_model import Model from published_apis.models.gad_shape import GADShape # noqa: E501 -from published_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 -from published_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 -from published_apis.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 +from published_apis.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from published_apis.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 +from published_apis.models.uncertainty_ellipse import \ + UncertaintyEllipse # noqa: E501 class PointUncertaintyEllipse(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/polygon.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/polygon.py index d021ee3b87fe4b369133ee5793bcef43e6c7aa22..47b66cfe812a615b9c6320435ddc964171f57231 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/polygon.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/polygon.py @@ -4,8 +4,10 @@ from typing import Dict, List # noqa: F401 from published_apis import util from published_apis.models.base_model import Model from published_apis.models.gad_shape import GADShape # noqa: E501 -from published_apis.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 -from published_apis.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 +from published_apis.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from published_apis.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 class Polygon(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/resource.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/resource.py index d00e3ee8a4b0ace5c27b9cec789beb91f0530b2c..9c6c42e59f8834753eb60d38cc4f560f25c71ed7 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/resource.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/resource.py @@ -3,8 +3,10 @@ from typing import Dict, List # noqa: F401 from published_apis import util from published_apis.models.base_model import Model -from published_apis.models.communication_type import CommunicationType # noqa: E501 -from published_apis.models.custom_operation import CustomOperation # noqa: E501 +from published_apis.models.communication_type import \ + CommunicationType # noqa: E501 +from published_apis.models.custom_operation import \ + CustomOperation # noqa: E501 from published_apis.models.operation import Operation # noqa: E501 diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/service_api_description.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/service_api_description.py index 3f97250d39f8451513b1ff6905f7dfff8a4258b1..5d62e68b1d4076480f0d61b9b6d2fb15fd029ac7 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/service_api_description.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/service_api_description.py @@ -6,8 +6,11 @@ from published_apis import util from published_apis.models.aef_profile import AefProfile # noqa: E501 from published_apis.models.api_status import ApiStatus # noqa: E501 from published_apis.models.base_model import Model -from published_apis.models.published_api_path import PublishedApiPath # noqa: E501 -from published_apis.models.shareable_information import ShareableInformation # noqa: E501 +from published_apis.models.net_slice_id import NetSliceId # noqa: E501 +from published_apis.models.published_api_path import \ + PublishedApiPath # noqa: E501 +from published_apis.models.shareable_information import \ + ShareableInformation # noqa: E501 class ServiceAPIDescription(Model): @@ -16,7 +19,7 @@ class ServiceAPIDescription(Model): Do not edit the class manually. """ - def __init__(self, api_name=None, api_id=None, api_status=None, aef_profiles=None, description=None, supported_features=None, shareable_info=None, service_api_category=None, api_supp_feats=None, pub_api_path=None, ccf_id=None, api_prov_name=None): # noqa: E501 + def __init__(self, api_name=None, api_id=None, api_status=None, aef_profiles=None, description=None, supported_features=None, shareable_info=None, service_api_category=None, api_supp_feats=None, pub_api_path=None, ccf_id=None, api_prov_name=None, net_slice_info=None): # noqa: E501 """ServiceAPIDescription - a model defined in OpenAPI :param api_name: The api_name of this ServiceAPIDescription. # noqa: E501 @@ -43,6 +46,8 @@ class ServiceAPIDescription(Model): :type ccf_id: str :param api_prov_name: The api_prov_name of this ServiceAPIDescription. # noqa: E501 :type api_prov_name: str + :param net_slice_info: The net_slice_info of this ServiceAPIDescription. # noqa: E501 + :type net_slice_info: List[NetSliceId] """ self.openapi_types = { 'api_name': str, @@ -56,7 +61,8 @@ class ServiceAPIDescription(Model): 'api_supp_feats': str, 'pub_api_path': PublishedApiPath, 'ccf_id': str, - 'api_prov_name': str + 'api_prov_name': str, + 'net_slice_info': List[NetSliceId] } self.attribute_map = { @@ -71,7 +77,8 @@ class ServiceAPIDescription(Model): 'api_supp_feats': 'apiSuppFeats', 'pub_api_path': 'pubApiPath', 'ccf_id': 'ccfId', - 'api_prov_name': 'apiProvName' + 'api_prov_name': 'apiProvName', + 'net_slice_info': 'netSliceInfo' } self._api_name = api_name @@ -86,7 +93,7 @@ class ServiceAPIDescription(Model): self._pub_api_path = pub_api_path self._ccf_id = ccf_id self._api_prov_name = api_prov_name - + self._net_slice_info = net_slice_info @classmethod def from_dict(cls, dikt) -> 'ServiceAPIDescription': @@ -103,7 +110,7 @@ class ServiceAPIDescription(Model): def api_name(self) -> str: """Gets the api_name of this ServiceAPIDescription. - API name, it is set as {apiName} part of the URI structure as defined in clause 5.2.4 of 3GPP TS 29.122. # noqa: E501 + Contains the API name set to the value of the \"\" placeholder of the API URI as defined in clause 5.2.4 of 3GPP TS 29.122 [14]. # noqa: E501 :return: The api_name of this ServiceAPIDescription. :rtype: str @@ -114,7 +121,7 @@ class ServiceAPIDescription(Model): def api_name(self, api_name: str): """Sets the api_name of this ServiceAPIDescription. - API name, it is set as {apiName} part of the URI structure as defined in clause 5.2.4 of 3GPP TS 29.122. # noqa: E501 + Contains the API name set to the value of the \"\" placeholder of the API URI as defined in clause 5.2.4 of 3GPP TS 29.122 [14]. # noqa: E501 :param api_name: The api_name of this ServiceAPIDescription. :type api_name: str @@ -376,3 +383,28 @@ class ServiceAPIDescription(Model): """ self._api_prov_name = api_prov_name + + @property + def net_slice_info(self) -> List[NetSliceId]: + """Gets the net_slice_info of this ServiceAPIDescription. + + Represents the applicable network slice identifiers. # noqa: E501 + + :return: The net_slice_info of this ServiceAPIDescription. + :rtype: List[NetSliceId] + """ + return self._net_slice_info + + @net_slice_info.setter + def net_slice_info(self, net_slice_info: List[NetSliceId]): + """Sets the net_slice_info of this ServiceAPIDescription. + + Represents the applicable network slice identifiers. # noqa: E501 + + :param net_slice_info: The net_slice_info of this ServiceAPIDescription. + :type net_slice_info: List[NetSliceId] + """ + if net_slice_info is not None and len(net_slice_info) < 1: + raise ValueError("Invalid value for `net_slice_info`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._net_slice_info = net_slice_info diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/service_api_description_patch.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/service_api_description_patch.py index 283a1a0791a6f6f1b6f591a081b7f87b9dfe6fb0..6cb128e83893aedb566f9e60b4a68cc24cfb7440 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/service_api_description_patch.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/service_api_description_patch.py @@ -6,8 +6,10 @@ from published_apis import util from published_apis.models.aef_profile import AefProfile # noqa: E501 from published_apis.models.api_status import ApiStatus # noqa: E501 from published_apis.models.base_model import Model -from published_apis.models.published_api_path import PublishedApiPath # noqa: E501 -from published_apis.models.shareable_information import ShareableInformation # noqa: E501 +from published_apis.models.published_api_path import \ + PublishedApiPath # noqa: E501 +from published_apis.models.shareable_information import \ + ShareableInformation # noqa: E501 class ServiceAPIDescriptionPatch(Model): diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/shareable_information.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/shareable_information.py index a2dfbeaf55bb62c23ae192b2811662d34aa15690..926099ec63012912256424934e9c97f741437727 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/shareable_information.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/shareable_information.py @@ -47,7 +47,7 @@ class ShareableInformation(Model): def is_shareable(self) -> bool: """Gets the is_shareable of this ShareableInformation. - Set to \"true\" indicates that the service API and/or the service API category can be shared to the list of CAPIF provider domain information. Otherwise set to \"false\". # noqa: E501 + Indicates whether the service API and/or the service API category can be shared to the list of CAPIF provider domain information. true indicates that the service API and/or the service API category can be shared to the list of CAPIF provider domain information. false indicates that the service API and/or the service API category can not be shared to the list of CAPIF provider domain information. # noqa: E501 :return: The is_shareable of this ShareableInformation. :rtype: bool @@ -58,7 +58,7 @@ class ShareableInformation(Model): def is_shareable(self, is_shareable: bool): """Sets the is_shareable of this ShareableInformation. - Set to \"true\" indicates that the service API and/or the service API category can be shared to the list of CAPIF provider domain information. Otherwise set to \"false\". # noqa: E501 + Indicates whether the service API and/or the service API category can be shared to the list of CAPIF provider domain information. true indicates that the service API and/or the service API category can be shared to the list of CAPIF provider domain information. false indicates that the service API and/or the service API category can not be shared to the list of CAPIF provider domain information. # noqa: E501 :param is_shareable: The is_shareable of this ShareableInformation. :type is_shareable: bool diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/snssai.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/snssai.py new file mode 100644 index 0000000000000000000000000000000000000000..d143e2b48245153ae18b98f1d7c902647d512637 --- /dev/null +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/snssai.py @@ -0,0 +1,99 @@ +import re # noqa: E501 +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from published_apis import util +from published_apis.models.base_model import Model + + +class Snssai(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, sst=None, sd=None): # noqa: E501 + """Snssai - a model defined in OpenAPI + + :param sst: The sst of this Snssai. # noqa: E501 + :type sst: int + :param sd: The sd of this Snssai. # noqa: E501 + :type sd: str + """ + self.openapi_types = { + 'sst': int, + 'sd': str + } + + self.attribute_map = { + 'sst': 'sst', + 'sd': 'sd' + } + + self._sst = sst + self._sd = sd + + @classmethod + def from_dict(cls, dikt) -> 'Snssai': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The Snssai of this Snssai. # noqa: E501 + :rtype: Snssai + """ + return util.deserialize_model(dikt, cls) + + @property + def sst(self) -> int: + """Gets the sst of this Snssai. + + Unsigned integer, within the range 0 to 255, representing the Slice/Service Type. It indicates the expected Network Slice behaviour in terms of features and services. Values 0 to 127 correspond to the standardized SST range. Values 128 to 255 correspond to the Operator-specific range. See clause 28.4.2 of 3GPP TS 23.003. Standardized values are defined in clause 5.15.2.2 of 3GPP TS 23.501. # noqa: E501 + + :return: The sst of this Snssai. + :rtype: int + """ + return self._sst + + @sst.setter + def sst(self, sst: int): + """Sets the sst of this Snssai. + + Unsigned integer, within the range 0 to 255, representing the Slice/Service Type. It indicates the expected Network Slice behaviour in terms of features and services. Values 0 to 127 correspond to the standardized SST range. Values 128 to 255 correspond to the Operator-specific range. See clause 28.4.2 of 3GPP TS 23.003. Standardized values are defined in clause 5.15.2.2 of 3GPP TS 23.501. # noqa: E501 + + :param sst: The sst of this Snssai. + :type sst: int + """ + if sst is None: + raise ValueError("Invalid value for `sst`, must not be `None`") # noqa: E501 + if sst is not None and sst > 255: # noqa: E501 + raise ValueError("Invalid value for `sst`, must be a value less than or equal to `255`") # noqa: E501 + if sst is not None and sst < 0: # noqa: E501 + raise ValueError("Invalid value for `sst`, must be a value greater than or equal to `0`") # noqa: E501 + + self._sst = sst + + @property + def sd(self) -> str: + """Gets the sd of this Snssai. + + 3-octet string, representing the Slice Differentiator, in hexadecimal representation. Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent 4 bits. The most significant character representing the 4 most significant bits of the SD shall appear first in the string, and the character representing the 4 least significant bit of the SD shall appear last in the string. This is an optional parameter that complements the Slice/Service type(s) to allow to differentiate amongst multiple Network Slices of the same Slice/Service type. This IE shall be absent if no SD value is associated with the SST. # noqa: E501 + + :return: The sd of this Snssai. + :rtype: str + """ + return self._sd + + @sd.setter + def sd(self, sd: str): + """Sets the sd of this Snssai. + + 3-octet string, representing the Slice Differentiator, in hexadecimal representation. Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent 4 bits. The most significant character representing the 4 most significant bits of the SD shall appear first in the string, and the character representing the 4 least significant bit of the SD shall appear last in the string. This is an optional parameter that complements the Slice/Service type(s) to allow to differentiate amongst multiple Network Slices of the same Slice/Service type. This IE shall be absent if no SD value is associated with the SST. # noqa: E501 + + :param sd: The sd of this Snssai. + :type sd: str + """ + if sd is not None and not re.search(r'^[A-Fa-f0-9]{6}$', sd): # noqa: E501 + raise ValueError(r"Invalid value for `sd`, must be a follow pattern or equal to `/^[A-Fa-f0-9]{6}$/`") # noqa: E501 + + self._sd = sd diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/version.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/version.py index 4188ad7993ce37586e783b92532850928abad182..ce6a742063ef9a06baf4300e1bf127c3f91267f1 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/version.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/models/version.py @@ -3,7 +3,8 @@ from typing import Dict, List # noqa: F401 from published_apis import util from published_apis.models.base_model import Model -from published_apis.models.custom_operation import CustomOperation # noqa: E501 +from published_apis.models.custom_operation import \ + CustomOperation # noqa: E501 from published_apis.models.resource import Resource # noqa: E501 diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/openapi/openapi.yaml b/services/TS29222_CAPIF_Publish_Service_API/published_apis/openapi/openapi.yaml index 6fd9b48632d3bc98c7de20ed0a7ac3f16f1897f4..1b0c694a7893beafe65c4c59be99d7d3b1276eac 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/openapi/openapi.yaml +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/openapi/openapi.yaml @@ -1,11 +1,11 @@ openapi: 3.0.0 info: - description: "API for publishing service APIs. \n© 2024, 3GPP Organizational Partners\ + description: "API for publishing service APIs. \n© 2025, 3GPP Organizational Partners\ \ (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). \nAll rights reserved.\n" title: CAPIF_Publish_Service_API - version: 1.3.1 + version: 1.4.0-alpha.4 externalDocs: - description: 3GPP TS 29.222 V18.7.0 Common API Framework for 3GPP Northbound APIs + description: 3GPP TS 29.222 V19.3.0 Common API Framework for 3GPP Northbound APIs url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.222/ servers: - url: "{apiRoot}/published-apis/v1" @@ -35,8 +35,8 @@ paths: $ref: '#/components/schemas/ServiceAPIDescription' minItems: 0 type: array - description: Definition of all service API(s) published by the API publishing - function. + description: | + Definition of all service API(s) published by the API publishing function. If an empty array is provided, it indicates that there is no active published API at the CCF. "307": description: Temporary Redirect headers: @@ -309,8 +309,8 @@ paths: application/json: schema: $ref: '#/components/schemas/ServiceAPIDescription' - description: | - Definition of individual service API published by the API publishing function. + description: Definition of all service API(s) published by the API publishing + function. "307": description: Temporary Redirect headers: @@ -699,20 +699,9 @@ components: serviceAPICategory: serviceAPICategory ccfId: ccfId apiName: apiName - shareableInfo: - capifProvDoms: - - capifProvDoms - - capifProvDoms - isShareable: true apiProvName: apiProvName supportedFeatures: supportedFeatures description: description - apiSuppFeats: apiSuppFeats - apiId: apiId - apiStatus: - aefIds: - - aefIds - - aefIds aefProfiles: - protocol: HTTP_1_1 grantTypes: @@ -1138,6 +1127,28 @@ components: availability: 0 maxReqRate: 0 avalGraComp: avalGraComp + shareableInfo: + capifProvDoms: + - capifProvDoms + - capifProvDoms + isShareable: true + netSliceInfo: + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + - ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + apiSuppFeats: apiSuppFeats + apiId: apiId + apiStatus: + aefIds: + - aefIds + - aefIds pubApiPath: ccfIds: - ccfIds @@ -1145,7 +1156,7 @@ components: properties: apiName: description: | - API name, it is set as {apiName} part of the URI structure as defined in clause 5.2.4 of 3GPP TS 29.122. + Contains the API name set to the value of the "" placeholder of the API URI as defined in clause 5.2.4 of 3GPP TS 29.122 [14]. title: apiName type: string apiId: @@ -1195,6 +1206,13 @@ components: description: Represents the API provider name. title: apiProvName type: string + netSliceInfo: + description: Represents the applicable network slice identifiers. + items: + $ref: '#/components/schemas/NetSliceId' + minItems: 1 + title: netSliceInfo + type: array required: - apiName title: ServiceAPIDescription @@ -1215,9 +1233,9 @@ components: ipv4Addr: ipv4Addr nullable: true oneOf: - - required: ["fqdn"] - required: ["ipv4Addr"] - required: ["ipv6Addr"] + - required: ["fqdn"] properties: ipv4Addr: description: | @@ -1735,7 +1753,7 @@ components: properties: isShareable: description: | - Set to "true" indicates that the service API and/or the service API category can be shared to the list of CAPIF provider domain information. Otherwise set to "false". + Indicates whether the service API and/or the service API category can be shared to the list of CAPIF provider domain information. true indicates that the service API and/or the service API category can be shared to the list of CAPIF provider domain information. false indicates that the service API and/or the service API category can not be shared to the list of CAPIF provider domain information. title: isShareable type: boolean capifProvDoms: @@ -1871,8 +1889,9 @@ components: - aefIds properties: aefIds: - description: | - Indicates the list of AEF ID(s) where the API is active. If this attribute is omitted, the API is inactive at all AEF(s) defined in the "aefProfiles" attribute within the ServiceAPIDescription data structure. + description: "Indicates the list of AEF ID(s) where the API is active. If\ + \ an empty array is provided, it indicates that the API is inactive in\ + \ all AEF(s). \n" items: type: string title: aefIds @@ -1944,7 +1963,7 @@ components: title: ServiceKpis type: object IpAddrRange: - anyOf: + anyOf: - required: ["ueIpv4AddrRanges"] - required: ["ueIpv6AddrRanges"] description: Represents the list of public IP ranges @@ -2107,6 +2126,39 @@ components: pattern: "^[A-Fa-f0-9]*$" title: supportedFeatures type: string + NetSliceId: + description: | + Represents the network slice identification information. + example: + ensi: ensi + snssai: + sd: sd + sst: 237 + nsiId: nsiId + nullable: true + oneOf: + - required: ["snssai"] + - required: ["nsiId"] + - required: ["ensi"] + properties: + snssai: + $ref: '#/components/schemas/Snssai' + nsiId: + description: Contains the Identifier of the selected Network Slice instance + title: NsiId + type: string + ensi: + description: | + Represents the External Network Slice Information that is used to identify a network slice, as specified in 3GPP TS 33.501. + title: Ensi + type: string + title: NetSliceId + type: object + Ensi: + description: | + Represents the External Network Slice Information that is used to identify a network slice, as specified in 3GPP TS 33.501. + title: Ensi + type: string Ipv4Addr: description: | string identifying a Ipv4 address formatted in the "dotted decimal" notation as defined in IETF RFC 1166. @@ -2353,7 +2405,6 @@ components: - DISTANCE_DIRECTION - RELATIVE_2D_LOCATION_UNCERTAINTY_ELLIPSE - RELATIVE_3D_LOCATION_UNCERTAINTY_ELLIPSOID - type: string description: Indicates supported GAD shapes. title: SupportedGADShapes @@ -2743,6 +2794,38 @@ components: example: 2001:db8:85a3::8a2e:370:7334 title: Ipv6Addr_1 type: string + Snssai: + description: | + When Snssai needs to be converted to string (e.g. when used in maps as key), the string shall be composed of one to three digits "sst" optionally followed by "-" and 6 hexadecimal digits "sd". + example: + sd: sd + sst: 237 + properties: + sst: + description: "Unsigned integer, within the range 0 to 255, representing\ + \ the Slice/Service Type. It indicates the expected Network Slice behaviour\ + \ in terms of features and services. Values 0 to 127 correspond to the\ + \ standardized SST range. Values 128 to 255 correspond to the Operator-specific\ + \ range. See clause 28.4.2 of 3GPP TS 23.003. Standardized values are\ + \ defined in clause 5.15.2.2 of 3GPP TS 23.501. \n" + maximum: 255 + minimum: 0 + title: sst + type: integer + sd: + description: | + 3-octet string, representing the Slice Differentiator, in hexadecimal representation. Each character in the string shall take a value of "0" to "9", "a" to "f" or "A" to "F" and shall represent 4 bits. The most significant character representing the 4 most significant bits of the SD shall appear first in the string, and the character representing the 4 least significant bit of the SD shall appear last in the string. This is an optional parameter that complements the Slice/Service type(s) to allow to differentiate amongst multiple Network Slices of the same Slice/Service type. This IE shall be absent if no SD value is associated with the SST. + pattern: "^[A-Fa-f0-9]{6}$" + title: sd + type: string + required: + - sst + title: Snssai + type: object + NsiId: + description: Contains the Identifier of the selected Network Slice instance + title: NsiId + type: string Float: description: string with format 'float' as defined in OpenAPI. format: float diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/test/test_default_controller.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/test/test_default_controller.py index aa3a20d40b74688c95ec3c6258472fa735487f0d..d8205f8df06ec92cce5d6d9538a3d0f3098bfce8 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/test/test_default_controller.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/test/test_default_controller.py @@ -2,7 +2,8 @@ import unittest from flask import json from published_apis.models.problem_details import ProblemDetails # noqa: E501 -from published_apis.models.service_api_description import ServiceAPIDescription # noqa: E501 +from published_apis.models.service_api_description import \ + ServiceAPIDescription # noqa: E501 from published_apis.test import BaseTestCase @@ -29,7 +30,7 @@ class TestDefaultController(BaseTestCase): """ - service_api_description = {"serviceAPICategory":"serviceAPICategory","ccfId":"ccfId","apiName":"apiName","shareableInfo":{"capifProvDoms":["capifProvDoms","capifProvDoms"],"isShareable":True},"apiProvName":"apiProvName","supportedFeatures":"supportedFeatures","description":"description","apiSuppFeats":"apiSuppFeats","apiId":"apiId","apiStatus":{"aefIds":["aefIds","aefIds"]},"aefProfiles":[{"protocol":"HTTP_1_1","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}},{"protocol":"HTTP_1_1","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}}],"pubApiPath":{"ccfIds":["ccfIds","ccfIds"]}} + service_api_description = {"serviceAPICategory":"serviceAPICategory","ccfId":"ccfId","apiName":"apiName","apiProvName":"apiProvName","supportedFeatures":"supportedFeatures","description":"description","aefProfiles":[{"protocol":"HTTP_1_1","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}},{"protocol":"HTTP_1_1","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}}],"shareableInfo":{"capifProvDoms":["capifProvDoms","capifProvDoms"],"isShareable":True},"netSliceInfo":[{"ensi":"ensi","snssai":{"sd":"sd","sst":237},"nsiId":"nsiId"},{"ensi":"ensi","snssai":{"sd":"sd","sst":237},"nsiId":"nsiId"}],"apiSuppFeats":"apiSuppFeats","apiId":"apiId","apiStatus":{"aefIds":["aefIds","aefIds"]},"pubApiPath":{"ccfIds":["ccfIds","ccfIds"]}} headers = { 'Accept': 'application/json', 'Content-Type': 'application/json', @@ -78,7 +79,7 @@ class TestDefaultController(BaseTestCase): """ - service_api_description = {"serviceAPICategory":"serviceAPICategory","ccfId":"ccfId","apiName":"apiName","shareableInfo":{"capifProvDoms":["capifProvDoms","capifProvDoms"],"isShareable":True},"apiProvName":"apiProvName","supportedFeatures":"supportedFeatures","description":"description","apiSuppFeats":"apiSuppFeats","apiId":"apiId","apiStatus":{"aefIds":["aefIds","aefIds"]},"aefProfiles":[{"protocol":"HTTP_1_1","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}},{"protocol":"HTTP_1_1","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}}],"pubApiPath":{"ccfIds":["ccfIds","ccfIds"]}} + service_api_description = {"serviceAPICategory":"serviceAPICategory","ccfId":"ccfId","apiName":"apiName","apiProvName":"apiProvName","supportedFeatures":"supportedFeatures","description":"description","aefProfiles":[{"protocol":"HTTP_1_1","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}},{"protocol":"HTTP_1_1","grantTypes":["CLIENT_CREDENTIALS","CLIENT_CREDENTIALS"],"ueIpRange":{"ueIpv4AddrRanges":[{"start":"198.51.100.1","end":"198.51.100.1"},{"start":"198.51.100.1","end":"198.51.100.1"}],"ueIpv6AddrRanges":[{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"},{"start":"2001:db8:85a3::8a2e:370:7334","end":"2001:db8:85a3::8a2e:370:7334"}]},"securityMethods":["PSK","PSK"],"versions":[{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"},{"apiVersion":"apiVersion","resources":[{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"},{"operations":[null,null],"commType":"REQUEST_RESPONSE","custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"description":"description","resourceName":"resourceName","custOpName":"custOpName","uri":"uri"}],"custOperations":[{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"},{"operations":["GET","GET"],"description":"description","custOpName":"custOpName"}],"expiry":"2000-01-23T04:56:07.000+00:00"}],"dataFormat":"JSON","domainName":"domainName","aefLocation":{"dcId":"dcId","geoArea":{"shape":"POINT","point":{"lon":36.988422590534526,"lat":-63.615366350946985}},"civicAddr":{"POBOX":"POBOX","usageRules":"usageRules","country":"country","PRD":"PRD","PLC":"PLC","HNO":"HNO","PRM":"PRM","HNS":"HNS","FLR":"FLR","A1":"A1","A2":"A2","A3":"A3","A4":"A4","STS":"STS","A5":"A5","A6":"A6","RDSEC":"RDSEC","providedBy":"providedBy","LOC":"LOC","UNIT":"UNIT","SEAT":"SEAT","POD":"POD","RDBR":"RDBR","method":"method","LMK":"LMK","POM":"POM","ADDCODE":"ADDCODE","RD":"RD","PC":"PC","PCN":"PCN","NAM":"NAM","BLD":"BLD","ROOM":"ROOM","RDSUBBR":"RDSUBBR"}},"aefId":"aefId","interfaceDescriptions":[{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"},{"ipv6Addr":"ipv6Addr","grantTypes":[null,null],"securityMethods":[null,null],"fqdn":"fqdn","port":5248,"apiPrefix":"apiPrefix","ipv4Addr":"ipv4Addr"}],"serviceKpis":{"avalMem":"avalMem","avalStor":"avalStor","avalComp":"avalComp","conBand":0,"maxRestime":0,"availability":0,"maxReqRate":0,"avalGraComp":"avalGraComp"}}],"shareableInfo":{"capifProvDoms":["capifProvDoms","capifProvDoms"],"isShareable":True},"netSliceInfo":[{"ensi":"ensi","snssai":{"sd":"sd","sst":237},"nsiId":"nsiId"},{"ensi":"ensi","snssai":{"sd":"sd","sst":237},"nsiId":"nsiId"}],"apiSuppFeats":"apiSuppFeats","apiId":"apiId","apiStatus":{"aefIds":["aefIds","aefIds"]},"pubApiPath":{"ccfIds":["ccfIds","ccfIds"]}} headers = { 'Accept': 'application/json', 'Content-Type': 'application/json', diff --git a/services/TS29222_CAPIF_Publish_Service_API/published_apis/test/test_individual_apf_published_api_controller.py b/services/TS29222_CAPIF_Publish_Service_API/published_apis/test/test_individual_apf_published_api_controller.py index c9664f15017ceed886888771eb336d2eba60dd60..5503d2d179d20b0ddb37a7bb2474afa7184b3ddf 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/published_apis/test/test_individual_apf_published_api_controller.py +++ b/services/TS29222_CAPIF_Publish_Service_API/published_apis/test/test_individual_apf_published_api_controller.py @@ -2,8 +2,10 @@ import unittest from flask import json from published_apis.models.problem_details import ProblemDetails # noqa: E501 -from published_apis.models.service_api_description import ServiceAPIDescription # noqa: E501 -from published_apis.models.service_api_description_patch import ServiceAPIDescriptionPatch # noqa: E501 +from published_apis.models.service_api_description import \ + ServiceAPIDescription # noqa: E501 +from published_apis.models.service_api_description_patch import \ + ServiceAPIDescriptionPatch # noqa: E501 from published_apis.test import BaseTestCase diff --git a/services/TS29222_CAPIF_Publish_Service_API/requirements.txt b/services/TS29222_CAPIF_Publish_Service_API/requirements.txt index 73be6c5fc1a99d4511cb803ed2df4131fe2f5404..3d20aa33f8e0d27b1505abca44156888deb42dc3 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/requirements.txt +++ b/services/TS29222_CAPIF_Publish_Service_API/requirements.txt @@ -1,25 +1,25 @@ connexion[flask, swagger-ui, uvicorn] == 3.1.0; python_version>="3.6" swagger-ui-bundle >= 0.0.2 python_dateutil >= 2.6.0 -setuptools == 74.0.0 +setuptools == 80.9.0 Flask == 3.0.3 pymongo == 4.7.3 redis == 4.5.4 flask_jwt_extended == 4.6.0 -cryptography == 42.0.8 -opentelemetry-instrumentation == 0.38b0 -opentelemetry-instrumentation-flask == 0.38b0 -opentelemetry-instrumentation-redis == 0.38b0 -opentelemetry-instrumentation-pymongo == 0.38b0 -opentelemetry-exporter-otlp == 1.17.0 -opentelemetry-exporter-jaeger == 1.19.0 +cryptography == 46.0.1 +opentelemetry-instrumentation == 0.41b0 +opentelemetry-instrumentation-flask == 0.41b0 +opentelemetry-instrumentation-redis == 0.41b0 +opentelemetry-instrumentation-pymongo == 0.41b0 +opentelemetry-exporter-otlp == 1.20.0 +opentelemetry-exporter-jaeger == 1.21.0 fluent == 0.10.0 fluent-logger == 0.10.0 -opentelemetry-api == 1.17.0 -opentelemetry-sdk == 1.17.0 +opentelemetry-api == 1.20.0 +opentelemetry-sdk == 1.20.0 flask_executor == 1.0.0 Flask-APScheduler == 1.13.1 -werkzeug == 3.0.4 +werkzeug == 3.1.3 gunicorn == 23.0.0 packaging == 24.0 diff --git a/services/TS29222_CAPIF_Publish_Service_API/setup.py b/services/TS29222_CAPIF_Publish_Service_API/setup.py index 9cd039a1bc7640b1fd10d53f0531b12407a742f5..bff47bfdebd52a96421d7dc59fc0bf4749e0c5c8 100644 --- a/services/TS29222_CAPIF_Publish_Service_API/setup.py +++ b/services/TS29222_CAPIF_Publish_Service_API/setup.py @@ -31,7 +31,7 @@ setup( entry_points={ 'console_scripts': ['published_apis=published_apis.__main__:main']}, long_description="""\ - API for publishing service APIs. © 2024, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. + API for publishing service APIs. © 2025, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. """ ) diff --git a/services/TS29222_CAPIF_Routing_Info_API/.openapi-generator/FILES b/services/TS29222_CAPIF_Routing_Info_API/.openapi-generator/FILES index 850cbed46d8e4ac07390cf5d14736db4d0d18d56..d977414f7be765deea6e69fb09fb1341e78a07b7 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/.openapi-generator/FILES +++ b/services/TS29222_CAPIF_Routing_Info_API/.openapi-generator/FILES @@ -1,6 +1,5 @@ .dockerignore .gitignore -.openapi-generator-ignore .travis.yml Dockerfile README.md @@ -56,7 +55,6 @@ capif_routing_info/models/uncertainty_ellipsoid.py capif_routing_info/models/version.py capif_routing_info/openapi/openapi.yaml capif_routing_info/test/__init__.py -capif_routing_info/test/test_default_controller.py capif_routing_info/typing_utils.py capif_routing_info/util.py requirements.txt diff --git a/services/TS29222_CAPIF_Routing_Info_API/README.md b/services/TS29222_CAPIF_Routing_Info_API/README.md index b239418e6ca48afcab32df49aeb265a57a253a3c..bd17fcfce256507c746e6e844e703fd1cfc1828e 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/README.md +++ b/services/TS29222_CAPIF_Routing_Info_API/README.md @@ -15,7 +15,7 @@ To run the server, please execute the following from the root directory: ``` pip3 install -r requirements.txt -python3 -m capif_routing_info +python3 -m openapi_server ``` and open your browser to here: @@ -42,8 +42,8 @@ To run the server on a Docker container, please execute the following from the r ```bash # building the image -docker build -t capif_routing_info . +docker build -t openapi_server . # starting up a container -docker run -p 8080:8080 capif_routing_info +docker run -p 8080:8080 openapi_server ``` \ No newline at end of file diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/controllers/default_controller.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/controllers/default_controller.py index 575fc24577116a078df5342b9a1462681ebc80e1..09656f49d6fd558983fcefdc5f42ed443386631a 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/controllers/default_controller.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/controllers/default_controller.py @@ -1,5 +1,6 @@ -from capif_routing_info.models.problem_details import ProblemDetails # noqa: E501 +from capif_routing_info.models.problem_details import \ + ProblemDetails # noqa: E501 from capif_routing_info.models.routing_info import RoutingInfo # noqa: E501 diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/aef_location.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/aef_location.py index aede9133a325c6682962fc375903c6acadcd0ead..360463c5ac7f2f6eb40786e666df29311785837d 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/aef_location.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/aef_location.py @@ -4,7 +4,8 @@ from typing import Dict, List # noqa: F401 from capif_routing_info import util from capif_routing_info.models.base_model import Model from capif_routing_info.models.civic_address import CivicAddress # noqa: E501 -from capif_routing_info.models.geographic_area import GeographicArea # noqa: E501 +from capif_routing_info.models.geographic_area import \ + GeographicArea # noqa: E501 class AefLocation(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/aef_profile.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/aef_profile.py index 62efcf1933982f08fdec8ac9ba615ee15cf59186..00ae4c85d7a6a27d3386cf0f8ed792f413d3986d 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/aef_profile.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/aef_profile.py @@ -5,11 +5,14 @@ from capif_routing_info import util from capif_routing_info.models.aef_location import AefLocation # noqa: E501 from capif_routing_info.models.base_model import Model from capif_routing_info.models.data_format import DataFormat # noqa: E501 -from capif_routing_info.models.interface_description import InterfaceDescription # noqa: E501 +from capif_routing_info.models.interface_description import \ + InterfaceDescription # noqa: E501 from capif_routing_info.models.ip_addr_range import IpAddrRange # noqa: E501 -from capif_routing_info.models.o_auth_grant_type import OAuthGrantType # noqa: E501 +from capif_routing_info.models.o_auth_grant_type import \ + OAuthGrantType # noqa: E501 from capif_routing_info.models.protocol import Protocol # noqa: E501 -from capif_routing_info.models.security_method import SecurityMethod # noqa: E501 +from capif_routing_info.models.security_method import \ + SecurityMethod # noqa: E501 from capif_routing_info.models.service_kpis import ServiceKpis # noqa: E501 from capif_routing_info.models.version import Version # noqa: E501 diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/custom_operation.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/custom_operation.py index d6a2f42a3104b9149eafe68ef56b6fbaa00e9ce4..fb1b852598b76986bcb9924067209f0b3373afca 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/custom_operation.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/custom_operation.py @@ -3,7 +3,8 @@ from typing import Dict, List # noqa: F401 from capif_routing_info import util from capif_routing_info.models.base_model import Model -from capif_routing_info.models.communication_type import CommunicationType # noqa: E501 +from capif_routing_info.models.communication_type import \ + CommunicationType # noqa: E501 from capif_routing_info.models.operation import Operation # noqa: E501 diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ellipsoid_arc.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ellipsoid_arc.py index 246c731e1ce7b941bed67947d7a8106555fb41f1..939772aae5f9404c8cb6bae39b2f0d4b3be64330 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ellipsoid_arc.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ellipsoid_arc.py @@ -4,8 +4,10 @@ from typing import Dict, List # noqa: F401 from capif_routing_info import util from capif_routing_info.models.base_model import Model from capif_routing_info.models.gad_shape import GADShape # noqa: E501 -from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 -from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 +from capif_routing_info.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from capif_routing_info.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 class EllipsoidArc(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/gad_shape.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/gad_shape.py index c4606e3addf004a87ad47faee99e0125aaae8a54..c027b8773b0278db32c0609faada90ebd4e6b125 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/gad_shape.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/gad_shape.py @@ -3,7 +3,8 @@ from typing import Dict, List # noqa: F401 from capif_routing_info import util from capif_routing_info.models.base_model import Model -from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 +from capif_routing_info.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 class GADShape(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/geographic_area.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/geographic_area.py index 83b2f60ac2c2c0dcb7aa3ec96295a4b3a8844536..013d4207f9c63dce614aed199e2b1a13e307282c 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/geographic_area.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/geographic_area.py @@ -4,15 +4,22 @@ from typing import Dict, List # noqa: F401 from capif_routing_info import util from capif_routing_info.models.base_model import Model from capif_routing_info.models.ellipsoid_arc import EllipsoidArc # noqa: E501 -from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 +from capif_routing_info.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 from capif_routing_info.models.point import Point # noqa: E501 -from capif_routing_info.models.point_altitude import PointAltitude # noqa: E501 -from capif_routing_info.models.point_altitude_uncertainty import PointAltitudeUncertainty # noqa: E501 -from capif_routing_info.models.point_uncertainty_circle import PointUncertaintyCircle # noqa: E501 -from capif_routing_info.models.point_uncertainty_ellipse import PointUncertaintyEllipse # noqa: E501 +from capif_routing_info.models.point_altitude import \ + PointAltitude # noqa: E501 +from capif_routing_info.models.point_altitude_uncertainty import \ + PointAltitudeUncertainty # noqa: E501 +from capif_routing_info.models.point_uncertainty_circle import \ + PointUncertaintyCircle # noqa: E501 +from capif_routing_info.models.point_uncertainty_ellipse import \ + PointUncertaintyEllipse # noqa: E501 from capif_routing_info.models.polygon import Polygon # noqa: E501 -from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 -from capif_routing_info.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 +from capif_routing_info.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 +from capif_routing_info.models.uncertainty_ellipse import \ + UncertaintyEllipse # noqa: E501 class GeographicArea(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/interface_description.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/interface_description.py index e895f9dbcdf8be5e5d76d0369930157e830518a9..028ae4bf2a62f54d82a2fe3cc7457b2191bbd036 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/interface_description.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/interface_description.py @@ -4,8 +4,10 @@ from typing import Dict, List # noqa: F401 from capif_routing_info import util from capif_routing_info.models.base_model import Model -from capif_routing_info.models.o_auth_grant_type import OAuthGrantType # noqa: E501 -from capif_routing_info.models.security_method import SecurityMethod # noqa: E501 +from capif_routing_info.models.o_auth_grant_type import \ + OAuthGrantType # noqa: E501 +from capif_routing_info.models.security_method import \ + SecurityMethod # noqa: E501 class InterfaceDescription(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ip_addr_range.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ip_addr_range.py index b9869baf6afd0fb77d256742e9a28f79fcfef4de..aa13f0755993951184f5864b1f0c898764755bca 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ip_addr_range.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/ip_addr_range.py @@ -3,8 +3,10 @@ from typing import Dict, List # noqa: F401 from capif_routing_info import util from capif_routing_info.models.base_model import Model -from capif_routing_info.models.ipv4_address_range1 import Ipv4AddressRange1 # noqa: E501 -from capif_routing_info.models.ipv6_address_range1 import Ipv6AddressRange1 # noqa: E501 +from capif_routing_info.models.ipv4_address_range1 import \ + Ipv4AddressRange1 # noqa: E501 +from capif_routing_info.models.ipv6_address_range1 import \ + Ipv6AddressRange1 # noqa: E501 class IpAddrRange(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/local2d_point_uncertainty_ellipse.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/local2d_point_uncertainty_ellipse.py index e1f2f11d61ce3df625961983b7533b92257c9306..f5cf06348a1db71678d032308a3e422336de9600 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/local2d_point_uncertainty_ellipse.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/local2d_point_uncertainty_ellipse.py @@ -5,9 +5,12 @@ from capif_routing_info import util from capif_routing_info.models.base_model import Model from capif_routing_info.models.gad_shape import GADShape # noqa: E501 from capif_routing_info.models.local_origin import LocalOrigin # noqa: E501 -from capif_routing_info.models.relative_cartesian_location import RelativeCartesianLocation # noqa: E501 -from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 -from capif_routing_info.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 +from capif_routing_info.models.relative_cartesian_location import \ + RelativeCartesianLocation # noqa: E501 +from capif_routing_info.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 +from capif_routing_info.models.uncertainty_ellipse import \ + UncertaintyEllipse # noqa: E501 class Local2dPointUncertaintyEllipse(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/local3d_point_uncertainty_ellipsoid.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/local3d_point_uncertainty_ellipsoid.py index f494ead2a284323f4f0eafe2d8214cd73c23a096..8a2bbd6df0bbae3b93c34aea72dbb6776abd97e7 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/local3d_point_uncertainty_ellipsoid.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/local3d_point_uncertainty_ellipsoid.py @@ -5,9 +5,12 @@ from capif_routing_info import util from capif_routing_info.models.base_model import Model from capif_routing_info.models.gad_shape import GADShape # noqa: E501 from capif_routing_info.models.local_origin import LocalOrigin # noqa: E501 -from capif_routing_info.models.relative_cartesian_location import RelativeCartesianLocation # noqa: E501 -from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 -from capif_routing_info.models.uncertainty_ellipsoid import UncertaintyEllipsoid # noqa: E501 +from capif_routing_info.models.relative_cartesian_location import \ + RelativeCartesianLocation # noqa: E501 +from capif_routing_info.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 +from capif_routing_info.models.uncertainty_ellipsoid import \ + UncertaintyEllipsoid # noqa: E501 class Local3dPointUncertaintyEllipsoid(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/local_origin.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/local_origin.py index a301c3ac640d9b878e32f090d0f740cc491d4be8..bb062da8482ca5e4e100b62c8f65d5464040435f 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/local_origin.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/local_origin.py @@ -3,8 +3,10 @@ from typing import Dict, List # noqa: F401 from capif_routing_info import util from capif_routing_info.models.base_model import Model -from capif_routing_info.models.geographic_area import GeographicArea # noqa: E501 -from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 +from capif_routing_info.models.geographic_area import \ + GeographicArea # noqa: E501 +from capif_routing_info.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 class LocalOrigin(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point.py index a6f38782a4c13997bc91c54e2193460d06ce0b4a..d15a3158039fb374110842c72232213d48fe9fb5 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point.py @@ -4,8 +4,10 @@ from typing import Dict, List # noqa: F401 from capif_routing_info import util from capif_routing_info.models.base_model import Model from capif_routing_info.models.gad_shape import GADShape # noqa: E501 -from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 -from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 +from capif_routing_info.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from capif_routing_info.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 class Point(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point_altitude.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point_altitude.py index 72156c95accd736576d9ae3f9af19da600a925fb..d9cb7cd84bbc10030356a78a8fe22a3414dfccc1 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point_altitude.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point_altitude.py @@ -4,8 +4,10 @@ from typing import Dict, List # noqa: F401 from capif_routing_info import util from capif_routing_info.models.base_model import Model from capif_routing_info.models.gad_shape import GADShape # noqa: E501 -from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 -from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 +from capif_routing_info.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from capif_routing_info.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 class PointAltitude(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point_altitude_uncertainty.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point_altitude_uncertainty.py index 63f0459a392fb043ae96cb1cf1ce38ed92a5bc90..78ea64b6b3a29537b1b38183099f650270bfda95 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point_altitude_uncertainty.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point_altitude_uncertainty.py @@ -4,9 +4,12 @@ from typing import Dict, List # noqa: F401 from capif_routing_info import util from capif_routing_info.models.base_model import Model from capif_routing_info.models.gad_shape import GADShape # noqa: E501 -from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 -from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 -from capif_routing_info.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 +from capif_routing_info.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from capif_routing_info.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 +from capif_routing_info.models.uncertainty_ellipse import \ + UncertaintyEllipse # noqa: E501 class PointAltitudeUncertainty(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point_uncertainty_circle.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point_uncertainty_circle.py index 7a7e2cd8a9a79b045d83da05ca8fc94382fdfbdf..52f9fee43f45ac76c0621cda9f50b12b7b1a331c 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point_uncertainty_circle.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point_uncertainty_circle.py @@ -4,8 +4,10 @@ from typing import Dict, List # noqa: F401 from capif_routing_info import util from capif_routing_info.models.base_model import Model from capif_routing_info.models.gad_shape import GADShape # noqa: E501 -from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 -from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 +from capif_routing_info.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from capif_routing_info.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 class PointUncertaintyCircle(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point_uncertainty_ellipse.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point_uncertainty_ellipse.py index df2712164c10f378ffb3380df1db8add3ecb5c77..21fd3efc06346eb2a9feb35e96ec4584b48bf20e 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point_uncertainty_ellipse.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/point_uncertainty_ellipse.py @@ -4,9 +4,12 @@ from typing import Dict, List # noqa: F401 from capif_routing_info import util from capif_routing_info.models.base_model import Model from capif_routing_info.models.gad_shape import GADShape # noqa: E501 -from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 -from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 -from capif_routing_info.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 +from capif_routing_info.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from capif_routing_info.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 +from capif_routing_info.models.uncertainty_ellipse import \ + UncertaintyEllipse # noqa: E501 class PointUncertaintyEllipse(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/polygon.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/polygon.py index c4e0ed43a1c612faba708efb6da736053a3ac850..5e34ade4f671a2f83b1c5c4beff1af9eaffea6cb 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/polygon.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/polygon.py @@ -4,8 +4,10 @@ from typing import Dict, List # noqa: F401 from capif_routing_info import util from capif_routing_info.models.base_model import Model from capif_routing_info.models.gad_shape import GADShape # noqa: E501 -from capif_routing_info.models.geographical_coordinates import GeographicalCoordinates # noqa: E501 -from capif_routing_info.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 +from capif_routing_info.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from capif_routing_info.models.supported_gad_shapes import \ + SupportedGADShapes # noqa: E501 class Polygon(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/resource.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/resource.py index ee34d66fab1f64cd542967a9f7455c0c46ffd5cb..d9bc7ae6f7f82152c4708d984a857166d17638e0 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/resource.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/resource.py @@ -3,8 +3,10 @@ from typing import Dict, List # noqa: F401 from capif_routing_info import util from capif_routing_info.models.base_model import Model -from capif_routing_info.models.communication_type import CommunicationType # noqa: E501 -from capif_routing_info.models.custom_operation import CustomOperation # noqa: E501 +from capif_routing_info.models.communication_type import \ + CommunicationType # noqa: E501 +from capif_routing_info.models.custom_operation import \ + CustomOperation # noqa: E501 from capif_routing_info.models.operation import Operation # noqa: E501 diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/routing_rule.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/routing_rule.py index f5072e733c0002c0c99c5f4cd1100696f5f1b91d..b373e9f007195877f9152427829cdd92f07271ee 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/routing_rule.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/routing_rule.py @@ -4,8 +4,10 @@ from typing import Dict, List # noqa: F401 from capif_routing_info import util from capif_routing_info.models.aef_profile import AefProfile # noqa: E501 from capif_routing_info.models.base_model import Model -from capif_routing_info.models.ipv4_address_range import Ipv4AddressRange # noqa: E501 -from capif_routing_info.models.ipv6_address_range import Ipv6AddressRange # noqa: E501 +from capif_routing_info.models.ipv4_address_range import \ + Ipv4AddressRange # noqa: E501 +from capif_routing_info.models.ipv6_address_range import \ + Ipv6AddressRange # noqa: E501 class RoutingRule(Model): diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/version.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/version.py index 990be9ce880456035f83ac1a90522c249e3e9c6a..8740531219a2cd2191dab6cf0882b66b167b7c66 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/version.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/models/version.py @@ -3,7 +3,8 @@ from typing import Dict, List # noqa: F401 from capif_routing_info import util from capif_routing_info.models.base_model import Model -from capif_routing_info.models.custom_operation import CustomOperation # noqa: E501 +from capif_routing_info.models.custom_operation import \ + CustomOperation # noqa: E501 from capif_routing_info.models.resource import Resource # noqa: E501 diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/openapi/openapi.yaml b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/openapi/openapi.yaml index 218463684f74a4c6ed85323ac37533ce01962499..99dbdbfb5fc8b1bcb3bf8ed1c461f95986fa61e7 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/openapi/openapi.yaml +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/openapi/openapi.yaml @@ -1236,7 +1236,7 @@ components: maxReqRate: 0 avalGraComp: avalGraComp nullable: true - oneOf: + oneOf: - required: ["domainName"] - required: ["interfaceDescriptions"] properties: diff --git a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/test/test_default_controller.py b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/test/test_default_controller.py index cf2e7c38182b332a62e9da67b6011e3d6657a2f5..b5fa256c807cd159f23939610b8f34773e6e80e6 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/test/test_default_controller.py +++ b/services/TS29222_CAPIF_Routing_Info_API/capif_routing_info/test/test_default_controller.py @@ -1,6 +1,7 @@ import unittest -from capif_routing_info.models.problem_details import ProblemDetails # noqa: E501 +from capif_routing_info.models.problem_details import \ + ProblemDetails # noqa: E501 from capif_routing_info.models.routing_info import RoutingInfo # noqa: E501 from capif_routing_info.test import BaseTestCase diff --git a/services/TS29222_CAPIF_Routing_Info_API/requirements.txt b/services/TS29222_CAPIF_Routing_Info_API/requirements.txt index 9c1909386d58da9be7f1452fd8d40789eeb58184..a1ce6ce493ec9e425dc823c772b97140eb3046a6 100644 --- a/services/TS29222_CAPIF_Routing_Info_API/requirements.txt +++ b/services/TS29222_CAPIF_Routing_Info_API/requirements.txt @@ -1,8 +1,8 @@ connexion[flask, swagger-ui, uvicorn] == 3.1.0; python_version>="3.6" swagger-ui-bundle >= 0.0.2 python_dateutil >= 2.6.0 -setuptools == 74.0.0 +setuptools == 80.9.0 Flask == 3.0.3 -werkzeug == 3.0.4 +werkzeug == 3.1.3 gunicorn == 23.0.0 packaging == 24.0 diff --git a/services/TS29222_CAPIF_Security_API/.openapi-generator/FILES b/services/TS29222_CAPIF_Security_API/.openapi-generator/FILES index a3947acd44363fa560ce0e5e3c34285ccf95a204..76919adccb8e581c881ceeb82bd94195f1c9cd57 100644 --- a/services/TS29222_CAPIF_Security_API/.openapi-generator/FILES +++ b/services/TS29222_CAPIF_Security_API/.openapi-generator/FILES @@ -1,6 +1,5 @@ .dockerignore .gitignore -.openapi-generator-ignore .travis.yml Dockerfile README.md @@ -43,7 +42,6 @@ capif_security/models/snssai.py capif_security/models/websock_notif_config.py capif_security/openapi/openapi.yaml capif_security/test/__init__.py -capif_security/test/test_default_controller.py capif_security/typing_utils.py capif_security/util.py requirements.txt diff --git a/services/TS29222_CAPIF_Security_API/capif_security/app.py b/services/TS29222_CAPIF_Security_API/capif_security/app.py index f4f39fde845188be2a9768e7d1a71093c05a4ddc..5756b5b7f91b7c25204fc765e4b9b3e3e2baefa6 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/app.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/app.py @@ -14,13 +14,15 @@ from flask_executor import Executor from flask_jwt_extended import JWTManager from fluent import sender from opentelemetry import trace -from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter +from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import \ + OTLPSpanExporter from opentelemetry.instrumentation.flask import FlaskInstrumentor from opentelemetry.instrumentation.redis import RedisInstrumentor from opentelemetry.sdk.resources import Resource from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import BatchSpanProcessor -from opentelemetry.trace.propagation.tracecontext import TraceContextTextMapPropagator +from opentelemetry.trace.propagation.tracecontext import \ + TraceContextTextMapPropagator NAME = "Security-Service" diff --git a/services/TS29222_CAPIF_Security_API/capif_security/controllers/default_controller.py b/services/TS29222_CAPIF_Security_API/capif_security/controllers/default_controller.py index 385d3cfd4a8c6bb03a4f517c8863e1e0141dec3c..7a65eb7ddcaf7b07b800cfe3353ff43e1281bf9f 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/controllers/default_controller.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/controllers/default_controller.py @@ -1,12 +1,16 @@ from functools import wraps from capif_security.models.res_owner_id import ResOwnerId # noqa: E501 -from capif_security.models.security_notification import SecurityNotification # noqa: E501 -from capif_security.models.service_security import ServiceSecurity # noqa: E501 +from capif_security.models.security_notification import \ + SecurityNotification # noqa: E501 +from capif_security.models.service_security import \ + ServiceSecurity # noqa: E501 from cryptography import x509 from cryptography.hazmat.backends import default_backend from flask import current_app, request +from ..core.responses import unauthorized_error + from ..core.publisher import Publisher from ..core.redis_internal_event import RedisInternalEvent from ..core.servicesecurity import SecurityOperations @@ -23,7 +27,11 @@ def cert_validation(): def __cert_validation(*args, **kwargs): args = request.view_args - cert_tmp = request.headers['X-Ssl-Client-Cert'] + cert_tmp = request.headers.get('X-Ssl-Client-Cert') + + if not cert_tmp: + return unauthorized_error("Client certificate required", "X-Ssl-Client-Cert header is missing") + cert_raw = cert_tmp.replace('\t', '') cert = x509.load_pem_x509_certificate( @@ -94,7 +102,6 @@ def securities_security_id_token_post(security_id, body): # noqa: E501 return res - @cert_validation() def trusted_invokers_api_invoker_id_delete(api_invoker_id): # noqa: E501 """trusted_invokers_api_invoker_id_delete @@ -109,6 +116,7 @@ def trusted_invokers_api_invoker_id_delete(api_invoker_id): # noqa: E501 current_app.logger.info("Removing security context") return service_security_ops.delete_servicesecurity(api_invoker_id) + @cert_validation() def trusted_invokers_api_invoker_id_delete_post(api_invoker_id, body): # noqa: E501 """trusted_invokers_api_invoker_id_delete_post diff --git a/services/TS29222_CAPIF_Security_API/capif_security/core/responses.py b/services/TS29222_CAPIF_Security_API/capif_security/core/responses.py index 849e7f8668ca60a2dac8c71e440b3447dba9b726..1de771cd973f52d9cdf47538c78b7ad8e12b83da 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/core/responses.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/core/responses.py @@ -33,7 +33,7 @@ def bad_request_error(detail, cause, invalid_params): prob = ProblemDetails(title="Bad Request", status=400, detail=detail, cause=cause, invalid_params=invalid_params) prob = serialize_clean_camel_case(prob) - return Response(json.dumps(prob, cls=CustomJSONEncoder), status=400, mimetype=cause) + return Response(json.dumps(prob, cls=CustomJSONEncoder), status=400, mimetype=mimetype) def not_found_error(detail, cause): diff --git a/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py b/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py index e6d367abe2a42c6f5a6543db21e1159d94167ded..70d665e374892bdb737ce50cd4f3115f43498378 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/core/servicesecurity.py @@ -1,6 +1,9 @@ +import hashlib +import hmac import json import os +import unicodedata from datetime import datetime, timedelta import rfc3987 @@ -8,10 +11,6 @@ from bson import json_util from flask import current_app, request from flask_jwt_extended import create_access_token from pymongo import ReturnDocument -import hmac -import hashlib -import unicodedata - from ..core.publisher import Publisher from ..models.access_token_claims import AccessTokenClaims @@ -20,7 +19,8 @@ from ..models.access_token_rsp import AccessTokenRsp from ..util import clean_empty, dict_to_camel_case, serialize_clean_camel_case from .redis_event import RedisEvent from .resources import Resource -from .responses import bad_request_error, forbidden_error, internal_server_error, make_response, not_found_error +from .responses import (bad_request_error, forbidden_error, + internal_server_error, make_response, not_found_error) publish_ops = Publisher() @@ -103,22 +103,26 @@ class SecurityOperations(Resource): ## Derive the PSK using the provided master key, session ID, and interface information # Interface information - host = None - if 'fqdn' in interface: - host = interface['fqdn'] - elif 'ipv4Addr' in interface: - host = interface['ipv4Addr'] - elif 'ipv6Addr' in interface: - host = interface['ipv6Addr'] - port = interface.get('port', None) - - api_prefix = interface.get('apiPrefix', '') - scheme = "https" if port in (None, 443) else "http" - - interface_info = f"{scheme}://{host}" - if port and port != 443: - interface_info += f":{port}" - interface_info += api_prefix + if isinstance(interface, dict): + host = None + if 'fqdn' in interface: + host = interface['fqdn'] + elif 'ipv4Addr' in interface: + host = interface['ipv4Addr'] + elif 'ipv6Addr' in interface: + host = interface['ipv6Addr'] + port = interface.get('port', None) + + api_prefix = interface.get('apiPrefix', '') + scheme = "https" if port in (None, 443) else "http" + + interface_info = f"{scheme}://{host}" + if port and port != 443: + interface_info += f":{port}" + interface_info += api_prefix + else: + interface_info = interface + # Normalize the strings to NFKC form p0_string = unicodedata.normalize("NFKC", interface_info).encode("utf-8") @@ -256,7 +260,7 @@ class SecurityOperations(Resource): return bad_request_error(detail="Bad Param", cause="Detected Bad format of param", invalid_params=[{"param": "notificationDestination", "reason": "Not valid URL format"}]) services_security_object = mycol.find_one( - {"api_invoker_id": api_invoker_id}) + {"api_invoker_id": api_invoker_id, "security_info.api_id": {"$in": [info.api_id for info in service_security.security_info]}}, {"_id": 0}) if services_security_object is not None: @@ -268,23 +272,26 @@ class SecurityOperations(Resource): service_security.supported_features = negotiated["Final"] for service_instance in service_security.security_info: + + psk_interface = None + if service_instance.interface_details is not None: # We look for if the passed interface exists for the given apiId capif_service_col = self.db.get_col_by_name( self.db.capif_service_col) - aef_profile = capif_service_col.find_one( + aef_profiles = capif_service_col.find_one( {"api_id": service_instance.api_id, "aef_profiles.interface_descriptions":{ "$elemMatch": service_instance.interface_details.to_dict() } }, - {"aef_profiles.interface_descriptions.$": 1, "_id": 0}) + {"_id": 0}) - current_app.logger.debug("Aef profile: " + str(aef_profile)) + current_app.logger.debug("Aef profile: " + str(aef_profiles)) - if aef_profile is None: + if aef_profiles is None: current_app.logger.error( "Not found service with this interface description: " + json.dumps(clean_empty(service_instance.interface_details.to_dict()))) return not_found_error(detail=f"Service with interfaceDescription {json.dumps(clean_empty(service_instance.interface_details.to_dict()))} not found", cause="Not found Service") @@ -306,28 +313,95 @@ class SecurityOperations(Resource): # # To achieve this, we need to setup at config which domains or IPs are CAPIF-2e or CAPIF-2, and then we need to check if the domain or IP of the service is in the list. - security_methods = aef_profile["aef_profiles"][0]["interface_descriptions"][0]["security_methods"] + valid_security_methods = set() + for aefProfile in aef_profiles.get("aef_profiles", []): + current_app.logger.debug("AEF profile security methods: " + str(aefProfile.get("security_methods", []))) - current_app.logger.debug("Interface security methods: " + str(security_methods)) + profile_methods = set(aefProfile.get("security_methods") or []) + interfaces = aefProfile.get("interface_descriptions", []) + + interface_methods = set() + + if interfaces and len(interfaces) > 0: + for interface in interfaces: + # If the interface has its own security methods, use them + if interface == service_instance.interface_details.to_dict(): + if interface.get("security_methods"): + interface_methods.update(interface["security_methods"]) + # If not, inherit the methods from the profile (if any) + elif profile_methods: + interface_methods.update(profile_methods) + + # After processing all interfaces, use the combined set + valid_security_methods.update(interface_methods) + else: + current_app.logger.debug("No interfaces found in AEF profile.") + return not_found_error(detail=f"Service with interfaceDescription {json.dumps(clean_empty(service_instance.interface_details.to_dict()))} not found", cause="Not found Service") + + psk_interface = service_instance.interface_details.to_dict() + + current_app.logger.debug("Valid security methods: " + str(valid_security_methods)) pref_security_methods = service_instance.pref_security_methods valid_security_method = set( - security_methods) & set(pref_security_methods) + valid_security_methods) & set(pref_security_methods) else: capif_service_col = self.db.get_col_by_name( self.db.capif_service_col) services_security_object = capif_service_col.find_one( - {"api_id": service_instance.api_id, self.filter_aef_id: service_instance.aef_id}, {"aef_profiles.security_methods.$": 1}) + {"api_id": service_instance.api_id, self.filter_aef_id: service_instance.aef_id}) + current_app.logger.debug("Aef profile: " + str(services_security_object)) if services_security_object is None: current_app.logger.error( "Not found service with this aef id: " + service_instance.aef_id) return not_found_error(detail="Service with this aefId not found", cause="Not found Service") + + # We obtain all the security methods available for the given aef_id + valid_security_methods = set() + for aefProfile in services_security_object.get("aef_profiles", []): + current_app.logger.debug("AEF profile security methods: " + str(aefProfile.get("security_methods", []))) + + profile_methods = set(aefProfile.get("security_methods") or []) + interfaces = aefProfile.get("interface_descriptions", []) + + interface_methods = set() + + current_app.logger.debug(f"Interfaces: {interfaces}, Profile Methods: {profile_methods}") + if interfaces and len(interfaces) > 0: + for interface in interfaces: + # If the interface has its own security methods, use them + if interface.get("security_methods"): + interface_methods.update(interface["security_methods"]) + # If not, inherit the methods from the profile (if any) + elif profile_methods: + interface_methods.update(profile_methods) + else: + current_app.logger.debug("Interface has no security methods and profile has none to inherit.") + + # Keep track if any interface supports PSK + if psk_interface is None and "PSK" in interface_methods: + psk_interface = interface + + # After processing all interfaces, use the combined set + valid_security_methods.update(interface_methods) + else: + # No interfaces: use the profile's security methods directly + if profile_methods: + valid_security_methods.update(profile_methods) + + # Keep track if profile supports PSK + if psk_interface is None and "PSK" in profile_methods: + psk_interface = aefProfile.get("domain_name") + else: + current_app.logger.debug("AEF profile has no security methods defined (no interfaces either).") + + current_app.logger.debug("Valid security methods: " + str(valid_security_methods)) + + # We intersect with preferred security methods pref_security_methods = service_instance.pref_security_methods - valid_security_methods = [security_method for array_methods in services_security_object["aef_profiles"] - for security_method in array_methods["security_methods"]] valid_security_method = set( valid_security_methods) & set(pref_security_methods) @@ -352,35 +426,20 @@ class SecurityOperations(Resource): service_instance.sel_security_method = sorted_methods[0] if service_instance.sel_security_method == "PSK": - request.headers.get('X-TLS-Protocol', 'N/A') - sesionId = request.headers.get('X-TLS-Session-ID', 'N/A') - Mkey = request.headers.get('X-TLS-MKey', 'N/A') - current_app.logger.info(f"TLS Protocol: {request.headers.get('X-TLS-Protocol', 'N/A')}, Session id: {sesionId}, Master Key: {Mkey}") - - interface = None - if service_instance.interface_details: - current_app.logger.debug("Interface details found") - interface = service_instance.interface_details.to_dict() - - else: - current_app.logger.error("Interface details not found") - services_security_object = capif_service_col.find_one( - {"api_id": service_instance.api_id}, {"aef_profiles": {"$elemMatch": {"aef_id": service_instance.aef_id}}, "_id": 0}) - current_app.logger.debug("Aef profile: " + str(services_security_object["aef_profiles"][0])) - if "interface_descriptions" in services_security_object["aef_profiles"][0]: - current_app.logger.debug("Aef profile: " + str(services_security_object["aef_profiles"][0]["interface_descriptions"])) - interface = services_security_object["aef_profiles"][0]["interface_descriptions"][0] - elif "domain_name" in services_security_object["aef_profiles"][0]: - current_app.logger.debug("Aef profile: " + str(services_security_object["aef_profiles"][0]["domain_name"])) - interface = services_security_object["aef_profiles"][0]["domain_name"] - - if interface: + tls_protocol = request.headers.get('X-TLS-Protocol', 'N/A') + session_id = request.headers.get('X-TLS-Session-ID', 'N/A') + mkey = request.headers.get('X-TLS-MKey', 'N/A') + current_app.logger.info(f"TLS Protocol: {tls_protocol}, Session id: {session_id}, Master Key: {mkey}") + + if psk_interface: current_app.logger.debug("Deriving PSK") - psk = self.__derive_psk(Mkey, sesionId, interface) + psk = self.__derive_psk(mkey, session_id, psk_interface) current_app.logger.debug("PSK derived : " + str(psk)) service_instance.authorization_info = str(psk) - + else: + current_app.logger.error("No interface information available to derive PSK") + # Send service instance to ACL current_app.logger.debug("Sending message to create ACL") publish_ops.publish_message("acls-messages", "create-acl:"+str( @@ -388,10 +447,17 @@ class SecurityOperations(Resource): current_app.logger.debug( "Inserted security context in database") - rec = dict() - rec['api_invoker_id'] = api_invoker_id - rec.update(service_security.to_dict()) - mycol.insert_one(rec) + # We use update with $setOnInsert and $push with $each to add the security info array if the document is created + on_insert = service_security.to_dict().copy() + on_insert.pop('security_info', None) + + security_context = mycol.find_one_and_update({'api_invoker_id': api_invoker_id}, + {"$setOnInsert": on_insert, + "$push": {"security_info": {"$each": [sec.to_dict() for sec in service_security.security_info]}}}, + upsert=True , + return_document=ReturnDocument.AFTER, + projection={'_id': 0, 'api_invoker_id': 0} + ) res = make_response(object=serialize_clean_camel_case(service_security), status=201) res.headers['Location'] = f"https://{os.getenv("CAPIF_HOSTNAME")}/capif-security/v1/trustedInvokers/{str(api_invoker_id)}" @@ -519,54 +585,125 @@ class SecurityOperations(Resource): update_acls=list() for service_instance in service_security.security_info: + + psk_interface = None + if service_instance.interface_details is not None: # We look for if the passed interface exists for the given apiId capif_service_col = self.db.get_col_by_name( self.db.capif_service_col) - aef_profile = capif_service_col.find_one( + aef_profiles = capif_service_col.find_one( {"api_id": service_instance.api_id, "aef_profiles.interface_descriptions":{ "$elemMatch": service_instance.interface_details.to_dict() } }, - {"aef_profiles.interface_descriptions.$": 1, "_id": 0}) + {"_id": 0}) current_app.logger.debug("Aef profile: " + str(aef_profile)) - if aef_profile is None: + if aef_profiles is None: current_app.logger.error( "Not found service with this interface description: " + json.dumps(clean_empty(service_instance.interface_details.to_dict()))) return not_found_error(detail=f"Service with interfaceDescription {json.dumps(clean_empty(service_instance.interface_details.to_dict()))} not found", cause="Not found Service") - # We obtain the interface security methods - security_methods = aef_profile["aef_profiles"][0]["interface_descriptions"][0]["security_methods"] - current_app.logger.debug("Interface security methods: " + str(security_methods)) + valid_security_methods = set() + for aefProfile in aef_profiles.get("aef_profiles", []): + current_app.logger.debug("AEF profile security methods: " + str(aefProfile.get("security_methods", []))) + + profile_methods = set(aefProfile.get("security_methods") or []) + interfaces = aefProfile.get("interface_descriptions", []) + + interface_methods = set() + + if interfaces and len(interfaces) > 0: + for interface in interfaces: + # If the interface has its own security methods, use them + if interface == service_instance.interface_details.to_dict(): + if interface.get("security_methods"): + interface_methods.update(interface["security_methods"]) + # If not, inherit the methods from the profile (if any) + elif profile_methods: + interface_methods.update(profile_methods) + + # After processing all interfaces, use the combined set + valid_security_methods.update(interface_methods) + else: + current_app.logger.debug("No interfaces found in AEF profile.") + return not_found_error(detail=f"Service with interfaceDescription {json.dumps(clean_empty(service_instance.interface_details.to_dict()))} not found", cause="Not found Service") + + psk_interface = service_instance.interface_details.to_dict() + + current_app.logger.debug("Valid security methods: " + str(valid_security_methods)) pref_security_methods = service_instance.pref_security_methods valid_security_method = set( - security_methods) & set(pref_security_methods) + valid_security_methods) & set(pref_security_methods) else: + + capif_service_col = self.db.get_col_by_name( self.db.capif_service_col) services_security_object = capif_service_col.find_one( - {self.filter_aef_id: service_instance.aef_id}, {"aef_profiles.security_methods.$": 1}) - + {"api_id": service_instance.api_id, self.filter_aef_id: service_instance.aef_id}) + + current_app.logger.debug("Aef profile: " + str(services_security_object)) if services_security_object is None: current_app.logger.error( - "Service api with this aefId not found: " + service_instance.aef_id) + "Not found service with this aef id: " + service_instance.aef_id) return not_found_error(detail="Service with this aefId not found", cause="Not found Service") + + # We obtain all the security methods available for the given aef_id + valid_security_methods = set() + for aefProfile in services_security_object.get("aef_profiles", []): + current_app.logger.debug("AEF profile security methods: " + str(aefProfile.get("security_methods", []))) + + profile_methods = set(aefProfile.get("security_methods") or []) + interfaces = aefProfile.get("interface_descriptions", []) + + interface_methods = set() + + current_app.logger.debug(f"Interfaces: {interfaces}, Profile Methods: {profile_methods}") + if interfaces and len(interfaces) > 0: + for interface in interfaces: + # If the interface has its own security methods, use them + if interface.get("security_methods"): + interface_methods.update(interface["security_methods"]) + # If not, inherit the methods from the profile (if any) + elif profile_methods: + interface_methods.update(profile_methods) + else: + current_app.logger.debug("Interface has no security methods and profile has none to inherit.") + + # Keep track if any interface supports PSK + if psk_interface is None and "PSK" in interface_methods: + psk_interface = interface + + # After processing all interfaces, use the combined set + valid_security_methods.update(interface_methods) + else: + # No interfaces: use the profile's security methods directly + if profile_methods: + valid_security_methods.update(profile_methods) + + # Keep track if profile supports PSK + if psk_interface is None and "PSK" in profile_methods: + psk_interface = aefProfile.get("domain_name") + + else: + current_app.logger.debug("AEF profile has no security methods defined (no interfaces either).") + + current_app.logger.debug("Valid security methods: " + str(valid_security_methods)) + # We intersect with preferred security methods pref_security_methods = service_instance.pref_security_methods - valid_security_methods = [security_method for array_methods in services_security_object["aef_profiles"] - for security_method in array_methods["security_methods"]] valid_security_method = set( valid_security_methods) & set(pref_security_methods) - if len(list(valid_security_method)) == 0: current_app.logger.error( "Not found comptaible security method with pref security method") @@ -577,34 +714,20 @@ class SecurityOperations(Resource): update_acls.append({"api_id": service_instance.api_id, "aef_id": service_instance.aef_id}) if service_instance.sel_security_method == "PSK": - request.headers.get('X-TLS-Protocol', 'N/A') - sesionId = request.headers.get('X-TLS-Session-ID', 'N/A') - Mkey = request.headers.get('X-TLS-MKey', 'N/A') - current_app.logger.info(f"TLS Protocol: {request.headers.get('X-TLS-Protocol', 'N/A')}, Session id: {sesionId}, Master Key: {Mkey}") - - interface = None - if service_instance.interface_details: - current_app.logger.debug("Interface details found") - interface = service_instance.interface_details.to_dict() - - else: - current_app.logger.error("Interface details not found") - services_security_object = capif_service_col.find_one( - {"api_id": service_instance.api_id}, {"aef_profiles": {"$elemMatch": {"aef_id": service_instance.aef_id}}, "_id": 0}) - current_app.logger.debug("Aef profile: " + str(services_security_object["aef_profiles"][0])) - if "interface_descriptions" in services_security_object["aef_profiles"][0]: - current_app.logger.debug("Aef profile: " + str(services_security_object["aef_profiles"][0]["interface_descriptions"])) - interface = services_security_object["aef_profiles"][0]["interface_descriptions"][0] - elif "domain_name" in services_security_object["aef_profiles"][0]: - current_app.logger.debug("Aef profile: " + str(services_security_object["aef_profiles"][0]["domain_name"])) - interface = services_security_object["aef_profiles"][0]["domain_name"] - - if interface: + tls_protocol = request.headers.get('X-TLS-Protocol', 'N/A') + session_id = request.headers.get('X-TLS-Session-ID', 'N/A') + mkey = request.headers.get('X-TLS-MKey', 'N/A') + current_app.logger.info(f"TLS Protocol: {tls_protocol}, Session id: {session_id}, Master Key: {mkey}") + + if psk_interface: current_app.logger.debug("Deriving PSK") - psk = self.__derive_psk(Mkey, sesionId, interface) + psk = self.__derive_psk(mkey, session_id, psk_interface) current_app.logger.debug("PSK derived : " + str(psk)) service_instance.authorization_info = str(psk) + else: + current_app.logger.error("No interface information available to derive PSK") + service_security = service_security.to_dict() service_security = clean_empty(service_security) diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_req1.py b/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_req1.py index 0530651a6dd30da7ebcb1f3194c282416b4d7f47..67d4d2e1bd0c116f69cc915a32a2ac961884c612 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_req1.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/access_token_req1.py @@ -4,7 +4,8 @@ from typing import Dict, List # noqa: F401 from capif_security import util from capif_security.models.base_model import Model -from capif_security.models.ml_model_inter_ind import MlModelInterInd # noqa: E501 +from capif_security.models.ml_model_inter_ind import \ + MlModelInterInd # noqa: E501 from capif_security.models.nf_type import NFType # noqa: E501 from capif_security.models.nwdaf_event import NwdafEvent # noqa: E501 from capif_security.models.plmn_id import PlmnId # noqa: E501 @@ -18,7 +19,7 @@ class AccessTokenReq1(Model): Do not edit the class manually. """ - def __init__(self, grant_type=None, nf_instance_id=None, nf_type=None, target_nf_type=None, scope=None, target_nf_instance_id=None, requester_plmn=None, requester_plmn_list=None, requester_snssai_list=None, requester_fqdn=None, requester_snpn_list=None, target_plmn=None, target_snpn=None, target_snssai_list=None, target_nsi_list=None, target_nf_set_id=None, target_nf_service_set_id=None, hnrf_access_token_uri=None, source_nf_instance_id=None, vendor_id=None, analytics_ids=None, requester_inter_ind_list=None, source_vendor_id=None): # noqa: E501 + def __init__(self, grant_type=None, nf_instance_id=None, nf_type=None, target_nf_type=None, scope=None, target_nf_instance_id=None, requester_plmn=None, requester_plmn_list=None, requester_snssai_list=None, requester_fqdn=None, requester_snpn_list=None, target_plmn=None, target_snpn=None, target_snssai_list=None, target_nsi_list=None, target_nf_set_id=None, target_nf_service_set_id=None, hnrf_access_token_uri=None, source_nf_instance_id=None, vendor_id=None, analytics_ids=None, requester_inter_ind_list=None, source_vendor_id=None, af_id=None): # noqa: E501 """AccessTokenReq1 - a model defined in OpenAPI :param grant_type: The grant_type of this AccessTokenReq1. # noqa: E501 @@ -67,6 +68,8 @@ class AccessTokenReq1(Model): :type requester_inter_ind_list: List[MlModelInterInd] :param source_vendor_id: The source_vendor_id of this AccessTokenReq1. # noqa: E501 :type source_vendor_id: str + :param af_id: The af_id of this AccessTokenReq1. # noqa: E501 + :type af_id: str """ self.openapi_types = { 'grant_type': str, @@ -91,7 +94,8 @@ class AccessTokenReq1(Model): 'vendor_id': str, 'analytics_ids': List[NwdafEvent], 'requester_inter_ind_list': List[MlModelInterInd], - 'source_vendor_id': str + 'source_vendor_id': str, + 'af_id': str } self.attribute_map = { @@ -117,7 +121,8 @@ class AccessTokenReq1(Model): 'vendor_id': 'vendorId', 'analytics_ids': 'analyticsIds', 'requester_inter_ind_list': 'requesterInterIndList', - 'source_vendor_id': 'sourceVendorId' + 'source_vendor_id': 'sourceVendorId', + 'af_id': 'afId' } self._grant_type = grant_type @@ -143,6 +148,7 @@ class AccessTokenReq1(Model): self._analytics_ids = analytics_ids self._requester_inter_ind_list = requester_inter_ind_list self._source_vendor_id = source_vendor_id + self._af_id = af_id @classmethod def from_dict(cls, dikt) -> 'AccessTokenReq1': @@ -186,7 +192,7 @@ class AccessTokenReq1(Model): def nf_instance_id(self) -> str: """Gets the nf_instance_id of this AccessTokenReq1. - String uniquely identifying a NF instance. The format of the NF Instance ID shall be a Universally Unique Identifier (UUID) version 4, as described in IETF RFC 4122. # noqa: E501 + String uniquely identifying a NF instance. The format of the NF Instance ID shall be a Universally Unique Identifier (UUID) version 4. # noqa: E501 :return: The nf_instance_id of this AccessTokenReq1. :rtype: str @@ -197,7 +203,7 @@ class AccessTokenReq1(Model): def nf_instance_id(self, nf_instance_id: str): """Sets the nf_instance_id of this AccessTokenReq1. - String uniquely identifying a NF instance. The format of the NF Instance ID shall be a Universally Unique Identifier (UUID) version 4, as described in IETF RFC 4122. # noqa: E501 + String uniquely identifying a NF instance. The format of the NF Instance ID shall be a Universally Unique Identifier (UUID) version 4. # noqa: E501 :param nf_instance_id: The nf_instance_id of this AccessTokenReq1. :type nf_instance_id: str @@ -278,7 +284,7 @@ class AccessTokenReq1(Model): def target_nf_instance_id(self) -> str: """Gets the target_nf_instance_id of this AccessTokenReq1. - String uniquely identifying a NF instance. The format of the NF Instance ID shall be a Universally Unique Identifier (UUID) version 4, as described in IETF RFC 4122. # noqa: E501 + String uniquely identifying a NF instance. The format of the NF Instance ID shall be a Universally Unique Identifier (UUID) version 4. # noqa: E501 :return: The target_nf_instance_id of this AccessTokenReq1. :rtype: str @@ -289,7 +295,7 @@ class AccessTokenReq1(Model): def target_nf_instance_id(self, target_nf_instance_id: str): """Sets the target_nf_instance_id of this AccessTokenReq1. - String uniquely identifying a NF instance. The format of the NF Instance ID shall be a Universally Unique Identifier (UUID) version 4, as described in IETF RFC 4122. # noqa: E501 + String uniquely identifying a NF instance. The format of the NF Instance ID shall be a Universally Unique Identifier (UUID) version 4. # noqa: E501 :param target_nf_instance_id: The target_nf_instance_id of this AccessTokenReq1. :type target_nf_instance_id: str @@ -577,7 +583,7 @@ class AccessTokenReq1(Model): def source_nf_instance_id(self) -> str: """Gets the source_nf_instance_id of this AccessTokenReq1. - String uniquely identifying a NF instance. The format of the NF Instance ID shall be a Universally Unique Identifier (UUID) version 4, as described in IETF RFC 4122. # noqa: E501 + String uniquely identifying a NF instance. The format of the NF Instance ID shall be a Universally Unique Identifier (UUID) version 4. # noqa: E501 :return: The source_nf_instance_id of this AccessTokenReq1. :rtype: str @@ -588,7 +594,7 @@ class AccessTokenReq1(Model): def source_nf_instance_id(self, source_nf_instance_id: str): """Sets the source_nf_instance_id of this AccessTokenReq1. - String uniquely identifying a NF instance. The format of the NF Instance ID shall be a Universally Unique Identifier (UUID) version 4, as described in IETF RFC 4122. # noqa: E501 + String uniquely identifying a NF instance. The format of the NF Instance ID shall be a Universally Unique Identifier (UUID) version 4. # noqa: E501 :param source_nf_instance_id: The source_nf_instance_id of this AccessTokenReq1. :type source_nf_instance_id: str @@ -691,3 +697,24 @@ class AccessTokenReq1(Model): raise ValueError(r"Invalid value for `source_vendor_id`, must be a follow pattern or equal to `/^[0-9]{6}$/`") # noqa: E501 self._source_vendor_id = source_vendor_id + + @property + def af_id(self) -> str: + """Gets the af_id of this AccessTokenReq1. + + + :return: The af_id of this AccessTokenReq1. + :rtype: str + """ + return self._af_id + + @af_id.setter + def af_id(self, af_id: str): + """Sets the af_id of this AccessTokenReq1. + + + :param af_id: The af_id of this AccessTokenReq1. + :type af_id: str + """ + + self._af_id = af_id diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/interface_description.py b/services/TS29222_CAPIF_Security_API/capif_security/models/interface_description.py index b414ef8be3c37f2fbdec8091060fed13e0f15086..58119e8b3790dfd99cdeab1d4dacef81ca687d03 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/interface_description.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/interface_description.py @@ -4,7 +4,8 @@ from typing import Dict, List # noqa: F401 from capif_security import util from capif_security.models.base_model import Model -from capif_security.models.o_auth_grant_type import OAuthGrantType # noqa: E501 +from capif_security.models.o_auth_grant_type import \ + OAuthGrantType # noqa: E501 from capif_security.models.security_method import SecurityMethod # noqa: E501 diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/no_profile_match_info.py b/services/TS29222_CAPIF_Security_API/capif_security/models/no_profile_match_info.py index c7b85407994ed452215d57681a143f0c738b1e9f..233d1a47fef3b032a2b11b8b0ea8cd6c7de20be3 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/no_profile_match_info.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/no_profile_match_info.py @@ -3,8 +3,10 @@ from typing import Dict, List # noqa: F401 from capif_security import util from capif_security.models.base_model import Model -from capif_security.models.no_profile_match_reason import NoProfileMatchReason # noqa: E501 -from capif_security.models.query_param_combination import QueryParamCombination # noqa: E501 +from capif_security.models.no_profile_match_reason import \ + NoProfileMatchReason # noqa: E501 +from capif_security.models.query_param_combination import \ + QueryParamCombination # noqa: E501 class NoProfileMatchInfo(Model): diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/problem_details1.py b/services/TS29222_CAPIF_Security_API/capif_security/models/problem_details1.py index e0fbf4c1c96a65e6c3252f6494dc9c03ffe4cacd..7742f17b7f7dacc8236ac55f984f4291b88378b0 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/problem_details1.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/problem_details1.py @@ -3,11 +3,14 @@ from datetime import date, datetime # noqa: F401 from typing import Dict, List # noqa: F401 from capif_security import util -from capif_security.models.access_token_err1 import AccessTokenErr1 # noqa: E501 -from capif_security.models.access_token_req1 import AccessTokenReq1 # noqa: E501 +from capif_security.models.access_token_err1 import \ + AccessTokenErr1 # noqa: E501 +from capif_security.models.access_token_req1 import \ + AccessTokenReq1 # noqa: E501 from capif_security.models.base_model import Model from capif_security.models.invalid_param1 import InvalidParam1 # noqa: E501 -from capif_security.models.no_profile_match_info import NoProfileMatchInfo # noqa: E501 +from capif_security.models.no_profile_match_info import \ + NoProfileMatchInfo # noqa: E501 class ProblemDetails1(Model): diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/security_information.py b/services/TS29222_CAPIF_Security_API/capif_security/models/security_information.py index ab650a4a244870166b3ea1dd6c630362aad62f52..413b15687ebc047a64628f59fb0dc3841d1f80e9 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/security_information.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/security_information.py @@ -3,8 +3,10 @@ from typing import Dict, List # noqa: F401 from capif_security import util from capif_security.models.base_model import Model -from capif_security.models.interface_description import InterfaceDescription # noqa: E501 -from capif_security.models.o_auth_grant_type import OAuthGrantType # noqa: E501 +from capif_security.models.interface_description import \ + InterfaceDescription # noqa: E501 +from capif_security.models.o_auth_grant_type import \ + OAuthGrantType # noqa: E501 from capif_security.models.security_method import SecurityMethod # noqa: E501 diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/security_notification.py b/services/TS29222_CAPIF_Security_API/capif_security/models/security_notification.py index fbf39b6da8002adb8809ab42db1b80c980c75753..3c5a3434398f287664539a5ea86b8188b4bd0cf6 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/security_notification.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/security_notification.py @@ -12,7 +12,7 @@ class SecurityNotification(Model): Do not edit the class manually. """ - def __init__(self, api_invoker_id=None, aef_id=None, api_ids=None, cause=None): # noqa: E501 + def __init__(self, api_invoker_id=None, aef_id=None, api_ids=None, access_token=None, cause=None): # noqa: E501 """SecurityNotification - a model defined in OpenAPI :param api_invoker_id: The api_invoker_id of this SecurityNotification. # noqa: E501 @@ -21,6 +21,8 @@ class SecurityNotification(Model): :type aef_id: str :param api_ids: The api_ids of this SecurityNotification. # noqa: E501 :type api_ids: List[str] + :param access_token: The access_token of this SecurityNotification. # noqa: E501 + :type access_token: str :param cause: The cause of this SecurityNotification. # noqa: E501 :type cause: Cause """ @@ -28,6 +30,7 @@ class SecurityNotification(Model): 'api_invoker_id': str, 'aef_id': str, 'api_ids': List[str], + 'access_token': str, 'cause': Cause } @@ -35,12 +38,14 @@ class SecurityNotification(Model): 'api_invoker_id': 'apiInvokerId', 'aef_id': 'aefId', 'api_ids': 'apiIds', + 'access_token': 'access_token', 'cause': 'cause' } self._api_invoker_id = api_invoker_id self._aef_id = aef_id self._api_ids = api_ids + self._access_token = access_token self._cause = cause @classmethod @@ -129,6 +134,29 @@ class SecurityNotification(Model): self._api_ids = api_ids + @property + def access_token(self) -> str: + """Gets the access_token of this SecurityNotification. + + JWS Compact Serialized representation of JWS signed JSON object (AccessTokenClaims). # noqa: E501 + + :return: The access_token of this SecurityNotification. + :rtype: str + """ + return self._access_token + + @access_token.setter + def access_token(self, access_token: str): + """Sets the access_token of this SecurityNotification. + + JWS Compact Serialized representation of JWS signed JSON object (AccessTokenClaims). # noqa: E501 + + :param access_token: The access_token of this SecurityNotification. + :type access_token: str + """ + + self._access_token = access_token + @property def cause(self) -> Cause: """Gets the cause of this SecurityNotification. diff --git a/services/TS29222_CAPIF_Security_API/capif_security/models/service_security.py b/services/TS29222_CAPIF_Security_API/capif_security/models/service_security.py index 10d26438f071121c9119bd888dd41d0ac7c8d7e7..f636cb1d927f24d9e510f75a45c243cc9dd54b6a 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/models/service_security.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/models/service_security.py @@ -4,8 +4,10 @@ from typing import Dict, List # noqa: F401 from capif_security import util from capif_security.models.base_model import Model -from capif_security.models.security_information import SecurityInformation # noqa: E501 -from capif_security.models.websock_notif_config import WebsockNotifConfig # noqa: E501 +from capif_security.models.security_information import \ + SecurityInformation # noqa: E501 +from capif_security.models.websock_notif_config import \ + WebsockNotifConfig # noqa: E501 class ServiceSecurity(Model): diff --git a/services/TS29222_CAPIF_Security_API/capif_security/openapi/openapi.yaml b/services/TS29222_CAPIF_Security_API/capif_security/openapi/openapi.yaml index 71929d3de4564f9090f5af1333730b909828a888..08f06ba541fa7a1caf439db4d71caf002a4fefcc 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/openapi/openapi.yaml +++ b/services/TS29222_CAPIF_Security_API/capif_security/openapi/openapi.yaml @@ -1,11 +1,11 @@ openapi: 3.0.0 info: - description: "API for CAPIF security management. \n© 2024, 3GPP Organizational\ + description: "API for CAPIF security management. \n© 2025, 3GPP Organizational\ \ Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). \nAll rights reserved.\n" title: CAPIF_Security_API - version: 1.3.0 + version: 1.4.0-alpha.2 externalDocs: - description: 3GPP TS 29.222 V18.6.0 Common API Framework for 3GPP Northbound APIs + description: 3GPP TS 29.222 V19.4.0 Common API Framework for 3GPP Northbound APIs url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.222/ servers: - url: "{apiRoot}/capif-security/v1" @@ -950,6 +950,7 @@ components: SecurityNotification: description: Represents the revoked authorization notification details. example: + access_token: access_token apiInvokerId: apiInvokerId cause: OVERLIMIT_USAGE aefId: aefId @@ -973,6 +974,11 @@ components: minItems: 1 title: apiIds type: array + access_token: + description: | + JWS Compact Serialized representation of JWS signed JSON object (AccessTokenClaims). + title: access_token + type: string cause: $ref: '#/components/schemas/Cause' required: @@ -1057,7 +1063,8 @@ components: - scope type: object ResOwnerId: - anyOf: [] + anyOf: + - required: ["gpsi"] description: | Represents the identifier of the resource owner. nullable: true @@ -1432,7 +1439,7 @@ components: nfInstanceId: description: "String uniquely identifying a NF instance. The format of the\ \ NF Instance ID shall be a Universally Unique Identifier (UUID) version\ - \ 4, as described in IETF RFC 4122. \n" + \ 4. \n" format: uuid title: NfInstanceId type: string @@ -1447,13 +1454,14 @@ components: targetNfInstanceId: description: "String uniquely identifying a NF instance. The format of the\ \ NF Instance ID shall be a Universally Unique Identifier (UUID) version\ - \ 4, as described in IETF RFC 4122. \n" + \ 4. \n" format: uuid title: NfInstanceId type: string requesterPlmn: $ref: '#/components/schemas/PlmnId' requesterPlmnList: + deprecated: true items: $ref: '#/components/schemas/PlmnId' minItems: 2 @@ -1533,7 +1541,7 @@ components: sourceNfInstanceId: description: "String uniquely identifying a NF instance. The format of the\ \ NF Instance ID shall be a Universally Unique Identifier (UUID) version\ - \ 4, as described in IETF RFC 4122. \n" + \ 4. \n" format: uuid title: NfInstanceId type: string @@ -1561,6 +1569,9 @@ components: pattern: "^[0-9]{6}$" title: VendorId type: string + afId: + title: afId + type: string required: - grant_type - nfInstanceId @@ -1654,8 +1665,8 @@ components: type: integer NfInstanceId: description: "String uniquely identifying a NF instance. The format of the NF\ - \ Instance ID shall be a Universally Unique Identifier (UUID) version 4,\ - \ as described in IETF RFC 4122. \n" + \ Instance ID shall be a Universally Unique Identifier (UUID) version 4.\ + \ \n" format: uuid title: NfInstanceId type: string @@ -1725,6 +1736,9 @@ components: - MF - SLPKMF - RH + - EIF + - AIOTF + - ADM type: string description: NF types known to NRF title: NFType @@ -1881,6 +1895,8 @@ components: - MOVEMENT_BEHAVIOUR - LOC_ACCURACY - RELATIVE_PROXIMITY + - SIGNALLING_STORM + - QOS_POLICY_ASSIST type: string description: "Describes the NWDAF Events. \nPossible values are:\n- SLICE_LOAD_LEVEL:\ \ Indicates that the event subscribed is load level information of Network\n\ @@ -1909,5 +1925,7 @@ components: \ Indicates that the event subscribed is the Movement Behaviour\n information.\n\ - LOC_ACCURACY: Indicates that the event subscribed is of location accuracy.\n\ - RELATIVE_PROXIMITY: Indicates that the event subscribed is the Relative\ - \ Proximity\n information.\n" + \ Proximity\n information.\n- SIGNALLING_STORM: Indicates that the event\ + \ subscribed is the Signalling Storm information.\n- QOS_POLICY_ASSIST: Indicates\ + \ that the event subscribed is the QoS and Policy\n Assistance information.\n" title: NwdafEvent diff --git a/services/TS29222_CAPIF_Security_API/capif_security/test/test_default_controller.py b/services/TS29222_CAPIF_Security_API/capif_security/test/test_default_controller.py index da26a6d60f9f873e168b53c95e80a271b395150e..f9cd1a80a8746e68642e86cf6fdc1b0cf6fb82c5 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/test/test_default_controller.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/test/test_default_controller.py @@ -4,8 +4,10 @@ from capif_security.models.access_token_err import AccessTokenErr # noqa: E501 from capif_security.models.access_token_rsp import AccessTokenRsp # noqa: E501 from capif_security.models.problem_details import ProblemDetails # noqa: E501 from capif_security.models.res_owner_id import ResOwnerId # noqa: E501 -from capif_security.models.security_notification import SecurityNotification # noqa: E501 -from capif_security.models.service_security import ServiceSecurity # noqa: E501 +from capif_security.models.security_notification import \ + SecurityNotification # noqa: E501 +from capif_security.models.service_security import \ + ServiceSecurity # noqa: E501 from capif_security.test import BaseTestCase from flask import json @@ -59,7 +61,7 @@ class TestDefaultController(BaseTestCase): """ - security_notification = {"apiInvokerId":"apiInvokerId","cause":"OVERLIMIT_USAGE","aefId":"aefId","apiIds":["apiIds","apiIds"]} + security_notification = {"access_token":"access_token","apiInvokerId":"apiInvokerId","cause":"OVERLIMIT_USAGE","aefId":"aefId","apiIds":["apiIds","apiIds"]} headers = { 'Accept': 'application/problem+json', 'Content-Type': 'application/json', diff --git a/services/TS29222_CAPIF_Security_API/capif_security/util.py b/services/TS29222_CAPIF_Security_API/capif_security/util.py index 8c4d60681399f9a3be7fe35b0e668bbbb38aaac5..18c6bf022c3d795c4ee7bde8abd77a6a08efa969 100644 --- a/services/TS29222_CAPIF_Security_API/capif_security/util.py +++ b/services/TS29222_CAPIF_Security_API/capif_security/util.py @@ -51,7 +51,6 @@ def dict_to_camel_case(my_dict): return result - def _deserialize(data, klass): """Deserializes dict, list, str into an object. diff --git a/services/TS29222_CAPIF_Security_API/prepare_security.sh b/services/TS29222_CAPIF_Security_API/prepare_security.sh index c14609ad221170db6da6490cd3a77e85dd8f3ee3..30b0c557e632ce151b5d4a72a4d1a43f8feb0006 100644 --- a/services/TS29222_CAPIF_Security_API/prepare_security.sh +++ b/services/TS29222_CAPIF_Security_API/prepare_security.sh @@ -47,15 +47,42 @@ fi ATTEMPT=0 SUCCES_OPERATION=false +HELPER_URL="http://helper:8080/helper/api/getCcfId" +ATTEMPT_CCFID=0 +CCF_ID="" + while [ $ATTEMPT -lt $MAX_RETRIES ]; do # Increment ATTEMPT using eval eval "ATTEMPT=\$((ATTEMPT + 1))" echo "Attempt $ATTEMPT of $MAX_RETRIES" - # Make the request to Vault and store the response in a variable + # Get CCF_ID from helper + echo "[STEP] Fetching CCF_ID from Helper: $HELPER_URL" + while [ $ATTEMPT_CCFID -lt $MAX_RETRIES ]; do + ATTEMPT_CCFID=$((ATTEMPT_CCFID + 1)) + echo "[INFO] Attempt $ATTEMPT_CCFID/$MAX_RETRIES – GET $HELPER_URL" + + RAW=$(curl -sS --fail --connect-timeout 5 --max-time 10 "$HELPER_URL" || true) + CCF_ID=$(echo "$RAW" | jq -r '.ccf_id // empty' 2>/dev/null) + + if [ -n "$CCF_ID" ]; then + echo "[INFO] Got CCF_ID=$CCF_ID" + break + fi + + echo "[WARN] Helper not ready or invalid response. Retrying in ${RETRY_DELAY}s..." + sleep $RETRY_DELAY + done + + if [ -z "$CCF_ID" ]; then + echo "[ERROR] Unable to retrieve CCF_ID from Helper after $MAX_RETRIES attempts" + exit 1 + fi + + RESPONSE=$(curl -s -k --connect-timeout 5 --max-time 10 \ --header "X-Vault-Token: $VAULT_TOKEN" \ - --request GET "$VAULT_ADDR/v1/secret/data/server_cert/private" | jq -r '.data.data.key') + --request GET "$VAULT_ADDR/v1/secret/data/capif/${CCF_ID}/nginx" | jq -r '.data.data.server_key') echo "$RESPONSE" diff --git a/services/TS29222_CAPIF_Security_API/requirements.txt b/services/TS29222_CAPIF_Security_API/requirements.txt index cfd57783206b9456703ab7ca54ab729b2ac92428..2b774f353de6fd3bb182d6403d11abfda7a85c20 100644 --- a/services/TS29222_CAPIF_Security_API/requirements.txt +++ b/services/TS29222_CAPIF_Security_API/requirements.txt @@ -1,25 +1,25 @@ connexion[flask, swagger-ui, uvicorn] == 3.1.0; python_version>="3.6" swagger-ui-bundle >= 0.0.2 python_dateutil >= 2.6.0 -setuptools == 74.0.0 +setuptools == 80.9.0 Flask == 3.0.3 pymongo == 4.7.3 redis == 4.5.4 flask_jwt_extended == 4.6.0 -cryptography == 42.0.8 +cryptography == 46.0.1 rfc3987 == 1.3.8 -opentelemetry-instrumentation == 0.40b0 -opentelemetry-instrumentation-flask == 0.40b0 -opentelemetry-instrumentation-redis == 0.40b0 -opentelemetry-instrumentation-pymongo == 0.40b0 -opentelemetry-exporter-otlp == 1.19.0 -opentelemetry-exporter-jaeger == 1.19.0 +opentelemetry-instrumentation == 0.41b0 +opentelemetry-instrumentation-flask == 0.41b0 +opentelemetry-instrumentation-redis == 0.41b0 +opentelemetry-instrumentation-pymongo == 0.41b0 +opentelemetry-exporter-otlp == 1.20.0 +opentelemetry-exporter-jaeger == 1.21.0 fluent == 0.10.0 fluent-logger == 0.10.0 -opentelemetry-api == 1.19.0 -opentelemetry-sdk == 1.19.0 +opentelemetry-api == 1.20.0 +opentelemetry-sdk == 1.20.0 Flask-APScheduler == 1.13.1 flask_executor == 1.0.0 -werkzeug == 3.0.4 +werkzeug == 3.1.3 gunicorn == 23.0.0 packaging == 24.0 \ No newline at end of file diff --git a/services/TS29222_CAPIF_Security_API/setup.py b/services/TS29222_CAPIF_Security_API/setup.py index f291508a42b991b1c21df0bb95c108472c38aea4..d88c748347d34cd9cc79785c7b9d60d35957d2f6 100644 --- a/services/TS29222_CAPIF_Security_API/setup.py +++ b/services/TS29222_CAPIF_Security_API/setup.py @@ -31,7 +31,7 @@ setup( entry_points={ 'console_scripts': ['capif_security=capif_security.__main__:main']}, long_description="""\ - API for CAPIF security management. © 2024, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. + API for CAPIF security management. © 2025, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. """ ) diff --git a/services/celery/tasks.py b/services/celery/tasks.py index 212902671d31f430e47f4a0c6bd1536a044f5a58..707ded6ec098448950aac2f2323db2a48527beb1 100644 --- a/services/celery/tasks.py +++ b/services/celery/tasks.py @@ -1,14 +1,15 @@ # celery/tasks.py -from celery import Celery +import asyncio +import logging +import os from datetime import datetime, timezone +from logging.handlers import RotatingFileHandler + +import aiohttp import pymongo -import os from bson.codec_options import CodecOptions +from celery import Celery from config import Config -import aiohttp -import asyncio -import logging -from logging.handlers import RotatingFileHandler # Initialize Celery celery = Celery( diff --git a/services/docker-compose-capif.yml b/services/docker-compose-capif.yml index e021aa52c815819c8508dab50c5de0fc5f76a2a3..2c0add10bb74cf39408113366eec2af966861e7b 100644 --- a/services/docker-compose-capif.yml +++ b/services/docker-compose-capif.yml @@ -20,6 +20,7 @@ services: restart: unless-stopped volumes: - ${SERVICES_DIR}/helper/config.yaml:/usr/src/app/config.yaml + # - ${SERVICES_DIR}/helper/helper_service/certs:/usr/src/app/helper_service/certs extra_hosts: - host.docker.internal:host-gateway - fluent-bit:host-gateway @@ -33,8 +34,6 @@ services: - VAULT_PORT=8200 - LOG_LEVEL=${LOG_LEVEL} image: ${REGISTRY_BASE_URL}/helper:${OCF_VERSION} - depends_on: - - nginx access-control-policy: build: @@ -317,7 +316,7 @@ services: - LOG_LEVEL=${LOG_LEVEL} hostname: ${CAPIF_HOSTNAME} volumes: - - ${SERVICES_DIR}/nginx/certs:/etc/nginx/certs + # - ${SERVICES_DIR}/nginx/certs:/etc/nginx/certs - ${SERVICES_DIR}/nginx/nginx_prepare.sh:/nginx_prepare.sh extra_hosts: - host.docker.internal:host-gateway diff --git a/services/docker-compose-register.yml b/services/docker-compose-register.yml index 4abed673d40d27ee70399e7de97d4895d9c82070..66607e557686a8e4a650ba3165b234c6cc7dd57f 100644 --- a/services/docker-compose-register.yml +++ b/services/docker-compose-register.yml @@ -1,5 +1,7 @@ services: register: + hostname: ${CAPIF_REGISTER} + container_name: ${CAPIF_REGISTER} build: context: ${SERVICES_DIR}/register ports: @@ -14,6 +16,7 @@ services: - LOG_LEVEL=${LOG_LEVEL} - TIMEOUT=10 - CAPIF_HOSTNAME=${CAPIF_HOSTNAME} + - REGISTER_HOSTNAME=${CAPIF_REGISTER} extra_hosts: - host.docker.internal:host-gateway - vault:host-gateway diff --git a/services/helper/config.yaml b/services/helper/config.yaml index 1efa369e54fb0a17672e0a8ff0fc54136c07fe74..1147d571d7a22e7a9aa69dd7f1493a0523fff59f 100644 --- a/services/helper/config.yaml +++ b/services/helper/config.yaml @@ -1,23 +1,23 @@ -mongo: { - 'user': 'root', - 'password': 'example', - 'db': 'capif', - 'invoker_col': 'invokerdetails', - 'provider_col': 'providerenrolmentdetails', - 'col_services': "serviceapidescriptions", - 'col_security': "security", - 'col_event': "eventsdetails", - 'col_capif_configuration': "capif_configuration", - 'host': 'mongo', - 'port': "27017" -} +mongo: + user: root + password: example + db: capif + invoker_col: invokerdetails + provider_col: providerenrolmentdetails + col_services: serviceapidescriptions + col_security: security + col_event: eventsdetails + col_capif_configuration: capif_configuration + host: mongo + port: 27017 + + +ca_factory: + url: vault + port: 8200 + token: dev-only-token + verify: False -ca_factory: { - "url": "vault", - "port": "8200", - "token": "dev-only-token", - "verify": False -} capif_configuration: config_description: Default CAPIF Configuration @@ -36,3 +36,14 @@ capif_configuration: oauth: 1 pki: 2 psk: 3 + +package_paths: + helper_api: + path: /api + openapi_file: api/openapi/openapi.yaml + configuration_api: + path: /configuration + openapi_file: configuration/openapi/openapi.yaml + visibility_control: + path: /visibility-control + openapi_file: visibility_control/openapi/openapi.yaml diff --git a/services/helper/helper_service/app.py b/services/helper/helper_service/app.py index 8525aa1ab09f629398313a20c80fd61164626e4f..1218db6bfa3073a932174f573cecf37c4a4fca27 100644 --- a/services/helper/helper_service/app.py +++ b/services/helper/helper_service/app.py @@ -1,19 +1,35 @@ import json import logging import os +import sys +from pathlib import Path + +import connexion import requests +from asgiref.wsgi import WsgiToAsgi from config import Config -from controllers.helper_controller import helper_routes -from db.db import MongoDatabse +from db.db import get_mongo from flask import Flask -from OpenSSL.crypto import FILETYPE_PEM, TYPE_RSA, PKey, X509Req, dump_certificate_request, dump_privatekey -from asgiref.wsgi import WsgiToAsgi +from OpenSSL.crypto import (FILETYPE_PEM, TYPE_RSA, PKey, X509Req, + dump_certificate_request, dump_privatekey) -app = Flask(__name__) +# --- Paths setup: make 'services' discoverable so "import api..." works --- +BASE_DIR = Path(__file__).resolve().parent +SERVICES_DIR = BASE_DIR / "services" + +# Insert services directory at front of sys.path +if SERVICES_DIR.is_dir(): + services_path_str = str(SERVICES_DIR) + if services_path_str not in sys.path: + sys.path.insert(0, services_path_str) +else: + raise RuntimeError(f"Services directory not found at {SERVICES_DIR!s}") + +app = connexion.App(__name__, specification_dir=str(SERVICES_DIR)) config = Config().get_config() # Connect MongoDB and get TTL for superadmin certificate -db = MongoDatabse() +db = get_mongo() capif_config = db.get_col_by_name("capif_configuration").find_one({}) ttl_superadmin_cert = capif_config["settings"]["certificates_expiry"].get("ttl_superadmin_cert", "43000h") @@ -40,10 +56,35 @@ csr_request = dump_certificate_request(FILETYPE_PEM, req) private_key = dump_privatekey(FILETYPE_PEM, key) # Save superadmin private key -key_file = open("certs/superadmin.key", 'wb+') -key_file.write(bytes(private_key)) -logger.info(f"Superadmin key:\n{private_key}") -key_file.close() +CERTS_DIR = Path(__file__).resolve().parent / "certs" + +try: + # If it exists but it's not a directory -> fail early with a clear error + if CERTS_DIR.exists() and not CERTS_DIR.is_dir(): + raise RuntimeError(f"'certs' exists but is not a directory: {CERTS_DIR}") + + CERTS_DIR.mkdir(parents=True, exist_ok=True) + + # Quick sanity check: can we write there? + if not os.access(CERTS_DIR, os.W_OK): + raise PermissionError(f"No write permission on certs dir: {CERTS_DIR}") + + key_path = CERTS_DIR / "superadmin.key" + with open(key_path, "wb") as f: + f.write(private_key) + + # Restrict permissions (best-effort; may be limited by FS/umask) + try: + os.chmod(key_path, 0o600) + except Exception as e: + logger.warning(f"Could not chmod {key_path} to 600: {e}") + + logger.info(f"Superadmin key written to {key_path}") + +except Exception: + logger.exception(f"Failed to write superadmin key under {CERTS_DIR}") + raise + # Request superadmin certificate url = 'http://{}:{}/v1/pki_int/sign/my-ca'.format(config["ca_factory"]["url"], config["ca_factory"]["port"]) @@ -60,9 +101,8 @@ superadmin_cert = json.loads(response.text)['data']['certificate'] logger.info(f"Superadmin Cert:\n{superadmin_cert}") # Save the superadmin certificate -cert_file = open("certs/superadmin.crt", 'wb') -cert_file.write(bytes(superadmin_cert, 'utf-8')) -cert_file.close() +with open(CERTS_DIR / "superadmin.crt", "wb") as cert_file: + cert_file.write(superadmin_cert.encode("utf-8")) url = f"http://{config['ca_factory']['url']}:{config['ca_factory']['port']}/v1/secret/data/ca" headers = { @@ -73,11 +113,40 @@ response = requests.request("GET", url, headers=headers, verify = config["ca_fac ca_root = json.loads(response.text)['data']['data']['ca'] logger.info(f"CA root:\n{ca_root}") -cert_file = open("certs/ca_root.crt", 'wb') -cert_file.write(bytes(ca_root, 'utf-8')) -cert_file.close() +with open(CERTS_DIR / "ca_root.crt", "wb") as cert_file: + cert_file.write(ca_root.encode("utf-8")) + + +package_paths = config.get("package_paths", {}) + +if not package_paths: + logger.error("No package paths defined in configuration.") + raise Exception("No package paths defined in configuration.") + +# Dynamically add all APIs defined in package_paths +for name, pkg in package_paths.items(): + openapi_file = pkg.get("openapi_file") + base_path = pkg.get("path") + + if not openapi_file or not base_path: + logger.warning(f"Skipping package_path '{name}' because 'openapi_file' or 'path' is missing.") + continue + + # Build a readable title from the key, e.g. "helper_api" -> "Helper Api" + title = name.replace("_", " ").title() + + logger.info( + f"Adding API '{name}': openapi_file='{openapi_file}', base_path='{base_path}', title='{title}'" + ) + + app.add_api( + openapi_file, # relative to specification_dir (SERVICES_DIR) + arguments={"title": title}, + pythonic_params=True, + base_path="/helper/" + base_path + ) + -app.register_blueprint(helper_routes) -app.logger.setLevel(numeric_level) +app.app.logger.setLevel(numeric_level) asgi_app = WsgiToAsgi(app) \ No newline at end of file diff --git a/services/helper/helper_service/controllers/helper_controller.py b/services/helper/helper_service/controllers/helper_controller.py deleted file mode 100644 index 19b11160cc621d0b2a86b9bdc7ac0f50fe83065a..0000000000000000000000000000000000000000 --- a/services/helper/helper_service/controllers/helper_controller.py +++ /dev/null @@ -1,193 +0,0 @@ -#!/usr/bin/env python3 - -from config import Config -from core.helper_operations import HelperOperations -from flask import Blueprint, current_app, jsonify, request - -config = Config().get_config() - -helper_routes = Blueprint("helper_routes", __name__) -helper_operation = HelperOperations() - -@helper_routes.route("/helper/getInvokers", methods=["GET"]) -def getInvokers(): - uuid = request.args.get('uuid') - invoker_id = request.args.get('api_invoker_id') - page_size = request.args.get('page_size') - page = request.args.get('page') - sort_order = request.args.get('sort_order') - if page_size: - page_size = int(page_size) - if page_size < 0: - return jsonify(message="The value of the page_size parameter must be greater than 0"), 400 - if page: - page = int(page) - if page < 0: - return jsonify(message="The value of the page parameter must be greater than 0"), 400 - - current_app.logger.debug(f"uuid: {uuid}, invoker_id: {invoker_id}, page: {page}, page_size: {page_size}, sort_order: {sort_order}") - - return helper_operation.get_invokers(uuid, invoker_id, page, page_size, sort_order) - -@helper_routes.route("/helper/getProviders", methods=["GET"]) -def getProviders(): - uuid = request.args.get('uuid') - provider_id = request.args.get('api_prov_dom_id') - page_size = request.args.get('page_size') - page = request.args.get('page') - sort_order = request.args.get('sort_order') - - if page_size: - page_size = int(page_size) - if page_size < 0: - return jsonify(message="The value of the page_size parameter must be greater than 0"), 400 - if page: - page = int(page) - if page < 0: - return jsonify(message="The value of the page parameter must be greater than 0"), 400 - - current_app.logger.debug(f"uuid: {uuid}, provider_id: {provider_id}, page: {page}, page_size: {page_size}, sort_order: {sort_order}") - - return helper_operation.get_providers(uuid, provider_id, page, page_size, sort_order) - - -@helper_routes.route("/helper/getServices", methods=["GET"]) -def getServices(): - service_id = request.args.get('service_id') - apf_id = request.args.get('apf_id') - api_name = request.args.get('api_name') - page_size = request.args.get('page_size') - page = request.args.get('page') - sort_order = request.args.get('sort_order') - if page_size: - page_size = int(page_size) - if page_size < 0: - return jsonify(message="The value of the page_size parameter must be greater than 0"), 400 - if page: - page = int(page) - if page < 0: - return jsonify(message="The value of the page parameter must be greater than 0"), 400 - - current_app.logger.debug(f"service_id: {service_id}, apf_id: {apf_id}, api_name: {api_name}, page: {page}, page_size: {page_size}, sort_order: {sort_order}") - - return helper_operation.get_services(service_id, apf_id, api_name, page, page_size, sort_order) - -@helper_routes.route("/helper/getSecurity", methods=["GET"]) -def getSecurity(): - invoker_id = request.args.get('invoker_id') - page_size = request.args.get('page_size') - page = request.args.get('page') - if page_size: - page_size = int(page_size) - if page_size < 0: - return jsonify(message="The value of the page_size parameter must be greater than 0"), 400 - if page: - page = int(page) - if page < 0: - return jsonify(message="The value of the page parameter must be greater than 0"), 400 - - current_app.logger.debug(f"invoker_id: {invoker_id}, page: {page}, page_size: {page_size} ") - - return helper_operation.get_security(invoker_id, page, page_size) - -@helper_routes.route("/helper/getEvents", methods=["GET"]) -def getEvents(): - subscriber_id = request.args.get('subscriber_id') - subscription_id = request.args.get('subscription_id') - page_size = request.args.get('page_size') - page = request.args.get('page') - if page_size: - page_size = int(page_size) - if page_size < 0: - return jsonify(message="The value of the page_size parameter must be greater than 0"), 400 - if page: - page = int(page) - if page < 0: - return jsonify(message="The value of the page parameter must be greater than 0"), 400 - - current_app.logger.debug(f"subscriber_id: {subscriber_id}, subscription_id: {subscription_id}, page: {page}, page_size: {page_size} ") - - return helper_operation.get_events(subscriber_id, subscription_id, page, page_size) - - -@helper_routes.route("/helper/deleteEntities/", methods=["DELETE"]) -def deleteUserEntities(uuid): - return helper_operation.remove_entities(uuid) - - -@helper_routes.route("/helper/getConfiguration", methods=["GET"]) -def getConfiguration(): - """Returns the current configuration""" - return helper_operation.get_configuration() - - -@helper_routes.route("/helper/updateConfigParam", methods=["PATCH"]) -def updateConfigParam(): - """Updates a single configuration parameter""" - data = request.json - param_path = data.get("param_path") - new_value = data.get("new_value") - - if not param_path or new_value is None: - return jsonify(message="Missing 'param_path' or 'new_value' in request body"), 400 - - return helper_operation.update_config_param(param_path, new_value) - - -@helper_routes.route("/helper/replaceConfiguration", methods=["PUT"]) -def replaceConfiguration(): - """Replaces the entire configuration with a new one""" - new_config = request.json - if not new_config: - return jsonify(message="Missing new configuration in request body"), 400 - - return helper_operation.replace_configuration(new_config) - - -@helper_routes.route("/helper/addNewConfiguration", methods=["POST"]) -def add_new_configuration(): - """Adds a new category inside 'settings'.""" - data = request.json - category_name = data.get("category_name") - category_values = data.get("category_values") - - if not category_name or not category_values: - return jsonify(message="Missing 'category_name' or 'category_values' in request body"), 400 - - return helper_operation.add_new_configuration(category_name, category_values) - -@helper_routes.route("/helper/addNewConfigSetting", methods=["PATCH"]) -def add_new_config_setting(): - """Adds a new configuration inside 'settings'.""" - data = request.json - param_path = data.get("param_path") - new_value = data.get("new_value") - - if not param_path or new_value is None: - return jsonify(message="Missing 'param_path' or 'new_value' in request body"), 400 - - return helper_operation.add_new_config_setting(param_path, new_value) - - -@helper_routes.route("/helper/removeConfigParam", methods=["DELETE"]) -def remove_config_param(): - """Deletes a specific parameter inside 'settings'.""" - data = request.json - param_path = data.get("param_path") - - if not param_path: - return jsonify(message="Missing 'param_path' in request body"), 400 - - return helper_operation.remove_config_param(param_path) - - -@helper_routes.route("/helper/removeConfigCategory", methods=["DELETE"]) -def remove_config_category(): - """Deletes an entire category inside 'settings'.""" - data = request.json - category_name = data.get("category_name") - - if not category_name: - return jsonify(message="Missing 'category_name' in request body"), 400 - - return helper_operation.remove_config_category(category_name) diff --git a/services/helper/helper_service/db/db.py b/services/helper/helper_service/db/db.py index 8a7ea94d705339f40341dd350041b4848ea49606..27896463542e860838af3f95ffe02a5bf3c8ebe7 100644 --- a/services/helper/helper_service/db/db.py +++ b/services/helper/helper_service/db/db.py @@ -1,4 +1,6 @@ +import secrets import time +from threading import Lock from bson.codec_options import CodecOptions from config import Config @@ -8,7 +10,26 @@ from pymongo.errors import AutoReconnect class MongoDatabse(): - def __init__(self): + _instance = None + _lock = Lock() + + def __new__(cls): + if cls._instance is None: + with cls._lock: + if cls._instance is None: # double-checked + cls._instance = super().__new__(cls) + cls._instance._init_once() + return cls._instance + + def close(self): + if getattr(self, "_client", None): + self._client.close() + self._client = None + + def get_col_by_name(self, name): + return self.db[name].with_options(codec_options=CodecOptions(tz_aware=True)) + + def _init_once(self): self.config = Config().get_config() self.db = self.__connect() self.invoker_col = self.config['mongo']['invoker_col'] @@ -59,8 +80,27 @@ class MongoDatabse(): # Read configuration from config.yaml default_config = self.config["capif_configuration"] + # Generate unique ccf_id + ccf_id = "CCF" + secrets.token_hex(15) + default_config["ccf_id"] = ccf_id + capif_col.insert_one(default_config) - print("Default data inserted into the capif_configuration collection from config.yaml") + print(f"Default data inserted into capif_configuration from config.yaml with ccf_id={ccf_id}") + else: - print("The capif_configuration collection already contains data. No default values were inserted.") + # Ensure ccf_id exists even if config already there + existing_config = capif_col.find_one({}, {"_id": 0}) + if "ccf_id" not in existing_config: + ccf_id = "CCF" + secrets.token_hex(15) + capif_col.update_one({}, {"$set": {"ccf_id": ccf_id}}) + print(f"Added missing ccf_id={ccf_id} to existing CAPIF configuration") + else: + print("Capif_configuration already contains data with a unique ccf_id. No default values inserted.") + +_singleton = None +def get_mongo(): + global _singleton + if _singleton is None: + _singleton = MongoDatabse() + return _singleton \ No newline at end of file diff --git a/services/helper/helper_service/generate.sh b/services/helper/helper_service/generate.sh new file mode 100755 index 0000000000000000000000000000000000000000..7c67dacb7eeaf1c1f23ab5b165316642e81f162f --- /dev/null +++ b/services/helper/helper_service/generate.sh @@ -0,0 +1,62 @@ +#!/bin/bash +set -e + +if [ "$#" -ne 2 ]; then + echo "Usage: $0 " + echo "Example: $0 openapi/auth.yaml auth" + exit 1 +fi + +YAML_PATH="$1" +SERVICE_NAME="$2" +SERVICE_DIR="services/$SERVICE_NAME" + +# Clean previous service folder if it exists +rm -rf "$SERVICE_DIR" + +# Generate the service using OpenAPI Generator +openapi-generator generate \ + -i "$YAML_PATH" \ + -g python-flask \ + -o "$SERVICE_DIR" \ + --additional-properties=packageName="$SERVICE_NAME" + +# Move generated inner folder to the root of the service directory +if [ -d "$SERVICE_DIR/$SERVICE_NAME" ]; then + mv "$SERVICE_DIR/$SERVICE_NAME"/* "$SERVICE_DIR"/ + rm -rf "$SERVICE_DIR/$SERVICE_NAME" +fi + +# Files to delete +FILES_TO_DELETE=( + ".dockerignore" + ".gitignore" + ".openapi-generator-ignore" + ".travis.yml" + "Dockerfile" + "git_push.sh" + "README.md" + "requirements.txt" + "setup.py" + "test-requirements.txt" + "tox.ini" +) + +# Directories to delete +DIRS_TO_DELETE=( + ".openapi-generator" + ".github" + "test" + "docs" +) + +# Remove unnecessary files and folders +for file in "${FILES_TO_DELETE[@]}"; do + rm -f "$SERVICE_DIR/$file" +done + +for dir in "${DIRS_TO_DELETE[@]}"; do + rm -rf "$SERVICE_DIR/$dir" +done + +echo "✅ Service '$SERVICE_NAME' successfully generated from '$YAML_PATH'" diff --git a/services/helper/helper_service/openapi_helper_api.yaml b/services/helper/helper_service/openapi_helper_api.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c6cd3412ee0914410c4314e314af569de246f858 --- /dev/null +++ b/services/helper/helper_service/openapi_helper_api.yaml @@ -0,0 +1,1404 @@ +openapi: 3.0.1 +info: + title: Helper API + version: "1.0.0" + description: | + CAPIF Helper API for browsing CAPIF runtime data: invokers, providers, services, + security bindings, and subscriptions/events. This is an internal helper interface. +servers: + - url: "{apiRoot}/api" + variables: + apiRoot: + default: http://localhost:8080 + description: Base URL of the Helper service. +paths: + /deleteEntities/{uuid}: + delete: + summary: Delete entities by UUID + description: Deletes all CAPIF entities (invokers, providers, services, security contexts, events) associated with the given UUID. + operationId: helper_controller.delete_entities + parameters: + - name: uuid + in: path + required: true + schema: + type: string + description: UUID of the user whose entities are to be deleted. + responses: + '200': + description: Entities deleted successfully. + '400': + $ref: '#/components/responses/BadRequest' + '500': + $ref: '#/components/responses/InternalError' + default: + $ref: '#/components/responses/GenericError' + /getCcfId: + get: + summary: Get CCF ID + description: Retrieves the CCF ID of the CAPIF Core Function. + operationId: helper_controller.get_ccf_id + responses: + '200': + description: CCF ID retrieved successfully. + '400': + $ref: '#/components/responses/BadRequest' + '500': + $ref: '#/components/responses/InternalError' + default: + $ref: '#/components/responses/GenericError' + /getInvokers: + get: + summary: Retrieve API invokers + description: Returns invoker entries with pagination and optional filters. + operationId: helper_controller.get_invokers + parameters: + - name: uuid + in: query + schema: + type: string + description: Filter by invoker UUID. + - name: api_invoker_id + in: query + schema: + type: string + description: Filter by CAPIF `apiInvokerId`. + - name: page_size + in: query + schema: + type: integer + minimum: 1 + default: 20 + description: Page size. + - name: page + in: query + schema: + type: integer + minimum: 0 + default: 0 + description: Page index (0-based). + - name: sort_order + in: query + schema: + type: string + enum: + - asc + - desc + description: Sort direction. + responses: + '200': + description: Paged list of invokers. + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedResponseInvoker' + '400': + $ref: '#/components/responses/BadRequest' + '500': + $ref: '#/components/responses/InternalError' + default: + $ref: '#/components/responses/GenericError' + /getProviders: + get: + summary: Retrieve providers + description: Returns provider domains (CAPIF provider domains / AEF providers) with pagination. + operationId: helper_controller.get_providers + parameters: + - name: uuid + in: query + schema: + type: string + description: Filter by provider UUID. + - name: api_prov_dom_id + in: query + schema: + type: string + description: Filter by provider domain ID. + - name: page_size + in: query + schema: + type: integer + minimum: 1 + default: 20 + description: Page size. + - name: page + in: query + schema: + type: integer + minimum: 0 + default: 0 + description: Page index (0-based). + - name: sort_order + in: query + schema: + type: string + enum: + - asc + - desc + description: Sort direction. + responses: + '200': + description: Paged list of providers. + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedResponseProvider' + '400': + $ref: '#/components/responses/BadRequest' + '500': + $ref: '#/components/responses/InternalError' + default: + $ref: '#/components/responses/GenericError' + /getServices: + get: + summary: Retrieve services + description: Returns published APIs/services exposed by providers. + operationId: helper_controller.get_services + parameters: + - name: service_id + in: query + schema: + type: string + description: Filter by service identifier. + - name: apf_id + in: query + schema: + type: string + description: Filter by APF identifier. + - name: api_name + in: query + schema: + type: string + description: Filter by API name. + - name: page_size + in: query + schema: + type: integer + minimum: 1 + default: 20 + description: Page size. + - name: page + in: query + schema: + type: integer + minimum: 0 + default: 0 + description: Page index (0-based). + - name: sort_order + in: query + schema: + type: string + enum: + - asc + - desc + description: Sort direction. + responses: + '200': + description: Paged list of services. + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedResponseService' + '400': + $ref: '#/components/responses/BadRequest' + '500': + $ref: '#/components/responses/InternalError' + default: + $ref: '#/components/responses/GenericError' + /getSecurity: + get: + summary: Retrieve security associations + description: Returns security credentials/bindings for a given invoker. + operationId: helper_controller.get_security + parameters: + - name: invoker_id + in: query + schema: + type: string + description: Filter by invoker identifier. + - name: page_size + in: query + schema: + type: integer + minimum: 1 + default: 20 + description: Page size. + - name: page + in: query + schema: + type: integer + minimum: 0 + default: 0 + description: Page index (0-based). + responses: + '200': + description: Paged list of security entries. + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedResponseSecurity' + '400': + $ref: '#/components/responses/BadRequest' + '500': + $ref: '#/components/responses/InternalError' + default: + $ref: '#/components/responses/GenericError' + /getEvents: + get: + summary: Retrieve CAPIF events + description: Returns CAPIF event subscriptions or delivered events. + operationId: helper_controller.get_events + parameters: + - name: subscriber_id + in: query + schema: + type: string + description: Filter by subscriber identifier. + - name: subscription_id + in: query + schema: + type: string + description: Filter by subscription identifier. + - name: page_size + in: query + schema: + type: integer + minimum: 1 + default: 20 + description: Page size. + - name: page + in: query + schema: + type: integer + minimum: 0 + default: 0 + description: Page index (0-based). + responses: + '200': + description: Paged list of events. + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedResponseEvent' + '400': + $ref: '#/components/responses/BadRequest' + '500': + $ref: '#/components/responses/InternalError' + default: + $ref: '#/components/responses/GenericError' +components: + responses: + BadRequest: + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + InternalError: + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + GenericError: + description: Generic error response. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + schemas: + ErrorResponse: + type: object + description: Generic error payload. + properties: + message: + type: string + details: + type: string + PaginatedResponseBase: + type: object + description: Common pagination envelope. + properties: + total: + type: integer + example: 42 + description: Total number of resources in CAPIF. + long: + type: integer + example: 0 + description: Total number of resources that match the given parameters + totalPages: + type: integer + example: 20 + description: Total number of pages given page size. + sort_order: + type: string + enum: + - asc + - desc + example: asc + description: Sorting by creation date of the resources (ascending or descending). + PaginatedResponseInvoker: + allOf: + - $ref: '#/components/schemas/PaginatedResponseBase' + - type: object + properties: + invokers: + description: CAPIF invokers list + type: array + items: + $ref: '#/components/schemas/APIInvokerEnrolmentDetails' + PaginatedResponseProvider: + allOf: + - $ref: '#/components/schemas/PaginatedResponseBase' + - type: object + properties: + providers: + description: CAPIF providers list + type: array + items: + $ref: '#/components/schemas/APIProviderEnrolmentDetails' + PaginatedResponseService: + allOf: + - $ref: '#/components/schemas/PaginatedResponseBase' + - type: object + properties: + services: + description: CAPIF services list. + type: array + items: + $ref: '#/components/schemas/ServiceAPIDescription' + PaginatedResponseSecurity: + allOf: + - $ref: '#/components/schemas/PaginatedResponseBase' + - type: object + properties: + security: + description: CAPIF security context list. + type: array + items: + $ref: '#/components/schemas/ServiceSecurity' + PaginatedResponseEvent: + allOf: + - $ref: '#/components/schemas/PaginatedResponseBase' + - type: object + properties: + events: + description: CAPIF events list. + type: array + items: + $ref: '#/components/schemas/EventSubscription' + APIInvokerEnrolmentDetails: + required: + - notificationDestination + - onboardingInformation + type: object + properties: + onboarding_date: + type: string + description: Invoker onboarding date + format: date-time + username: + type: string + description: User who registered the invoker + uuid: + type: string + description: uuid of the user who registered the invoker + format: uuid + apiInvokerId: + type: string + description: | + API invoker ID assigned by the CAPIF core function to the API invoker while on-boarding the API invoker. Shall not be present in the HTTP POST request from the API invoker to the CAPIF core function, to on-board itself. Shall be present in all other HTTP requests and responses. + readOnly: true + onboardingInformation: + $ref: '#/components/schemas/OnboardingInformation' + notificationDestination: + $ref: '#/components/schemas/Uri' + requestTestNotification: + type: boolean + description: | + Set to true by Subscriber to request the CAPIF core function to send a test notification as defined in in clause 7.6. Set to false or omitted otherwise. + websockNotifConfig: + $ref: '#/components/schemas/WebsockNotifConfig' + apiList: + $ref: '#/components/schemas/APIList' + apiInvokerInformation: + type: string + description: | + Generic information related to the API invoker such as details of the device or the application. + supportedFeatures: + $ref: '#/components/schemas/SupportedFeatures' + description: Information about the API Invoker that requested to onboard + APIProviderEnrolmentDetails: + required: + - regSec + type: object + properties: + onboarding_date: + type: string + description: Provider onboarding date + format: date-time + username: + type: string + description: User who registered the provider + uuid: + type: string + description: uuid of the user who registered the provider + format: uuid + apiProvDomId: + type: string + description: | + API provider domain ID assigned by the CAPIF core function to the API management function while registering the API provider domain. Shall not be present in the HTTP POST request from the API Management function to the CAPIF core function, to on-board itself. Shall be present in all other HTTP requests and responses. + readOnly: true + regSec: + type: string + description: | + Security information necessary for the CAPIF core function to validate the registration of the API provider domain. Shall be present in HTTP POST request from API management function to CAPIF core function for API provider domain registration. + apiProvFuncs: + minItems: 1 + type: array + description: | + A list of individual API provider domain functions details. When included by the API management function in the HTTP request message, it lists the API provider domain functions that the API management function intends to register/update in registration or update registration procedure. When included by the CAPIF core function in the HTTP response message, it lists the API domain functions details that are registered or updated successfully. + items: + $ref: '#/components/schemas/APIProviderFunctionDetails' + apiProvDomInfo: + type: string + description: | + Generic information related to the API provider domain such as details of the API provider applications. + suppFeat: + $ref: '#/components/schemas/SupportedFeatures' + failReason: + type: string + description: | + Registration or update specific failure information of failed API provider domain function registrations.Shall be present in the HTTP response body if atleast one of the API provider domain function registration or update registration fails. + description: Represents an API provider domain's enrolment details. + ServiceSecurity: + required: + - notificationDestination + - securityInfo + type: object + properties: + api_invoker_id: + type: string + description: Id of the invoker of this security context. + securityInfo: + minimum: 1 + type: array + items: + $ref: '#/components/schemas/SecurityInformation' + notificationDestination: + $ref: '#/components/schemas/Uri' + requestTestNotification: + type: boolean + description: | + Set to true by API invoker to request the CAPIF core function to send a test notification as defined in in clause 7.6. Set to false or omitted otherwise. + websockNotifConfig: + $ref: '#/components/schemas/WebsockNotifConfig' + supportedFeatures: + $ref: '#/components/schemas/SupportedFeatures' + description: | + Represents the details of the security method for each service API interface. When included by the API invoker, it indicates the preferred method of security. When included by the CAPIF core function, it indicates the security method to be used for the service API interface. + SecurityInformation: + required: + - prefSecurityMethods + type: object + properties: + interfaceDetails: + $ref: '#/components/schemas/InterfaceDescription' + aefId: + type: string + description: Identifier of the API exposing function + apiId: + type: string + description: API identifier + prefSecurityMethods: + minItems: 1 + type: array + description: Security methods preferred by the API invoker for the API interface. + items: + $ref: '#/components/schemas/SecurityMethod' + selSecurityMethod: + $ref: '#/components/schemas/SecurityMethod' + authenticationInfo: + type: string + description: Authentication related information + authorizationInfo: + type: string + description: Authorization related information + description: Represents the interface details and the security method. + oneOf: + - required: + - interfaceDetails + - required: + - aefId + EventSubscription: + required: + - events + - notificationDestination + type: object + properties: + events: + minItems: 1 + type: array + description: Subscribed events + items: + $ref: '#/components/schemas/CAPIFEvent' + eventFilters: + minItems: 1 + type: array + description: Subscribed event filters + items: + $ref: '#/components/schemas/CAPIFEventFilter' + eventReq: + $ref: '#/components/schemas/ReportingInformation' + notificationDestination: + $ref: '#/components/schemas/Uri' + requestTestNotification: + type: boolean + description: | + Set to true by Subscriber to request the CAPIF core function to send a test notification as defined in in clause 7.6. Set to false or omitted otherwise. + websockNotifConfig: + $ref: '#/components/schemas/WebsockNotifConfig' + supportedFeatures: + $ref: '#/components/schemas/SupportedFeatures' + description: Represents an individual CAPIF Event Subscription resource. + OnboardingInformation: + required: + - apiInvokerPublicKey + type: object + properties: + apiInvokerPublicKey: + type: string + description: The API Invoker's public key + apiInvokerCertificate: + type: string + description: | + The API Invoker's generic client certificate, provided by the CAPIF core function. + onboardingSecret: + type: string + description: | + The API Invoker's onboarding secret, provided by the CAPIF core function. + description: Represents on-boarding information of the API invoker. + APIProviderFunctionDetails: + required: + - apiProvFuncRole + - regInfo + type: object + properties: + apiProvFuncId: + type: string + description: | + API provider domain functionID assigned by the CAPIF core function to the API provider domain function while registering/updating the API provider domain. Shall not be present in the HTTP POST request from the API management function to the CAPIF core function, to register itself. Shall be present in all other HTTP requests and responses. + regInfo: + $ref: '#/components/schemas/RegistrationInformation' + apiProvFuncRole: + $ref: '#/components/schemas/ApiProviderFuncRole' + apiProvFuncInfo: + type: string + description: | + Generic information related to the API provider domain function such as details of the API provider applications. + description: Represents API provider domain function's details. + ApiProviderFuncRole: + description: | + Possible values are: + - AEF: API provider function is API Exposing Function. + - APF: API provider function is API Publishing Function. + - AMF: API Provider function is API Management Function. + anyOf: + - type: string + enum: + - AEF + - APF + - AMF + - type: string + description: | + This string provides forward-compatiblity with future extensions to the enumeration but is not used to encode content defined in the present version of this API. + RegistrationInformation: + required: + - apiProvPubKey + type: object + properties: + apiProvPubKey: + type: string + description: Public Key of API Provider domain function. + apiProvCert: + type: string + description: API provider domain function's client certificate + description: | + Represents registration information of an individual API provider domain function. + APIList: + type: object + properties: + serviceAPIDescriptions: + minItems: 1 + type: array + description: The list of service APIs that the API Invoker is allowed to invoke. + items: + $ref: '#/components/schemas/ServiceAPIDescription' + description: Represents a list of APIs. + Uri: + type: string + description: string providing an URI formatted according to IETF RFC 3986. + WebsockNotifConfig: + type: object + properties: + websocketUri: + $ref: '#/components/schemas/Link' + requestWebsocketUri: + type: boolean + description: Set by the SCS/AS to indicate that the Websocket delivery is requested. + description: Represents the configuration information for the delivery of notifications over Websockets. + Link: + type: string + description: string formatted according to IETF RFC 3986 identifying a referenced resource. + SupportedFeatures: + pattern: "^[A-Fa-f0-9]*$" + type: string + description: | + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of "0" to "9", "a" to "f" or "A" to "F" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. + ServiceAPIDescription: + required: + - apiName + type: object + properties: + apiName: + type: string + description: "API name, it is set as {apiName} part of the URI structure as defined in clause 5.2.4 of 3GPP TS 29.122." + apiId: + type: string + description: | + API identifier assigned by the CAPIF core function to the published service API. Shall not be present in the HTTP POST request from the API publishing function to the CAPIF core function. Shall be present in the HTTP POST response from the CAPIF core function to the API publishing function and in the HTTP GET response from the CAPIF core function to the API invoker (discovery API). + aefProfiles: + minItems: 1 + type: array + description: | + AEF profile information, which includes the exposed API details (e.g. protocol). + items: + $ref: '#/components/schemas/AefProfile' + description: + type: string + description: Text description of the API + supportedFeatures: + $ref: '#/components/schemas/SupportedFeatures' + shareableInfo: + $ref: '#/components/schemas/ShareableInformation' + serviceAPICategory: + type: string + apiSuppFeats: + $ref: '#/components/schemas/SupportedFeatures' + pubApiPath: + $ref: '#/components/schemas/PublishedApiPath' + ccfId: + type: string + description: CAPIF core function identifier. + description: Represents the description of a service API as published by the APF. + AefProfile: + required: + - aefId + - versions + type: object + properties: + aefId: + type: string + description: Identifier of the API exposing function + versions: + minItems: 1 + type: array + description: API version + items: + $ref: '#/components/schemas/Version' + protocol: + $ref: '#/components/schemas/Protocol' + dataFormat: + $ref: '#/components/schemas/DataFormat' + securityMethods: + minItems: 1 + type: array + description: Security methods supported by the AEF + items: + $ref: '#/components/schemas/SecurityMethod' + domainName: + type: string + description: Domain to which API belongs to + interfaceDescriptions: + minItems: 1 + type: array + description: Interface details + items: + $ref: '#/components/schemas/InterfaceDescription' + aefLocation: + $ref: '#/components/schemas/AefLocation' + description: Represents the AEF profile data. + oneOf: + - required: + - domainName + - required: + - interfaceDescriptions + ShareableInformation: + required: + - isShareable + type: object + properties: + isShareable: + type: boolean + description: | + Set to "true" indicates that the service API and/or the service API category can be shared to the list of CAPIF provider domain information. Otherwise set to "false". + capifProvDoms: + minItems: 1 + type: array + description: | + List of CAPIF provider domains to which the service API information to be shared. + items: + type: string + description: | + Indicates whether the service API and/or the service API category can be shared to the list of CAPIF provider domains. + PublishedApiPath: + type: object + properties: + ccfIds: + minItems: 1 + type: array + description: A list of CCF identifiers where the service API is already published. + items: + type: string + description: Represents the published API path within the same CAPIF provider domain. + Version: + required: + - apiVersion + type: object + properties: + apiVersion: + type: string + description: API major version in URI (e.g. v1) + expiry: + $ref: '#/components/schemas/DateTime' + resources: + minItems: 1 + type: array + description: Resources supported by the API. + items: + $ref: '#/components/schemas/Resource' + custOperations: + minItems: 1 + type: array + description: Custom operations without resource association. + items: + $ref: '#/components/schemas/CustomOperation' + description: Represents the API version information. + Protocol: + description: | + Possible values are: + - HTTP_1_1: HTTP version 1.1 + - HTTP_2: HTTP version 2 + anyOf: + - type: string + enum: + - HTTP_1_1 + - HTTP_2 + - type: string + description: | + This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. + DataFormat: + description: | + Possible values are: + - JSON: JavaScript Object Notation + anyOf: + - type: string + enum: + - JSON + - type: string + description: | + This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. + SecurityMethod: + description: | + Possible values are: + - PSK: Security method 1 (Using TLS-PSK) as described in 3GPP TS 33.122 + - PKI: Security method 2 (Using PKI) as described in 3GPP TS 33.122 + - OAUTH: Security method 3 (TLS with OAuth token) as described in 3GPP TS 33.122 + anyOf: + - type: string + enum: + - PSK + - PKI + - OAUTH + - type: string + description: | + This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. + Resource: + required: + - commType + - resourceName + - uri + type: object + properties: + resourceName: + type: string + description: Resource name + commType: + $ref: '#/components/schemas/CommunicationType' + uri: + type: string + description: | + Relative URI of the API resource, it is set as {apiSpecificSuffixes} part of the URI structure as defined in clause 5.2.4 of 3GPP TS 29.122. + custOpName: + type: string + description: | + it is set as {custOpName} part of the URI structure for a custom operation associated with a resource as defined in clause 5.2.4 of 3GPP TS 29.122. + operations: + minItems: 1 + type: array + description: | + Supported HTTP methods for the API resource. Only applicable when the protocol in AefProfile indicates HTTP. + items: + $ref: '#/components/schemas/Operation' + description: + type: string + description: Text description of the API resource + description: Represents the API resource data. + CustomOperation: + required: + - commType + - custOpName + type: object + properties: + commType: + $ref: '#/components/schemas/CommunicationType' + custOpName: + type: string + description: | + it is set as {custOpName} part of the URI structure for a custom operation without resource association as defined in clause 5.2.4 of 3GPP TS 29.122. + operations: + minItems: 1 + type: array + description: | + Supported HTTP methods for the API resource. Only applicable when the protocol in AefProfile indicates HTTP. + items: + $ref: '#/components/schemas/Operation' + description: + type: string + description: Text description of the custom operation + description: Represents the description of a custom operation. + CommunicationType: + description: | + Possible values are: + - REQUEST_RESPONSE: The communication is of the type request-response + - SUBSCRIBE_NOTIFY: The communication is of the type subscribe-notify + anyOf: + - type: string + enum: + - REQUEST_RESPONSE + - SUBSCRIBE_NOTIFY + - type: string + description: | + This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. + Operation: + description: | + Possible values are: + - GET: HTTP GET method + - POST: HTTP POST method + - PUT: HTTP PUT method + - PATCH: HTTP PATCH method + - DELETE: HTTP DELETE method + anyOf: + - type: string + enum: + - GET + - POST + - PUT + - PATCH + - DELETE + - type: string + description: | + This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. + InterfaceDescription: + type: object + properties: + ipv4Addr: + $ref: '#/components/schemas/Ipv4Addr' + ipv6Addr: + $ref: '#/components/schemas/Ipv6Addr' + port: + $ref: '#/components/schemas/Port' + securityMethods: + minItems: 1 + type: array + description: | + Security methods supported by the interface, it take precedence over the security methods provided in AefProfile, for this specific interface. + items: + $ref: '#/components/schemas/SecurityMethod' + description: Represents the description of an API's interface. + oneOf: + - required: + - ipv4Addr + - required: + - ipv6Addr + Ipv4Addr: + type: string + description: string identifying a Ipv4 address formatted in the "dotted decimal" notation as defined in IETF RFC 1166. + Ipv6Addr: + type: string + description: string identifying a Ipv6 address formatted according to clause 4 in IETF RFC 5952. The mixed Ipv4 Ipv6 notation according to clause 5 of IETF RFC 5952 shall not be used. + Port: + maximum: 65535 + minimum: 0 + type: integer + description: Unsigned integer with valid values between 0 and 65535. + AefLocation: + type: object + properties: + civicAddr: + $ref: '#/components/schemas/CivicAddress' + geoArea: + $ref: '#/components/schemas/GeographicArea' + dcId: + type: string + description: | + Identifies the data center where the AEF providing the service API is located. + description: | + The location information (e.g. civic address, GPS coordinates, data center ID) where the AEF providing the service API is located. + DateTime: + type: string + description: string with format "date-time" as defined in OpenAPI. + format: date-time + CivicAddress: + type: object + properties: + country: + type: string + A1: + type: string + A2: + type: string + A3: + type: string + A4: + type: string + A5: + type: string + A6: + type: string + PRD: + type: string + POD: + type: string + STS: + type: string + HNO: + type: string + HNS: + type: string + LMK: + type: string + LOC: + type: string + NAM: + type: string + PC: + type: string + BLD: + type: string + UNIT: + type: string + FLR: + type: string + ROOM: + type: string + PLC: + type: string + PCN: + type: string + POBOX: + type: string + ADDCODE: + type: string + SEAT: + type: string + RD: + type: string + RDSEC: + type: string + RDBR: + type: string + RDSUBBR: + type: string + PRM: + type: string + POM: + type: string + usageRules: + type: string + method: + type: string + providedBy: + type: string + description: Indicates a Civic address. + GeographicArea: + description: Geographic area specified by different shape. + anyOf: + - $ref: '#/components/schemas/Point' + - $ref: '#/components/schemas/PointUncertaintyCircle' + - $ref: '#/components/schemas/PointUncertaintyEllipse' + - $ref: '#/components/schemas/Polygon' + - $ref: '#/components/schemas/PointAltitude' + - $ref: '#/components/schemas/PointAltitudeUncertainty' + - $ref: '#/components/schemas/EllipsoidArc' + Point: + description: Ellipsoid Point. + allOf: + - $ref: '#/components/schemas/GADShape' + - required: + - point + type: object + properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + GADShape: + required: + - shape + type: object + properties: + shape: + $ref: '#/components/schemas/SupportedGADShapes' + description: Common base type for GAD shapes. + discriminator: + propertyName: shape + mapping: + POINT: '#/components/schemas/Point' + POINT_UNCERTAINTY_CIRCLE: '#/components/schemas/PointUncertaintyCircle' + POINT_UNCERTAINTY_ELLIPSE: '#/components/schemas/PointUncertaintyEllipse' + POLYGON: '#/components/schemas/Polygon' + POINT_ALTITUDE: '#/components/schemas/PointAltitude' + POINT_ALTITUDE_UNCERTAINTY: '#/components/schemas/PointAltitudeUncertainty' + ELLIPSOID_ARC: '#/components/schemas/EllipsoidArc' + LOCAL_2D_POINT_UNCERTAINTY_ELLIPSE: '#/components/schemas/Local2dPointUncertaintyEllipse' + LOCAL_3D_POINT_UNCERTAINTY_ELLIPSOID: '#/components/schemas/Local3dPointUncertaintyEllipsoid' + GeographicalCoordinates: + required: + - lat + - lon + type: object + properties: + lon: + maximum: 180 + minimum: -180 + type: number + format: double + lat: + maximum: 90 + minimum: -90 + type: number + format: double + description: Geographical coordinates. + SupportedGADShapes: + description: Indicates supported GAD shapes. + anyOf: + - type: string + enum: + - POINT + - POINT_UNCERTAINTY_CIRCLE + - POINT_UNCERTAINTY_ELLIPSE + - POLYGON + - POINT_ALTITUDE + - POINT_ALTITUDE_UNCERTAINTY + - ELLIPSOID_ARC + - LOCAL_2D_POINT_UNCERTAINTY_ELLIPSE + - LOCAL_3D_POINT_UNCERTAINTY_ELLIPSOID + - type: string + PointUncertaintyCircle: + description: Ellipsoid point with uncertainty circle. + allOf: + - $ref: '#/components/schemas/GADShape' + - required: + - point + - uncertainty + type: object + properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + uncertainty: + $ref: '#/components/schemas/Uncertainty' + Uncertainty: + minimum: 0 + type: number + description: Indicates value of uncertainty. + format: float + PointUncertaintyEllipse: + description: Ellipsoid point with uncertainty ellipse. + allOf: + - $ref: '#/components/schemas/GADShape' + - required: + - confidence + - point + - uncertaintyEllipse + type: object + properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + uncertaintyEllipse: + $ref: '#/components/schemas/UncertaintyEllipse' + confidence: + $ref: '#/components/schemas/Confidence' + UncertaintyEllipse: + required: + - orientationMajor + - semiMajor + - semiMinor + type: object + properties: + semiMajor: + $ref: '#/components/schemas/Uncertainty' + semiMinor: + $ref: '#/components/schemas/Uncertainty' + orientationMajor: + $ref: '#/components/schemas/Orientation' + description: Ellipse with uncertainty. + Confidence: + maximum: 100 + minimum: 0 + type: integer + description: Indicates value of confidence. + Orientation: + maximum: 180 + minimum: 0 + type: integer + description: Indicates value of orientation angle. + Polygon: + description: Polygon. + allOf: + - $ref: '#/components/schemas/GADShape' + - required: + - pointList + type: object + properties: + pointList: + $ref: '#/components/schemas/PointList' + PointList: + maxItems: 15 + minItems: 3 + type: array + description: List of points. + items: + $ref: '#/components/schemas/GeographicalCoordinates' + PointAltitude: + description: Ellipsoid point with altitude. + allOf: + - $ref: '#/components/schemas/GADShape' + - required: + - altitude + - point + type: object + properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + altitude: + $ref: '#/components/schemas/Altitude' + Altitude: + maximum: 32767 + minimum: -32767 + type: number + description: Indicates value of altitude. + format: double + PointAltitudeUncertainty: + description: Ellipsoid point with altitude and uncertainty ellipsoid. + allOf: + - $ref: '#/components/schemas/GADShape' + - required: + - altitude + - confidence + - point + - uncertaintyAltitude + - uncertaintyEllipse + type: object + properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + altitude: + $ref: '#/components/schemas/Altitude' + uncertaintyEllipse: + $ref: '#/components/schemas/UncertaintyEllipse' + uncertaintyAltitude: + $ref: '#/components/schemas/Uncertainty' + confidence: + $ref: '#/components/schemas/Confidence' + EllipsoidArc: + description: Ellipsoid Arc. + allOf: + - $ref: '#/components/schemas/GADShape' + - required: + - confidence + - includedAngle + - innerRadius + - offsetAngle + - point + - uncertaintyRadius + type: object + properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + innerRadius: + $ref: '#/components/schemas/InnerRadius' + uncertaintyRadius: + $ref: '#/components/schemas/Uncertainty' + offsetAngle: + $ref: '#/components/schemas/Angle' + includedAngle: + $ref: '#/components/schemas/Angle' + confidence: + $ref: '#/components/schemas/Confidence' + InnerRadius: + maximum: 327675 + minimum: 0 + type: integer + description: Indicates value of the inner radius. + format: int32 + Angle: + maximum: 360 + minimum: 0 + type: integer + description: Indicates value of angle. + CAPIFEvent: + description: | + Possible values are: + - SERVICE_API_AVAILABLE: Events related to the availability of service APIs after the service APIs are published. + - SERVICE_API_UNAVAILABLE: Events related to the unavailability of service APIs after the service APIs are unpublished. + - SERVICE_API_UPDATE: Events related to change in service API information. + - API_INVOKER_ONBOARDED: Events related to API invoker onboarded to CAPIF. + - API_INVOKER_OFFBOARDED: Events related to API invoker offboarded from CAPIF. + - SERVICE_API_INVOCATION_SUCCESS: Events related to the successful invocation of service APIs. + - SERVICE_API_INVOCATION_FAILURE: Events related to the failed invocation of service APIs. + - ACCESS_CONTROL_POLICY_UPDATE: Events related to the update for the access control policy related to the service APIs. + - ACCESS_CONTROL_POLICY_UNAVAILABLE: Events related to the unavailability of the access control policy related to the service APIs. + - API_INVOKER_AUTHORIZATION_REVOKED: Events related to the revocation of the authorization of API invokers to access the service APIs. + - API_INVOKER_UPDATED: Events related to API invoker profile updated to CAPIF. + - API_TOPOLOGY_HIDING_CREATED: Events related to the creation or update of the API topology hiding information of the service APIs after the service APIs are published. + - API_TOPOLOGY_HIDING_REVOKED: Events related to the revocation of the API topology hiding information of the service APIs after the service APIs are unpublished. + anyOf: + - type: string + enum: + - SERVICE_API_AVAILABLE + - SERVICE_API_UNAVAILABLE + - SERVICE_API_UPDATE + - API_INVOKER_ONBOARDED + - API_INVOKER_OFFBOARDED + - SERVICE_API_INVOCATION_SUCCESS + - SERVICE_API_INVOCATION_FAILURE + - ACCESS_CONTROL_POLICY_UPDATE + - ACCESS_CONTROL_POLICY_UNAVAILABLE + - API_INVOKER_AUTHORIZATION_REVOKED + - API_INVOKER_UPDATED + - API_TOPOLOGY_HIDING_CREATED + - API_TOPOLOGY_HIDING_REVOKED + - type: string + description: | + This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. + CAPIFEventFilter: + type: object + properties: + apiIds: + minItems: 1 + type: array + description: Identifier of the service API + items: + type: string + apiInvokerIds: + minItems: 1 + type: array + description: Identity of the API invoker + items: + type: string + aefIds: + minItems: 1 + type: array + description: Identifier of the API exposing function + items: + type: string + description: Represents a CAPIF event filter. + ReportingInformation: + type: object + properties: + immRep: + type: boolean + notifMethod: + $ref: '#/components/schemas/NotificationMethod' + maxReportNbr: + $ref: '#/components/schemas/Uinteger' + monDur: + $ref: '#/components/schemas/DateTime' + repPeriod: + $ref: '#/components/schemas/DurationSec' + sampRatio: + $ref: '#/components/schemas/SamplingRatio' + partitionCriteria: + minItems: 1 + type: array + description: Criteria for partitioning the UEs before applying the sampling ratio. + items: + $ref: '#/components/schemas/PartitioningCriteria' + grpRepTime: + $ref: '#/components/schemas/DurationSec' + notifFlag: + $ref: '#/components/schemas/NotificationFlag' + description: Represents the type of reporting that the subscription requires. + NotificationMethod: + description: | + Possible values are: + - PERIODIC + - ONE_TIME + - ON_EVENT_DETECTION + anyOf: + - type: string + enum: + - PERIODIC + - ONE_TIME + - ON_EVENT_DETECTION + - type: string + description: | + This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. + Uinteger: + minimum: 0 + type: integer + description: "Unsigned Integer, i.e. only value 0 and integers above 0 are permissible." + DurationSec: + type: integer + description: indicating a time in seconds. + SamplingRatio: + maximum: 100 + minimum: 1 + type: integer + description: "Unsigned integer indicating Sampling Ratio (see clauses 4.15.1 of 3GPP TS 23.502), expressed in percent. \n" + PartitioningCriteria: + description: | + Possible values are: + - "TAC": Type Allocation Code + - "SUBPLMN": Subscriber PLMN ID + - "GEOAREA": Geographical area, i.e. list(s) of TAI(s) + - "SNSSAI": S-NSSAI + - "DNN": DNN + anyOf: + - type: string + enum: + - TAC + - SUBPLMN + - GEOAREA + - SNSSAI + - DNN + - type: string + description: | + This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. + NotificationFlag: + description: |- + Possible values are: + - ACTIVATE: The event notification is activated. + - DEACTIVATE: The event notification is deactivated and shall be muted. The available + event(s) shall be stored. + - RETRIEVAL: The event notification shall be sent to the NF service consumer(s), + after that, is muted again. + anyOf: + - type: string + enum: + - ACTIVATE + - DEACTIVATE + - RETRIEVAL + - type: string + description: "This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. \n" + diff --git a/services/helper/helper_service/openapi_helper_configuration.yaml b/services/helper/helper_service/openapi_helper_configuration.yaml new file mode 100644 index 0000000000000000000000000000000000000000..55698cb29324bac4783f8c2b633b92de7e416677 --- /dev/null +++ b/services/helper/helper_service/openapi_helper_configuration.yaml @@ -0,0 +1,305 @@ +openapi: 3.0.1 +info: + title: Helper Configuration API + version: "1.0.0" + description: | + CAPIF Helper Configuration API. Allows reading and modifying the runtime configuration + stored in MongoDB (ACL policy, certificate expiration, security priorities, etc). +servers: + - url: "{apiRoot}/configuration" + variables: + apiRoot: + default: http://localhost:8080 + description: Base URL of the Helper service. +paths: + /getConfiguration: + get: + summary: Read full configuration + description: Returns the entire CAPIF configuration document. + operationId: configuration_controller.get_configuration + responses: + '200': + description: Current configuration + content: + application/json: + schema: + $ref: '#/components/schemas/CapifConfiguration' + '500': + $ref: '#/components/responses/InternalError' + default: + $ref: '#/components/responses/GenericError' + /updateConfigParam: + patch: + summary: Update single config parameter + description: Updates a single setting inside the configuration using a dotted path selector. + operationId: dynamic_config_controller.update_config_param + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigParamUpdateRequest' + responses: + '200': + description: Parameter updated + content: + application/json: + schema: + $ref: '#/components/schemas/CapifConfiguration' + '400': + $ref: '#/components/responses/BadRequest' + '500': + $ref: '#/components/responses/InternalError' + default: + $ref: '#/components/responses/GenericError' + /replaceConfiguration: + put: + summary: Replace entire configuration + description: Replaces the configuration document with a new one. + operationId: dynamic_config_controller.replace_configuration + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CapifConfiguration' + responses: + '200': + description: Updated configuration + content: + application/json: + schema: + $ref: '#/components/schemas/CapifConfiguration' + '400': + $ref: '#/components/responses/BadRequest' + '500': + $ref: '#/components/responses/InternalError' + default: + $ref: '#/components/responses/GenericError' + /addNewConfiguration: + post: + summary: Add new config setting at path + description: Adds a new key/value inside an existing category using "param_path" and "new_value". + operationId: dynamic_config_controller.add_new_config_setting + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigParamUpdateRequest' + responses: + '200': + description: Setting added + content: + application/json: + schema: + $ref: '#/components/schemas/CapifConfiguration' + '400': + $ref: '#/components/responses/BadRequest' + '500': + $ref: '#/components/responses/InternalError' + default: + $ref: '#/components/responses/GenericError' + /addNewConfigSetting: + patch: + summary: Add new configuration category + description: Adds a brand new top-level category. + operationId: dynamic_config_controller.add_new_configuration + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigCategoryCreateRequest' + responses: + '200': + description: Category added + content: + application/json: + schema: + $ref: '#/components/schemas/CapifConfiguration' + '400': + $ref: '#/components/responses/BadRequest' + '500': + $ref: '#/components/responses/InternalError' + default: + $ref: '#/components/responses/GenericError' + /removeConfigParam: + delete: + summary: Remove config parameter + description: Deletes a leaf parameter by dotted path. + operationId: dynamic_config_controller.remove_config_param + parameters: + - name: param_path + in: query + required: true + schema: + type: string + description: Parameter path to remove + responses: + '200': + description: Parameter removed + content: + application/json: + schema: + $ref: '#/components/schemas/CapifConfiguration' + '400': + $ref: '#/components/responses/BadRequest' + '500': + $ref: '#/components/responses/InternalError' + default: + $ref: '#/components/responses/GenericError' + /removeConfigCategory: + delete: + summary: Remove configuration category + description: Deletes an entire top-level category by name. + operationId: dynamic_config_controller.remove_config_category + parameters: + - name: config_path + in: query + required: true + schema: + type: string + description: Configuration path to remove + responses: + '200': + description: Category removed + content: + application/json: + schema: + $ref: '#/components/schemas/CapifConfiguration' + '400': + $ref: '#/components/responses/BadRequest' + '500': + $ref: '#/components/responses/InternalError' + default: + $ref: '#/components/responses/GenericError' +components: + responses: + BadRequest: + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + InternalError: + description: Internal server error + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + GenericError: + description: Generic error response + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + schemas: + CapifConfiguration: + type: object + additionalProperties: true + description: CAPIF runtime configuration document. + properties: + config_name: + type: string + example: default + description: Configuration name + version: + type: string + example: 1.0 + description: configuration version + settings: + type: object + items: + $ref: '#/components/schemas/Settings' + ConfigParamUpdateRequest: + type: object + required: + - param_path + - new_value + properties: + param_path: + type: string + description: Dotted path to the configuration value to update. + new_value: + description: New value for the configuration parameter. + ConfigCategoryCreateRequest: + type: object + required: + - category_name + - category_values + properties: + category_name: + type: string + description: Name of the new configuration category. + category_values: + type: object + additionalProperties: true + description: Key/value pairs that compose the new category. + GenericError: + type: object + properties: + code: + type: string + message: + type: string + required: + - code + - message + Settings: + type: object + description: Configuration Settings + properties: + certificates_expiry: + type: object + description: Expiry configuration for certificates + properties: + ttl_superadmin_cert: + type: string + example: 4300h + description: ttl for superadmin certificates + ttl_invoker_cert: + type: string + example: 4300h + description: ttl for invoker certificates + ttl_provider_cert: + type: string + example: 4300h + description: ttl for provider certificates + security_method_priority: + type: object + description: priority to follow in granting the security method + properties: + oauth: + type: integer + example: 1 + pki: + type: integer + example: 2 + psk: + type: integer + example: 3 + acl_policy_settings: + type: object + description: default access policies + properties: + allowed_total_invocations: + type: string + example: 5 + description: total number of requests the invoker can make + allowed_invocations_per_second: + type: string + example: 5 + description: total number of requests the invoker can make per second + allowed_invocations_time_range_days: + type: integer + example: 365 + description: time range when an invoker can make requests + + + + + + + + \ No newline at end of file diff --git a/services/helper/helper_service/openapi_helper_visibility_control.yaml b/services/helper/helper_service/openapi_helper_visibility_control.yaml new file mode 100644 index 0000000000000000000000000000000000000000..43d181fe9b09397dd305c03f537a5959e5986139 --- /dev/null +++ b/services/helper/helper_service/openapi_helper_visibility_control.yaml @@ -0,0 +1,536 @@ +openapi: 3.0.3 +info: + title: OpenCAPIF Access Control + version: 1.0.0 + description: | + Access-control API to manage visibility rules and evaluate decisions for API discovery and + security-context access within OpenCAPIF. This API controls whether APIs are visible to invokers + (discovery) and whether invokers are allowed to create a security context to access them. + - Rules are global and evaluated with "more specific wins" precedence. + - If no rule matches, the decision uses OpenCAPIF's global default (outside this API). + - Provider selector is mandatory in rules and must contain at least one selector field. +servers: + - url: https://capif.example.com/access-control + description: Production + - url: https://sandbox.capif.example.com/access-control + description: Sandbox + +tags: + - name: Rules + description: Manage visibility rules + - name: Decision + description: Evaluate discovery and access decisions + +paths: + /rules: + get: + tags: [Rules] + summary: List rules + responses: + '200': + description: List of rules + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/Rule' + nextPageToken: + type: string + required: [items] + post: + tags: [Rules] + summary: Create a rule + description: Server generates the ruleId. Provider selector must include at least one field. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RuleCreateRequest' + examples: + allow_except_some_invokers: + value: + providerSelector: + userName: "userA" + apiProviderId: [ "capif-prov-01", "capif-prov-02" ] + apiName: [ "apiName-001" ] + apiId: [ "apiId-001" ] + aefId: [ "aef-001" ] + invokerExceptions: + apiInvokerId: [ "invk-123", "invk-999" ] + default_access: ALLOW + enabled: true + responses: + '201': + description: Rule created + content: + application/json: + schema: + $ref: '#/components/schemas/Rule' + '400': + description: Invalid input + content: + application/json: + schema: { $ref: '#/components/schemas/Error' } + + /rules/{ruleId}: + get: + tags: [Rules] + summary: Get a rule + parameters: + - $ref: '#/components/parameters/RuleId' + responses: + '200': + description: Rule + content: + application/json: + schema: + $ref: '#/components/schemas/Rule' + '404': + description: Rule not found + content: + application/json: + schema: { $ref: '#/components/schemas/Error' } + patch: + tags: [Rules] + summary: Update a rule (partial) + parameters: + - $ref: '#/components/parameters/RuleId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RulePatchRequest' + responses: + '200': + description: Rule updated + content: + application/json: + schema: + $ref: '#/components/schemas/Rule' + '400': + description: Invalid input + content: + application/json: + schema: { $ref: '#/components/schemas/Error' } + '404': + description: Rule not found + content: + application/json: + schema: { $ref: '#/components/schemas/Error' } + delete: + tags: [Rules] + summary: Delete a rule + parameters: + - $ref: '#/components/parameters/RuleId' + responses: + '204': + description: Deleted + '404': + description: Rule not found + content: + application/json: + schema: { $ref: '#/components/schemas/Error' } + + /decision/invokers/{apiInvokerId}/discoverable-apis: + get: + tags: [Decision] + summary: Get discoverable APIs filter for an invoker (global scope) + description: | + Returns a filtered list of APIs for the API Invoker. + parameters: + - $ref: '#/components/parameters/ApiInvokerId' + responses: + '200': + description: Discover filter + content: + application/json: + schema: + $ref: '#/components/schemas/DiscoveredAPIs' + '400': + description: Invalid input + content: + application/json: + schema: { $ref: '#/components/schemas/Error' } + '404': + description: Invoker not found (optional behavior) + content: + application/json: + schema: { $ref: '#/components/schemas/Error' } + +components: + parameters: + RuleId: + in: path + name: ruleId + required: true + schema: + type: string + description: Server-generated rule identifier + ApiInvokerId: + in: path + name: apiInvokerId + required: true + schema: + type: string + description: CAPIF API Invoker identifier + + schemas: + # ---------- Core Rule Schemas ---------- + RuleCreateRequest: + type: object + required: [providerSelector, default_access] + properties: + providerSelector: + $ref: '#/components/schemas/ProviderSelector' + invokerExceptions: + $ref: '#/components/schemas/InvokerSelector' + default_access: + type: string + enum: [ALLOW, DENY] + enabled: + type: boolean + default: true + startsAt: + type: string + format: date-time + endsAt: + type: string + format: date-time + notes: + type: string + description: | + Create a new rule. Provider selector is mandatory and must include at least one field. + If both startsAt and endsAt are present, endsAt must be greater than startsAt. + + RulePatchRequest: + type: object + properties: + providerSelector: + $ref: '#/components/schemas/PatchProviderSelector' + invokerExceptions: + $ref: '#/components/schemas/InvokerSelector' + default_access: + type: string + enum: [ALLOW, DENY] + enabled: + type: boolean + startsAt: + type: string + format: date-time + endsAt: + type: string + format: date-time + notes: + type: string + description: Partial update. Any omitted field remains unchanged. + + Rule: + type: object + properties: + ruleId: + type: string + providerSelector: + $ref: '#/components/schemas/ProviderSelector' + invokerExceptions: + $ref: '#/components/schemas/InvokerSelector' + default_access: + type: string + enum: [ALLOW, DENY] + enabled: + type: boolean + default: true + startsAt: + type: string + format: date-time + endsAt: + type: string + format: date-time + notes: + type: string + updatedAt: + type: string + format: date-time + updatedBy: + type: string + required: [ruleId, providerSelector, default_access] + + PatchProviderSelector: + type: object + description: | + Patch Provider-side selector. + properties: + apiProviderId: + type: array + items: { type: string } + minItems: 0 + uniqueItems: true + apiName: + type: array + items: { type: string } + minItems: 0 + uniqueItems: true + apiId: + type: array + items: { type: string } + minItems: 0 + uniqueItems: true + aefId: + type: array + items: { type: string } + minItems: 0 + uniqueItems: true + userName: + type: string + minLength: 1 + additionalProperties: false + + ProviderSelector: + type: object + description: | + Provider-side selector. Arrays apply OR within the field; AND across fields. + At least one of these fields must be present. + required: + - userName + properties: + userName: + type: string + minLength: 1 + apiProviderId: + type: array + items: { type: string } + minItems: 0 + uniqueItems: true + apiName: + type: array + items: { type: string } + minItems: 0 + uniqueItems: true + apiId: + type: array + items: { type: string } + minItems: 0 + uniqueItems: true + aefId: + type: array + items: { type: string } + minItems: 0 + uniqueItems: true + additionalProperties: false + + InvokerSelector: + type: object + description: Invoker-side selector used for exceptions. Optional; arrays use OR within the field; AND across fields. + properties: + invokerOnboardedByUser: + type: array + items: { type: string } + minItems: 0 + uniqueItems: true + apiInvokerId: + type: array + items: { type: string } + minItems: 0 + uniqueItems: true + additionalProperties: false + + # ---------- Decision Schemas (3GPP Based) ---------- + DiscoveredAPIs: + type: object + properties: + serviceAPIDescriptions: + type: array + items: + $ref: '#/components/schemas/ServiceAPIDescription' + minItems: 1 + suppFeat: + $ref: '#/components/schemas/SupportedFeatures' + + ServiceAPIDescription: + type: object + required: [apiName] + properties: + apiName: { type: string } + apiId: { type: string } + apiStatus: { $ref: '#/components/schemas/ApiStatus' } + aefProfiles: + type: array + items: { $ref: '#/components/schemas/AefProfile' } + minItems: 1 + description: { type: string } + supportedFeatures: { $ref: '#/components/schemas/SupportedFeatures' } + shareableInfo: { $ref: '#/components/schemas/ShareableInformation' } + serviceAPICategory: { type: string } + apiSuppFeats: { $ref: '#/components/schemas/SupportedFeatures' } + pubApiPath: { $ref: '#/components/schemas/PublishedApiPath' } + ccfId: { type: string } + apiProvName: { type: string } + #apiProvName is apiProviderId? + + + AefProfile: + type: object + required: [aefId, versions] + properties: + aefId: { type: string } + versions: + type: array + items: { $ref: '#/components/schemas/Version' } + minItems: 1 + protocol: { $ref: '#/components/schemas/Protocol' } + dataFormat: { $ref: '#/components/schemas/DataFormat' } + securityMethods: + type: array + items: { $ref: '#/components/schemas/SecurityMethod' } + grantTypes: + type: array + items: { $ref: '#/components/schemas/OAuthGrantType' } + domainName: { type: string } + interfaceDescriptions: + type: array + items: { $ref: '#/components/schemas/InterfaceDescription' } + aefLocation: { $ref: '#/components/schemas/AefLocation' } + serviceKpis: { $ref: '#/components/schemas/ServiceKpis' } + ueIpRange: { $ref: '#/components/schemas/IpAddrRange' } + + Version: + type: object + required: [apiVersion] + properties: + apiVersion: { type: string } + expiry: { type: string, format: date-time } + resources: + type: array + items: { $ref: '#/components/schemas/Resource' } + custOperations: + type: array + items: { $ref: '#/components/schemas/CustomOperation' } + + Resource: + type: object + required: [commType, resourceName, uri] + properties: + resourceName: { type: string } + commType: { $ref: '#/components/schemas/CommunicationType' } + uri: { type: string } + custOpName: { type: string } + operations: + type: array + items: { $ref: '#/components/schemas/Operation' } + description: { type: string } + + CustomOperation: + type: object + required: [commType, custOpName] + properties: + commType: { $ref: '#/components/schemas/CommunicationType' } + custOpName: { type: string } + operations: + type: array + items: { $ref: '#/components/schemas/Operation' } + description: { type: string } + + ApiStatus: + type: object + required: [aefIds] + properties: + aefIds: + type: array + items: { type: string } + + InterfaceDescription: + type: object + properties: + ipv4Addr: { type: string } + ipv6Addr: { type: string } + fqdn: { type: string } + port: { type: integer } + apiPrefix: { type: string } + securityMethods: + type: array + items: { $ref: '#/components/schemas/SecurityMethod' } + grantTypes: + type: array + items: { $ref: '#/components/schemas/OAuthGrantType' } + + # ---------- Supporting 3GPP Types ---------- + SupportedFeatures: + type: string + pattern: "^[A-Fa-f0-9]*$" + CommunicationType: + type: string + enum: [REQUEST_RESPONSE, SUBSCRIBE_NOTIFY] + Protocol: + type: string + enum: [HTTP_1_1, HTTP_2, MQTT, WEBSOCKET] + DataFormat: + type: string + enum: [JSON, XML, PROTOBUF3] + Operation: + type: string + enum: [GET, POST, PUT, PATCH, DELETE] + SecurityMethod: + type: string + enum: [PSK, PKI, OAUTH] + OAuthGrantType: + type: string + enum: [CLIENT_CREDENTIALS, AUTHORIZATION_CODE, AUTHORIZATION_CODE_WITH_PKCE] + + ShareableInformation: + type: object + required: [isShareable] + properties: + isShareable: { type: boolean } + capifProvDoms: + type: array + items: { type: string } + + PublishedApiPath: + type: object + properties: + ccfIds: + type: array + items: { type: string } + + AefLocation: + type: object + properties: + dcId: { type: string } + # Simplified for brevity, you can add GeographicArea/CivicAddress if needed + + ServiceKpis: + type: object + properties: + maxReqRate: { type: integer } + maxRestime: { type: integer } + availability: { type: integer } + avalComp: { type: string } + avalMem: { type: string } + avalStor: { type: string } + + IpAddrRange: + type: object + properties: + ueIpv4AddrRanges: + type: array + items: + type: object + properties: + start: { type: string } + end: { type: string } + + # ---------- Errors ---------- + Error: + type: object + required: [code, message] + properties: + code: { type: string } + message: { type: string } + details: + type: object + additionalProperties: true \ No newline at end of file diff --git a/services/helper/helper_service/openapitools.json b/services/helper/helper_service/openapitools.json new file mode 100644 index 0000000000000000000000000000000000000000..f8d07ce1d97f42f0d1d88e9e8a76f01df7f059be --- /dev/null +++ b/services/helper/helper_service/openapitools.json @@ -0,0 +1,7 @@ +{ + "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", + "spaces": 2, + "generator-cli": { + "version": "7.10.0" + } +} diff --git a/services/helper/helper_service/services/api/__init__.py b/services/helper/helper_service/services/api/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/services/helper/helper_service/services/api/__main__.py b/services/helper/helper_service/services/api/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..5a3c432154544cc652003d4283930020554b0d98 --- /dev/null +++ b/services/helper/helper_service/services/api/__main__.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 + +import connexion +from api import encoder + + +def main(): + app = connexion.App(__name__, specification_dir='./openapi/') + app.app.json_encoder = encoder.JSONEncoder + app.add_api('openapi.yaml', + arguments={'title': 'Helper API'}, + pythonic_params=True) + + app.run(port=8080) + + +if __name__ == '__main__': + main() diff --git a/services/helper/helper_service/services/api/controllers/__init__.py b/services/helper/helper_service/services/api/controllers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/services/helper/helper_service/services/api/controllers/default_controller.py b/services/helper/helper_service/services/api/controllers/default_controller.py new file mode 100644 index 0000000000000000000000000000000000000000..ade46c254ba169c93319990b3c95dc66cd27f5d3 --- /dev/null +++ b/services/helper/helper_service/services/api/controllers/default_controller.py @@ -0,0 +1,140 @@ + +from api.models.error_response import ErrorResponse # noqa: E501 +from api.models.paginated_response_event import \ + PaginatedResponseEvent # noqa: E501 +from api.models.paginated_response_invoker import \ + PaginatedResponseInvoker # noqa: E501 +from api.models.paginated_response_provider import \ + PaginatedResponseProvider # noqa: E501 +from api.models.paginated_response_security import \ + PaginatedResponseSecurity # noqa: E501 +from api.models.paginated_response_service import \ + PaginatedResponseService # noqa: E501 + +from ..core.helper_operations import HelperOperations + +helper_operations = HelperOperations() + +def helper_controller_delete_entities(uuid): # noqa: E501 + """Delete entities by UUID + + Deletes all CAPIF entities (invokers, providers, services, security contexts, events) associated with the given UUID. # noqa: E501 + + :param uuid: UUID of the user whose entities are to be deleted. + :type uuid: str + + :rtype: Union[None, Tuple[None, int], Tuple[None, int, Dict[str, str]] + """ + return helper_operations.remove_entities(uuid) + + +def helper_controller_get_ccf_id(): # noqa: E501 + """Get CCF ID + + Retrieves the CCF ID of the CAPIF Core Function. # noqa: E501 + + + :rtype: Union[None, Tuple[None, int], Tuple[None, int, Dict[str, str]] + """ + return helper_operations.get_ccf_id() + + +def helper_controller_get_events(subscriber_id=None, subscription_id=None, page_size=None, page=None): # noqa: E501 + """Retrieve CAPIF events + + Returns CAPIF event subscriptions or delivered events. # noqa: E501 + + :param subscriber_id: Filter by subscriber identifier. + :type subscriber_id: str + :param subscription_id: Filter by subscription identifier. + :type subscription_id: str + :param page_size: Page size. + :type page_size: int + :param page: Page index (0-based). + :type page: int + + :rtype: Union[PaginatedResponseEvent, Tuple[PaginatedResponseEvent, int], Tuple[PaginatedResponseEvent, int, Dict[str, str]] + """ + return helper_operations.get_events(subscriber_id, subscription_id, page_size, page) + + +def helper_controller_get_invokers(uuid=None, api_invoker_id=None, page_size=None, page=None, sort_order=None): # noqa: E501 + """Retrieve API invokers + + Returns invoker entries with pagination and optional filters. # noqa: E501 + + :param uuid: Filter by invoker UUID. + :type uuid: str + :param api_invoker_id: Filter by CAPIF `apiInvokerId`. + :type api_invoker_id: str + :param page_size: Page size. + :type page_size: int + :param page: Page index (0-based). + :type page: int + :param sort_order: Sort direction. + :type sort_order: str + + :rtype: Union[PaginatedResponseInvoker, Tuple[PaginatedResponseInvoker, int], Tuple[PaginatedResponseInvoker, int, Dict[str, str]] + """ + return helper_operations.get_invokers(uuid, api_invoker_id, page_size, page, sort_order) + + +def helper_controller_get_providers(uuid=None, api_prov_dom_id=None, page_size=None, page=None, sort_order=None): # noqa: E501 + """Retrieve providers + + Returns provider domains (CAPIF provider domains / AEF providers) with pagination. # noqa: E501 + + :param uuid: Filter by provider UUID. + :type uuid: str + :param api_prov_dom_id: Filter by provider domain ID. + :type api_prov_dom_id: str + :param page_size: Page size. + :type page_size: int + :param page: Page index (0-based). + :type page: int + :param sort_order: Sort direction. + :type sort_order: str + + :rtype: Union[PaginatedResponseProvider, Tuple[PaginatedResponseProvider, int], Tuple[PaginatedResponseProvider, int, Dict[str, str]] + """ + return helper_operations.get_providers(uuid, api_prov_dom_id, page_size, page, sort_order) + + +def helper_controller_get_security(invoker_id=None, page_size=None, page=None): # noqa: E501 + """Retrieve security associations + + Returns security credentials/bindings for a given invoker. # noqa: E501 + + :param invoker_id: Filter by invoker identifier. + :type invoker_id: str + :param page_size: Page size. + :type page_size: int + :param page: Page index (0-based). + :type page: int + + :rtype: Union[PaginatedResponseSecurity, Tuple[PaginatedResponseSecurity, int], Tuple[PaginatedResponseSecurity, int, Dict[str, str]] + """ + return helper_operations.get_security(invoker_id, page_size, page) + + +def helper_controller_get_services(service_id=None, apf_id=None, api_name=None, page_size=None, page=None, sort_order=None): # noqa: E501 + """Retrieve services + + Returns published APIs/services exposed by providers. # noqa: E501 + + :param service_id: Filter by service identifier. + :type service_id: str + :param apf_id: Filter by APF identifier. + :type apf_id: str + :param api_name: Filter by API name. + :type api_name: str + :param page_size: Page size. + :type page_size: int + :param page: Page index (0-based). + :type page: int + :param sort_order: Sort direction. + :type sort_order: str + + :rtype: Union[PaginatedResponseService, Tuple[PaginatedResponseService, int], Tuple[PaginatedResponseService, int, Dict[str, str]] + """ + return helper_operations.get_services(service_id, apf_id, api_name, page_size, page, sort_order) diff --git a/services/helper/helper_service/services/api/controllers/security_controller.py b/services/helper/helper_service/services/api/controllers/security_controller.py new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/services/helper/helper_service/services/api/controllers/security_controller.py @@ -0,0 +1 @@ + diff --git a/services/helper/helper_service/core/helper_operations.py b/services/helper/helper_service/services/api/core/helper_operations.py similarity index 59% rename from services/helper/helper_service/core/helper_operations.py rename to services/helper/helper_service/services/api/core/helper_operations.py index f0c1f6d3bcaa5243e7b6529b13114aa0b5b00c0a..02df638dc65d1b13c1df87420252d0b19389eed2 100644 --- a/services/helper/helper_service/core/helper_operations.py +++ b/services/helper/helper_service/services/api/core/helper_operations.py @@ -3,25 +3,17 @@ import os import pymongo import requests from config import Config -from db.db import MongoDatabse +from db.db import get_mongo from flask import current_app, jsonify -from utils.utils import ( - convert_dict_keys_to_snake_case, - convert_nested_values, - convert_value_to_original_type, - get_nested_value, - to_snake_case, - validate_snake_case_keys -) class HelperOperations: def __init__(self): - self.db = MongoDatabse() + self.db = get_mongo() self.mimetype = 'application/json' self.config = Config().get_config() - + def get_invokers(self, uuid, invoker_id, page, page_size, sort_order): current_app.logger.debug(f"Getting the invokers") invoker_col = self.db.get_col_by_name(self.db.invoker_col) @@ -54,7 +46,6 @@ class HelperOperations: totalPages = pages, sortOrder = sort_order), 200 - def get_providers(self, uuid, provider_id, page, page_size, sort_order): current_app.logger.debug(f"Getting the providers") provider_col = self.db.get_col_by_name(self.db.provider_col) @@ -208,141 +199,17 @@ class HelperOperations: current_app.logger.debug(f"User entities removed successfully") return jsonify(message="User entities removed successfully"), 200 - - def get_configuration(self): - """Get all current settings.""" - current_app.logger.debug("Retrieving current CAPIF configuration") - config_col = self.db.get_col_by_name(self.db.capif_configuration) - config = config_col.find_one({}, {"_id": 0}) - - if not config: - return jsonify(message="No CAPIF configuration found"), 404 - - return jsonify(config), 200 - - def update_config_param(self, param_path, new_value): + def get_ccf_id(self): """ - Updates a single parameter in the configuration. - param_path: Path of the parameter (e.g., settings.acl_policy_settings.allowed_total_invocations) + Returns the current CAPIF unique identifier (ccf_id). """ - current_app.logger.debug(f"Updating configuration parameter: {param_path} with value: {new_value}") + current_app.logger.debug("Retrieving ccf_id from capif_configuration") config_col = self.db.get_col_by_name(self.db.capif_configuration) + config = config_col.find_one({}, {"_id": 0, "ccf_id": 1}) - existing_config = config_col.find_one({}, {"_id": 0}) - current_value = get_nested_value(existing_config, param_path) - - if current_value is None: - return jsonify(message=f"The parameter '{param_path}' does not exist in the configuration"), 404 - - converted_value = convert_value_to_original_type(new_value, current_value) - - if isinstance(converted_value, tuple): - return converted_value - - update_query = {"$set": {param_path: converted_value}} - result = config_col.update_one({}, update_query) - - if result.modified_count == 0: - return jsonify(message=f"No configuration found or parameter '{param_path}' not updated"), 404 - - return jsonify(message=f"Parameter '{param_path}' updated successfully"), 200 - - - def replace_configuration(self, new_config): - """ - Replace all current settings with a new one. - """ - current_app.logger.debug("Replacing entire CAPIF configuration") - - error_response = validate_snake_case_keys(new_config) - if error_response: - return error_response - - config_col = self.db.get_col_by_name(self.db.capif_configuration) - existing_config = config_col.find_one({}, {"_id": 0}) - - if existing_config: - new_config = convert_nested_values(new_config, existing_config) - - result = config_col.replace_one({}, new_config, upsert=True) - - if result.matched_count == 0: - return jsonify(message="No existing configuration found; a new one was created"), 201 - - return jsonify(message="Configuration replaced successfully"), 200 - - - - def add_new_configuration(self, category_name, category_values): - """ - Add a new category of parameters in 'settings'. - """ - current_app.logger.debug(f"Adding new category: {category_name} with values: {category_values}") - - config_col = self.db.get_col_by_name(self.db.capif_configuration) - - category_name_snake = to_snake_case(category_name) - category_values_snake = convert_dict_keys_to_snake_case(category_values) - - update_query = {"$set": {f"settings.{category_name_snake}": category_values_snake}} - - result = config_col.update_one({}, update_query) - - if result.modified_count == 0: - return jsonify(message=f"No configuration found or category '{category_name_snake}' not added"), 404 - - return jsonify(message=f"Category '{category_name_snake}' added successfully"), 200 - - - def add_new_config_setting(self, param_path, new_value): - """Add a new parameter in 'settings'.""" - current_app.logger.debug(f"Adding new configuration setting: {param_path} with value: {new_value}") - config_col = self.db.get_col_by_name(self.db.capif_configuration) - - param_path_snake = ".".join(to_snake_case(part) for part in param_path.split(".")) - - update_query = {"$set": {f"settings.{param_path_snake}": new_value}} - result = config_col.update_one({}, update_query) - - if result.modified_count == 0: - return jsonify(message=f"No configuration found or parameter '{param_path_snake}' not updated"), 404 - - return jsonify(message=f"Parameter '{param_path_snake}' added successfully"), 200 - - - def remove_config_param(self, param_path): - """Removes a specific parameter inside 'settings'.""" - current_app.logger.debug(f"Removing configuration parameter: {param_path}") - - config_col = self.db.get_col_by_name(self.db.capif_configuration) - - param_path_snake = ".".join(to_snake_case(part) for part in param_path.split(".")) - - update_query = {"$unset": {f"settings.{param_path_snake}": ""}} - - result = config_col.update_one({}, update_query) - - if result.modified_count == 0: - return jsonify(message=f"No configuration found or parameter '{param_path_snake}' not removed"), 404 - - return jsonify(message=f"Parameter '{param_path_snake}' removed successfully"), 200 - - - def remove_config_category(self, category_name): - """Removes an entire category inside 'settings'.""" - current_app.logger.debug(f"Removing configuration category: {category_name}") - - config_col = self.db.get_col_by_name(self.db.capif_configuration) - - category_name_snake = to_snake_case(category_name) - - update_query = {"$unset": {f"settings.{category_name_snake}": ""}} - - result = config_col.update_one({}, update_query) - - if result.modified_count == 0: - return jsonify(message=f"No configuration found or category '{category_name_snake}' not removed"), 404 + if not config or "ccf_id" not in config: + return jsonify(message="ccf_id not found"), 404 - return jsonify(message=f"Category '{category_name_snake}' removed successfully"), 200 + return jsonify(ccf_id=config["ccf_id"]), 200 diff --git a/services/helper/helper_service/services/api/encoder.py b/services/helper/helper_service/services/api/encoder.py new file mode 100644 index 0000000000000000000000000000000000000000..8a8098ffd09354f26ba1211f4712937fad685df9 --- /dev/null +++ b/services/helper/helper_service/services/api/encoder.py @@ -0,0 +1,18 @@ +from api.models.base_model import Model +from connexion.apps.flask_app import FlaskJSONEncoder + + +class JSONEncoder(FlaskJSONEncoder): + include_nulls = False + + def default(self, o): + if isinstance(o, Model): + dikt = {} + for attr in o.openapi_types: + value = getattr(o, attr) + if value is None and not self.include_nulls: + continue + attr = o.attribute_map[attr] + dikt[attr] = value + return dikt + return FlaskJSONEncoder.default(self, o) diff --git a/services/helper/helper_service/services/api/models/__init__.py b/services/helper/helper_service/services/api/models/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d036df693ea41dfaa3debffffad0462c1fcd8e4a --- /dev/null +++ b/services/helper/helper_service/services/api/models/__init__.py @@ -0,0 +1,2 @@ +# flake8: noqa +# import models into model package diff --git a/services/helper/helper_service/services/api/models/aef_location.py b/services/helper/helper_service/services/api/models/aef_location.py new file mode 100644 index 0000000000000000000000000000000000000000..aa060187f8c42934caa0907c48661ec30cc2d5e0 --- /dev/null +++ b/services/helper/helper_service/services/api/models/aef_location.py @@ -0,0 +1,116 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model +from api.models.civic_address import CivicAddress # noqa: E501 +from api.models.geographic_area import GeographicArea # noqa: E501 + + +class AefLocation(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, civic_addr=None, geo_area=None, dc_id=None): # noqa: E501 + """AefLocation - a model defined in OpenAPI + + :param civic_addr: The civic_addr of this AefLocation. # noqa: E501 + :type civic_addr: CivicAddress + :param geo_area: The geo_area of this AefLocation. # noqa: E501 + :type geo_area: GeographicArea + :param dc_id: The dc_id of this AefLocation. # noqa: E501 + :type dc_id: str + """ + self.openapi_types = { + 'civic_addr': CivicAddress, + 'geo_area': GeographicArea, + 'dc_id': str + } + + self.attribute_map = { + 'civic_addr': 'civicAddr', + 'geo_area': 'geoArea', + 'dc_id': 'dcId' + } + + self._civic_addr = civic_addr + self._geo_area = geo_area + self._dc_id = dc_id + + @classmethod + def from_dict(cls, dikt) -> 'AefLocation': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The AefLocation of this AefLocation. # noqa: E501 + :rtype: AefLocation + """ + return util.deserialize_model(dikt, cls) + + @property + def civic_addr(self) -> CivicAddress: + """Gets the civic_addr of this AefLocation. + + + :return: The civic_addr of this AefLocation. + :rtype: CivicAddress + """ + return self._civic_addr + + @civic_addr.setter + def civic_addr(self, civic_addr: CivicAddress): + """Sets the civic_addr of this AefLocation. + + + :param civic_addr: The civic_addr of this AefLocation. + :type civic_addr: CivicAddress + """ + + self._civic_addr = civic_addr + + @property + def geo_area(self) -> GeographicArea: + """Gets the geo_area of this AefLocation. + + + :return: The geo_area of this AefLocation. + :rtype: GeographicArea + """ + return self._geo_area + + @geo_area.setter + def geo_area(self, geo_area: GeographicArea): + """Sets the geo_area of this AefLocation. + + + :param geo_area: The geo_area of this AefLocation. + :type geo_area: GeographicArea + """ + + self._geo_area = geo_area + + @property + def dc_id(self) -> str: + """Gets the dc_id of this AefLocation. + + Identifies the data center where the AEF providing the service API is located. # noqa: E501 + + :return: The dc_id of this AefLocation. + :rtype: str + """ + return self._dc_id + + @dc_id.setter + def dc_id(self, dc_id: str): + """Sets the dc_id of this AefLocation. + + Identifies the data center where the AEF providing the service API is located. # noqa: E501 + + :param dc_id: The dc_id of this AefLocation. + :type dc_id: str + """ + + self._dc_id = dc_id diff --git a/services/helper/helper_service/services/api/models/aef_profile.py b/services/helper/helper_service/services/api/models/aef_profile.py new file mode 100644 index 0000000000000000000000000000000000000000..e3f5945d943bf4c77a801d2150497a5f0a02fc85 --- /dev/null +++ b/services/helper/helper_service/services/api/models/aef_profile.py @@ -0,0 +1,268 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.aef_location import AefLocation # noqa: E501 +from api.models.base_model import Model +from api.models.data_format import DataFormat # noqa: E501 +from api.models.interface_description import InterfaceDescription # noqa: E501 +from api.models.protocol import Protocol # noqa: E501 +from api.models.security_method import SecurityMethod # noqa: E501 +from api.models.version import Version # noqa: E501 + + +class AefProfile(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, aef_id=None, versions=None, protocol=None, data_format=None, security_methods=None, domain_name=None, interface_descriptions=None, aef_location=None): # noqa: E501 + """AefProfile - a model defined in OpenAPI + + :param aef_id: The aef_id of this AefProfile. # noqa: E501 + :type aef_id: str + :param versions: The versions of this AefProfile. # noqa: E501 + :type versions: List[Version] + :param protocol: The protocol of this AefProfile. # noqa: E501 + :type protocol: Protocol + :param data_format: The data_format of this AefProfile. # noqa: E501 + :type data_format: DataFormat + :param security_methods: The security_methods of this AefProfile. # noqa: E501 + :type security_methods: List[SecurityMethod] + :param domain_name: The domain_name of this AefProfile. # noqa: E501 + :type domain_name: str + :param interface_descriptions: The interface_descriptions of this AefProfile. # noqa: E501 + :type interface_descriptions: List[InterfaceDescription] + :param aef_location: The aef_location of this AefProfile. # noqa: E501 + :type aef_location: AefLocation + """ + self.openapi_types = { + 'aef_id': str, + 'versions': List[Version], + 'protocol': Protocol, + 'data_format': DataFormat, + 'security_methods': List[SecurityMethod], + 'domain_name': str, + 'interface_descriptions': List[InterfaceDescription], + 'aef_location': AefLocation + } + + self.attribute_map = { + 'aef_id': 'aefId', + 'versions': 'versions', + 'protocol': 'protocol', + 'data_format': 'dataFormat', + 'security_methods': 'securityMethods', + 'domain_name': 'domainName', + 'interface_descriptions': 'interfaceDescriptions', + 'aef_location': 'aefLocation' + } + + self._aef_id = aef_id + self._versions = versions + self._protocol = protocol + self._data_format = data_format + self._security_methods = security_methods + self._domain_name = domain_name + self._interface_descriptions = interface_descriptions + self._aef_location = aef_location + + @classmethod + def from_dict(cls, dikt) -> 'AefProfile': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The AefProfile of this AefProfile. # noqa: E501 + :rtype: AefProfile + """ + return util.deserialize_model(dikt, cls) + + @property + def aef_id(self) -> str: + """Gets the aef_id of this AefProfile. + + Identifier of the API exposing function # noqa: E501 + + :return: The aef_id of this AefProfile. + :rtype: str + """ + return self._aef_id + + @aef_id.setter + def aef_id(self, aef_id: str): + """Sets the aef_id of this AefProfile. + + Identifier of the API exposing function # noqa: E501 + + :param aef_id: The aef_id of this AefProfile. + :type aef_id: str + """ + if aef_id is None: + raise ValueError("Invalid value for `aef_id`, must not be `None`") # noqa: E501 + + self._aef_id = aef_id + + @property + def versions(self) -> List[Version]: + """Gets the versions of this AefProfile. + + API version # noqa: E501 + + :return: The versions of this AefProfile. + :rtype: List[Version] + """ + return self._versions + + @versions.setter + def versions(self, versions: List[Version]): + """Sets the versions of this AefProfile. + + API version # noqa: E501 + + :param versions: The versions of this AefProfile. + :type versions: List[Version] + """ + if versions is None: + raise ValueError("Invalid value for `versions`, must not be `None`") # noqa: E501 + if versions is not None and len(versions) < 1: + raise ValueError("Invalid value for `versions`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._versions = versions + + @property + def protocol(self) -> Protocol: + """Gets the protocol of this AefProfile. + + + :return: The protocol of this AefProfile. + :rtype: Protocol + """ + return self._protocol + + @protocol.setter + def protocol(self, protocol: Protocol): + """Sets the protocol of this AefProfile. + + + :param protocol: The protocol of this AefProfile. + :type protocol: Protocol + """ + + self._protocol = protocol + + @property + def data_format(self) -> DataFormat: + """Gets the data_format of this AefProfile. + + + :return: The data_format of this AefProfile. + :rtype: DataFormat + """ + return self._data_format + + @data_format.setter + def data_format(self, data_format: DataFormat): + """Sets the data_format of this AefProfile. + + + :param data_format: The data_format of this AefProfile. + :type data_format: DataFormat + """ + + self._data_format = data_format + + @property + def security_methods(self) -> List[SecurityMethod]: + """Gets the security_methods of this AefProfile. + + Security methods supported by the AEF # noqa: E501 + + :return: The security_methods of this AefProfile. + :rtype: List[SecurityMethod] + """ + return self._security_methods + + @security_methods.setter + def security_methods(self, security_methods: List[SecurityMethod]): + """Sets the security_methods of this AefProfile. + + Security methods supported by the AEF # noqa: E501 + + :param security_methods: The security_methods of this AefProfile. + :type security_methods: List[SecurityMethod] + """ + if security_methods is not None and len(security_methods) < 1: + raise ValueError("Invalid value for `security_methods`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._security_methods = security_methods + + @property + def domain_name(self) -> str: + """Gets the domain_name of this AefProfile. + + Domain to which API belongs to # noqa: E501 + + :return: The domain_name of this AefProfile. + :rtype: str + """ + return self._domain_name + + @domain_name.setter + def domain_name(self, domain_name: str): + """Sets the domain_name of this AefProfile. + + Domain to which API belongs to # noqa: E501 + + :param domain_name: The domain_name of this AefProfile. + :type domain_name: str + """ + + self._domain_name = domain_name + + @property + def interface_descriptions(self) -> List[InterfaceDescription]: + """Gets the interface_descriptions of this AefProfile. + + Interface details # noqa: E501 + + :return: The interface_descriptions of this AefProfile. + :rtype: List[InterfaceDescription] + """ + return self._interface_descriptions + + @interface_descriptions.setter + def interface_descriptions(self, interface_descriptions: List[InterfaceDescription]): + """Sets the interface_descriptions of this AefProfile. + + Interface details # noqa: E501 + + :param interface_descriptions: The interface_descriptions of this AefProfile. + :type interface_descriptions: List[InterfaceDescription] + """ + if interface_descriptions is not None and len(interface_descriptions) < 1: + raise ValueError("Invalid value for `interface_descriptions`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._interface_descriptions = interface_descriptions + + @property + def aef_location(self) -> AefLocation: + """Gets the aef_location of this AefProfile. + + + :return: The aef_location of this AefProfile. + :rtype: AefLocation + """ + return self._aef_location + + @aef_location.setter + def aef_location(self, aef_location: AefLocation): + """Sets the aef_location of this AefProfile. + + + :param aef_location: The aef_location of this AefProfile. + :type aef_location: AefLocation + """ + + self._aef_location = aef_location diff --git a/services/helper/helper_service/services/api/models/api_invoker_enrolment_details.py b/services/helper/helper_service/services/api/models/api_invoker_enrolment_details.py new file mode 100644 index 0000000000000000000000000000000000000000..ee195831e1f0d77b4b2cee92ec2b0b1a2b29cddc --- /dev/null +++ b/services/helper/helper_service/services/api/models/api_invoker_enrolment_details.py @@ -0,0 +1,347 @@ +import re # noqa: E501 +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.api_list import APIList # noqa: E501 +from api.models.base_model import Model +from api.models.onboarding_information import \ + OnboardingInformation # noqa: E501 +from api.models.websock_notif_config import WebsockNotifConfig # noqa: E501 + + +class APIInvokerEnrolmentDetails(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, onboarding_date=None, username=None, uuid=None, api_invoker_id=None, onboarding_information=None, notification_destination=None, request_test_notification=None, websock_notif_config=None, api_list=None, api_invoker_information=None, supported_features=None): # noqa: E501 + """APIInvokerEnrolmentDetails - a model defined in OpenAPI + + :param onboarding_date: The onboarding_date of this APIInvokerEnrolmentDetails. # noqa: E501 + :type onboarding_date: datetime + :param username: The username of this APIInvokerEnrolmentDetails. # noqa: E501 + :type username: str + :param uuid: The uuid of this APIInvokerEnrolmentDetails. # noqa: E501 + :type uuid: str + :param api_invoker_id: The api_invoker_id of this APIInvokerEnrolmentDetails. # noqa: E501 + :type api_invoker_id: str + :param onboarding_information: The onboarding_information of this APIInvokerEnrolmentDetails. # noqa: E501 + :type onboarding_information: OnboardingInformation + :param notification_destination: The notification_destination of this APIInvokerEnrolmentDetails. # noqa: E501 + :type notification_destination: str + :param request_test_notification: The request_test_notification of this APIInvokerEnrolmentDetails. # noqa: E501 + :type request_test_notification: bool + :param websock_notif_config: The websock_notif_config of this APIInvokerEnrolmentDetails. # noqa: E501 + :type websock_notif_config: WebsockNotifConfig + :param api_list: The api_list of this APIInvokerEnrolmentDetails. # noqa: E501 + :type api_list: APIList + :param api_invoker_information: The api_invoker_information of this APIInvokerEnrolmentDetails. # noqa: E501 + :type api_invoker_information: str + :param supported_features: The supported_features of this APIInvokerEnrolmentDetails. # noqa: E501 + :type supported_features: str + """ + self.openapi_types = { + 'onboarding_date': datetime, + 'username': str, + 'uuid': str, + 'api_invoker_id': str, + 'onboarding_information': OnboardingInformation, + 'notification_destination': str, + 'request_test_notification': bool, + 'websock_notif_config': WebsockNotifConfig, + 'api_list': APIList, + 'api_invoker_information': str, + 'supported_features': str + } + + self.attribute_map = { + 'onboarding_date': 'onboarding_date', + 'username': 'username', + 'uuid': 'uuid', + 'api_invoker_id': 'apiInvokerId', + 'onboarding_information': 'onboardingInformation', + 'notification_destination': 'notificationDestination', + 'request_test_notification': 'requestTestNotification', + 'websock_notif_config': 'websockNotifConfig', + 'api_list': 'apiList', + 'api_invoker_information': 'apiInvokerInformation', + 'supported_features': 'supportedFeatures' + } + + self._onboarding_date = onboarding_date + self._username = username + self._uuid = uuid + self._api_invoker_id = api_invoker_id + self._onboarding_information = onboarding_information + self._notification_destination = notification_destination + self._request_test_notification = request_test_notification + self._websock_notif_config = websock_notif_config + self._api_list = api_list + self._api_invoker_information = api_invoker_information + self._supported_features = supported_features + + @classmethod + def from_dict(cls, dikt) -> 'APIInvokerEnrolmentDetails': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The APIInvokerEnrolmentDetails of this APIInvokerEnrolmentDetails. # noqa: E501 + :rtype: APIInvokerEnrolmentDetails + """ + return util.deserialize_model(dikt, cls) + + @property + def onboarding_date(self) -> datetime: + """Gets the onboarding_date of this APIInvokerEnrolmentDetails. + + Invoker onboarding date # noqa: E501 + + :return: The onboarding_date of this APIInvokerEnrolmentDetails. + :rtype: datetime + """ + return self._onboarding_date + + @onboarding_date.setter + def onboarding_date(self, onboarding_date: datetime): + """Sets the onboarding_date of this APIInvokerEnrolmentDetails. + + Invoker onboarding date # noqa: E501 + + :param onboarding_date: The onboarding_date of this APIInvokerEnrolmentDetails. + :type onboarding_date: datetime + """ + + self._onboarding_date = onboarding_date + + @property + def username(self) -> str: + """Gets the username of this APIInvokerEnrolmentDetails. + + User who registered the invoker # noqa: E501 + + :return: The username of this APIInvokerEnrolmentDetails. + :rtype: str + """ + return self._username + + @username.setter + def username(self, username: str): + """Sets the username of this APIInvokerEnrolmentDetails. + + User who registered the invoker # noqa: E501 + + :param username: The username of this APIInvokerEnrolmentDetails. + :type username: str + """ + + self._username = username + + @property + def uuid(self) -> str: + """Gets the uuid of this APIInvokerEnrolmentDetails. + + uuid of the user who registered the invoker # noqa: E501 + + :return: The uuid of this APIInvokerEnrolmentDetails. + :rtype: str + """ + return self._uuid + + @uuid.setter + def uuid(self, uuid: str): + """Sets the uuid of this APIInvokerEnrolmentDetails. + + uuid of the user who registered the invoker # noqa: E501 + + :param uuid: The uuid of this APIInvokerEnrolmentDetails. + :type uuid: str + """ + + self._uuid = uuid + + @property + def api_invoker_id(self) -> str: + """Gets the api_invoker_id of this APIInvokerEnrolmentDetails. + + API invoker ID assigned by the CAPIF core function to the API invoker while on-boarding the API invoker. Shall not be present in the HTTP POST request from the API invoker to the CAPIF core function, to on-board itself. Shall be present in all other HTTP requests and responses. # noqa: E501 + + :return: The api_invoker_id of this APIInvokerEnrolmentDetails. + :rtype: str + """ + return self._api_invoker_id + + @api_invoker_id.setter + def api_invoker_id(self, api_invoker_id: str): + """Sets the api_invoker_id of this APIInvokerEnrolmentDetails. + + API invoker ID assigned by the CAPIF core function to the API invoker while on-boarding the API invoker. Shall not be present in the HTTP POST request from the API invoker to the CAPIF core function, to on-board itself. Shall be present in all other HTTP requests and responses. # noqa: E501 + + :param api_invoker_id: The api_invoker_id of this APIInvokerEnrolmentDetails. + :type api_invoker_id: str + """ + + self._api_invoker_id = api_invoker_id + + @property + def onboarding_information(self) -> OnboardingInformation: + """Gets the onboarding_information of this APIInvokerEnrolmentDetails. + + + :return: The onboarding_information of this APIInvokerEnrolmentDetails. + :rtype: OnboardingInformation + """ + return self._onboarding_information + + @onboarding_information.setter + def onboarding_information(self, onboarding_information: OnboardingInformation): + """Sets the onboarding_information of this APIInvokerEnrolmentDetails. + + + :param onboarding_information: The onboarding_information of this APIInvokerEnrolmentDetails. + :type onboarding_information: OnboardingInformation + """ + if onboarding_information is None: + raise ValueError("Invalid value for `onboarding_information`, must not be `None`") # noqa: E501 + + self._onboarding_information = onboarding_information + + @property + def notification_destination(self) -> str: + """Gets the notification_destination of this APIInvokerEnrolmentDetails. + + string providing an URI formatted according to IETF RFC 3986. # noqa: E501 + + :return: The notification_destination of this APIInvokerEnrolmentDetails. + :rtype: str + """ + return self._notification_destination + + @notification_destination.setter + def notification_destination(self, notification_destination: str): + """Sets the notification_destination of this APIInvokerEnrolmentDetails. + + string providing an URI formatted according to IETF RFC 3986. # noqa: E501 + + :param notification_destination: The notification_destination of this APIInvokerEnrolmentDetails. + :type notification_destination: str + """ + if notification_destination is None: + raise ValueError("Invalid value for `notification_destination`, must not be `None`") # noqa: E501 + + self._notification_destination = notification_destination + + @property + def request_test_notification(self) -> bool: + """Gets the request_test_notification of this APIInvokerEnrolmentDetails. + + Set to true by Subscriber to request the CAPIF core function to send a test notification as defined in in clause 7.6. Set to false or omitted otherwise. # noqa: E501 + + :return: The request_test_notification of this APIInvokerEnrolmentDetails. + :rtype: bool + """ + return self._request_test_notification + + @request_test_notification.setter + def request_test_notification(self, request_test_notification: bool): + """Sets the request_test_notification of this APIInvokerEnrolmentDetails. + + Set to true by Subscriber to request the CAPIF core function to send a test notification as defined in in clause 7.6. Set to false or omitted otherwise. # noqa: E501 + + :param request_test_notification: The request_test_notification of this APIInvokerEnrolmentDetails. + :type request_test_notification: bool + """ + + self._request_test_notification = request_test_notification + + @property + def websock_notif_config(self) -> WebsockNotifConfig: + """Gets the websock_notif_config of this APIInvokerEnrolmentDetails. + + + :return: The websock_notif_config of this APIInvokerEnrolmentDetails. + :rtype: WebsockNotifConfig + """ + return self._websock_notif_config + + @websock_notif_config.setter + def websock_notif_config(self, websock_notif_config: WebsockNotifConfig): + """Sets the websock_notif_config of this APIInvokerEnrolmentDetails. + + + :param websock_notif_config: The websock_notif_config of this APIInvokerEnrolmentDetails. + :type websock_notif_config: WebsockNotifConfig + """ + + self._websock_notif_config = websock_notif_config + + @property + def api_list(self) -> APIList: + """Gets the api_list of this APIInvokerEnrolmentDetails. + + + :return: The api_list of this APIInvokerEnrolmentDetails. + :rtype: APIList + """ + return self._api_list + + @api_list.setter + def api_list(self, api_list: APIList): + """Sets the api_list of this APIInvokerEnrolmentDetails. + + + :param api_list: The api_list of this APIInvokerEnrolmentDetails. + :type api_list: APIList + """ + + self._api_list = api_list + + @property + def api_invoker_information(self) -> str: + """Gets the api_invoker_information of this APIInvokerEnrolmentDetails. + + Generic information related to the API invoker such as details of the device or the application. # noqa: E501 + + :return: The api_invoker_information of this APIInvokerEnrolmentDetails. + :rtype: str + """ + return self._api_invoker_information + + @api_invoker_information.setter + def api_invoker_information(self, api_invoker_information: str): + """Sets the api_invoker_information of this APIInvokerEnrolmentDetails. + + Generic information related to the API invoker such as details of the device or the application. # noqa: E501 + + :param api_invoker_information: The api_invoker_information of this APIInvokerEnrolmentDetails. + :type api_invoker_information: str + """ + + self._api_invoker_information = api_invoker_information + + @property + def supported_features(self) -> str: + """Gets the supported_features of this APIInvokerEnrolmentDetails. + + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. # noqa: E501 + + :return: The supported_features of this APIInvokerEnrolmentDetails. + :rtype: str + """ + return self._supported_features + + @supported_features.setter + def supported_features(self, supported_features: str): + """Sets the supported_features of this APIInvokerEnrolmentDetails. + + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. # noqa: E501 + + :param supported_features: The supported_features of this APIInvokerEnrolmentDetails. + :type supported_features: str + """ + if supported_features is not None and not re.search(r'^[A-Fa-f0-9]*$', supported_features): # noqa: E501 + raise ValueError(r"Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + + self._supported_features = supported_features diff --git a/services/helper/helper_service/services/api/models/api_list.py b/services/helper/helper_service/services/api/models/api_list.py new file mode 100644 index 0000000000000000000000000000000000000000..1b9646dd1b2ce4e9dde0c7ecce5199a12b670128 --- /dev/null +++ b/services/helper/helper_service/services/api/models/api_list.py @@ -0,0 +1,66 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model +from api.models.service_api_description import \ + ServiceAPIDescription # noqa: E501 + + +class APIList(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, service_api_descriptions=None): # noqa: E501 + """APIList - a model defined in OpenAPI + + :param service_api_descriptions: The service_api_descriptions of this APIList. # noqa: E501 + :type service_api_descriptions: List[ServiceAPIDescription] + """ + self.openapi_types = { + 'service_api_descriptions': List[ServiceAPIDescription] + } + + self.attribute_map = { + 'service_api_descriptions': 'serviceAPIDescriptions' + } + + self._service_api_descriptions = service_api_descriptions + + @classmethod + def from_dict(cls, dikt) -> 'APIList': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The APIList of this APIList. # noqa: E501 + :rtype: APIList + """ + return util.deserialize_model(dikt, cls) + + @property + def service_api_descriptions(self) -> List[ServiceAPIDescription]: + """Gets the service_api_descriptions of this APIList. + + The list of service APIs that the API Invoker is allowed to invoke. # noqa: E501 + + :return: The service_api_descriptions of this APIList. + :rtype: List[ServiceAPIDescription] + """ + return self._service_api_descriptions + + @service_api_descriptions.setter + def service_api_descriptions(self, service_api_descriptions: List[ServiceAPIDescription]): + """Sets the service_api_descriptions of this APIList. + + The list of service APIs that the API Invoker is allowed to invoke. # noqa: E501 + + :param service_api_descriptions: The service_api_descriptions of this APIList. + :type service_api_descriptions: List[ServiceAPIDescription] + """ + if service_api_descriptions is not None and len(service_api_descriptions) < 1: + raise ValueError("Invalid value for `service_api_descriptions`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._service_api_descriptions = service_api_descriptions diff --git a/services/helper/helper_service/services/api/models/api_provider_enrolment_details.py b/services/helper/helper_service/services/api/models/api_provider_enrolment_details.py new file mode 100644 index 0000000000000000000000000000000000000000..a1ed3a2d824e3bfb1ddd71292053db09e2273a77 --- /dev/null +++ b/services/helper/helper_service/services/api/models/api_provider_enrolment_details.py @@ -0,0 +1,295 @@ +import re # noqa: E501 +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.api_provider_function_details import \ + APIProviderFunctionDetails # noqa: E501 +from api.models.base_model import Model + + +class APIProviderEnrolmentDetails(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, onboarding_date=None, username=None, uuid=None, api_prov_dom_id=None, reg_sec=None, api_prov_funcs=None, api_prov_dom_info=None, supp_feat=None, fail_reason=None): # noqa: E501 + """APIProviderEnrolmentDetails - a model defined in OpenAPI + + :param onboarding_date: The onboarding_date of this APIProviderEnrolmentDetails. # noqa: E501 + :type onboarding_date: datetime + :param username: The username of this APIProviderEnrolmentDetails. # noqa: E501 + :type username: str + :param uuid: The uuid of this APIProviderEnrolmentDetails. # noqa: E501 + :type uuid: str + :param api_prov_dom_id: The api_prov_dom_id of this APIProviderEnrolmentDetails. # noqa: E501 + :type api_prov_dom_id: str + :param reg_sec: The reg_sec of this APIProviderEnrolmentDetails. # noqa: E501 + :type reg_sec: str + :param api_prov_funcs: The api_prov_funcs of this APIProviderEnrolmentDetails. # noqa: E501 + :type api_prov_funcs: List[APIProviderFunctionDetails] + :param api_prov_dom_info: The api_prov_dom_info of this APIProviderEnrolmentDetails. # noqa: E501 + :type api_prov_dom_info: str + :param supp_feat: The supp_feat of this APIProviderEnrolmentDetails. # noqa: E501 + :type supp_feat: str + :param fail_reason: The fail_reason of this APIProviderEnrolmentDetails. # noqa: E501 + :type fail_reason: str + """ + self.openapi_types = { + 'onboarding_date': datetime, + 'username': str, + 'uuid': str, + 'api_prov_dom_id': str, + 'reg_sec': str, + 'api_prov_funcs': List[APIProviderFunctionDetails], + 'api_prov_dom_info': str, + 'supp_feat': str, + 'fail_reason': str + } + + self.attribute_map = { + 'onboarding_date': 'onboarding_date', + 'username': 'username', + 'uuid': 'uuid', + 'api_prov_dom_id': 'apiProvDomId', + 'reg_sec': 'regSec', + 'api_prov_funcs': 'apiProvFuncs', + 'api_prov_dom_info': 'apiProvDomInfo', + 'supp_feat': 'suppFeat', + 'fail_reason': 'failReason' + } + + self._onboarding_date = onboarding_date + self._username = username + self._uuid = uuid + self._api_prov_dom_id = api_prov_dom_id + self._reg_sec = reg_sec + self._api_prov_funcs = api_prov_funcs + self._api_prov_dom_info = api_prov_dom_info + self._supp_feat = supp_feat + self._fail_reason = fail_reason + + @classmethod + def from_dict(cls, dikt) -> 'APIProviderEnrolmentDetails': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The APIProviderEnrolmentDetails of this APIProviderEnrolmentDetails. # noqa: E501 + :rtype: APIProviderEnrolmentDetails + """ + return util.deserialize_model(dikt, cls) + + @property + def onboarding_date(self) -> datetime: + """Gets the onboarding_date of this APIProviderEnrolmentDetails. + + Provider onboarding date # noqa: E501 + + :return: The onboarding_date of this APIProviderEnrolmentDetails. + :rtype: datetime + """ + return self._onboarding_date + + @onboarding_date.setter + def onboarding_date(self, onboarding_date: datetime): + """Sets the onboarding_date of this APIProviderEnrolmentDetails. + + Provider onboarding date # noqa: E501 + + :param onboarding_date: The onboarding_date of this APIProviderEnrolmentDetails. + :type onboarding_date: datetime + """ + + self._onboarding_date = onboarding_date + + @property + def username(self) -> str: + """Gets the username of this APIProviderEnrolmentDetails. + + User who registered the provider # noqa: E501 + + :return: The username of this APIProviderEnrolmentDetails. + :rtype: str + """ + return self._username + + @username.setter + def username(self, username: str): + """Sets the username of this APIProviderEnrolmentDetails. + + User who registered the provider # noqa: E501 + + :param username: The username of this APIProviderEnrolmentDetails. + :type username: str + """ + + self._username = username + + @property + def uuid(self) -> str: + """Gets the uuid of this APIProviderEnrolmentDetails. + + uuid of the user who registered the provider # noqa: E501 + + :return: The uuid of this APIProviderEnrolmentDetails. + :rtype: str + """ + return self._uuid + + @uuid.setter + def uuid(self, uuid: str): + """Sets the uuid of this APIProviderEnrolmentDetails. + + uuid of the user who registered the provider # noqa: E501 + + :param uuid: The uuid of this APIProviderEnrolmentDetails. + :type uuid: str + """ + + self._uuid = uuid + + @property + def api_prov_dom_id(self) -> str: + """Gets the api_prov_dom_id of this APIProviderEnrolmentDetails. + + API provider domain ID assigned by the CAPIF core function to the API management function while registering the API provider domain. Shall not be present in the HTTP POST request from the API Management function to the CAPIF core function, to on-board itself. Shall be present in all other HTTP requests and responses. # noqa: E501 + + :return: The api_prov_dom_id of this APIProviderEnrolmentDetails. + :rtype: str + """ + return self._api_prov_dom_id + + @api_prov_dom_id.setter + def api_prov_dom_id(self, api_prov_dom_id: str): + """Sets the api_prov_dom_id of this APIProviderEnrolmentDetails. + + API provider domain ID assigned by the CAPIF core function to the API management function while registering the API provider domain. Shall not be present in the HTTP POST request from the API Management function to the CAPIF core function, to on-board itself. Shall be present in all other HTTP requests and responses. # noqa: E501 + + :param api_prov_dom_id: The api_prov_dom_id of this APIProviderEnrolmentDetails. + :type api_prov_dom_id: str + """ + + self._api_prov_dom_id = api_prov_dom_id + + @property + def reg_sec(self) -> str: + """Gets the reg_sec of this APIProviderEnrolmentDetails. + + Security information necessary for the CAPIF core function to validate the registration of the API provider domain. Shall be present in HTTP POST request from API management function to CAPIF core function for API provider domain registration. # noqa: E501 + + :return: The reg_sec of this APIProviderEnrolmentDetails. + :rtype: str + """ + return self._reg_sec + + @reg_sec.setter + def reg_sec(self, reg_sec: str): + """Sets the reg_sec of this APIProviderEnrolmentDetails. + + Security information necessary for the CAPIF core function to validate the registration of the API provider domain. Shall be present in HTTP POST request from API management function to CAPIF core function for API provider domain registration. # noqa: E501 + + :param reg_sec: The reg_sec of this APIProviderEnrolmentDetails. + :type reg_sec: str + """ + if reg_sec is None: + raise ValueError("Invalid value for `reg_sec`, must not be `None`") # noqa: E501 + + self._reg_sec = reg_sec + + @property + def api_prov_funcs(self) -> List[APIProviderFunctionDetails]: + """Gets the api_prov_funcs of this APIProviderEnrolmentDetails. + + A list of individual API provider domain functions details. When included by the API management function in the HTTP request message, it lists the API provider domain functions that the API management function intends to register/update in registration or update registration procedure. When included by the CAPIF core function in the HTTP response message, it lists the API domain functions details that are registered or updated successfully. # noqa: E501 + + :return: The api_prov_funcs of this APIProviderEnrolmentDetails. + :rtype: List[APIProviderFunctionDetails] + """ + return self._api_prov_funcs + + @api_prov_funcs.setter + def api_prov_funcs(self, api_prov_funcs: List[APIProviderFunctionDetails]): + """Sets the api_prov_funcs of this APIProviderEnrolmentDetails. + + A list of individual API provider domain functions details. When included by the API management function in the HTTP request message, it lists the API provider domain functions that the API management function intends to register/update in registration or update registration procedure. When included by the CAPIF core function in the HTTP response message, it lists the API domain functions details that are registered or updated successfully. # noqa: E501 + + :param api_prov_funcs: The api_prov_funcs of this APIProviderEnrolmentDetails. + :type api_prov_funcs: List[APIProviderFunctionDetails] + """ + if api_prov_funcs is not None and len(api_prov_funcs) < 1: + raise ValueError("Invalid value for `api_prov_funcs`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._api_prov_funcs = api_prov_funcs + + @property + def api_prov_dom_info(self) -> str: + """Gets the api_prov_dom_info of this APIProviderEnrolmentDetails. + + Generic information related to the API provider domain such as details of the API provider applications. # noqa: E501 + + :return: The api_prov_dom_info of this APIProviderEnrolmentDetails. + :rtype: str + """ + return self._api_prov_dom_info + + @api_prov_dom_info.setter + def api_prov_dom_info(self, api_prov_dom_info: str): + """Sets the api_prov_dom_info of this APIProviderEnrolmentDetails. + + Generic information related to the API provider domain such as details of the API provider applications. # noqa: E501 + + :param api_prov_dom_info: The api_prov_dom_info of this APIProviderEnrolmentDetails. + :type api_prov_dom_info: str + """ + + self._api_prov_dom_info = api_prov_dom_info + + @property + def supp_feat(self) -> str: + """Gets the supp_feat of this APIProviderEnrolmentDetails. + + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. # noqa: E501 + + :return: The supp_feat of this APIProviderEnrolmentDetails. + :rtype: str + """ + return self._supp_feat + + @supp_feat.setter + def supp_feat(self, supp_feat: str): + """Sets the supp_feat of this APIProviderEnrolmentDetails. + + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. # noqa: E501 + + :param supp_feat: The supp_feat of this APIProviderEnrolmentDetails. + :type supp_feat: str + """ + if supp_feat is not None and not re.search(r'^[A-Fa-f0-9]*$', supp_feat): # noqa: E501 + raise ValueError(r"Invalid value for `supp_feat`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + + self._supp_feat = supp_feat + + @property + def fail_reason(self) -> str: + """Gets the fail_reason of this APIProviderEnrolmentDetails. + + Registration or update specific failure information of failed API provider domain function registrations.Shall be present in the HTTP response body if atleast one of the API provider domain function registration or update registration fails. # noqa: E501 + + :return: The fail_reason of this APIProviderEnrolmentDetails. + :rtype: str + """ + return self._fail_reason + + @fail_reason.setter + def fail_reason(self, fail_reason: str): + """Sets the fail_reason of this APIProviderEnrolmentDetails. + + Registration or update specific failure information of failed API provider domain function registrations.Shall be present in the HTTP response body if atleast one of the API provider domain function registration or update registration fails. # noqa: E501 + + :param fail_reason: The fail_reason of this APIProviderEnrolmentDetails. + :type fail_reason: str + """ + + self._fail_reason = fail_reason diff --git a/services/helper/helper_service/services/api/models/api_provider_func_role.py b/services/helper/helper_service/services/api/models/api_provider_func_role.py new file mode 100644 index 0000000000000000000000000000000000000000..8f1267406da764fc4a5bf7b03661098f3cca2e0f --- /dev/null +++ b/services/helper/helper_service/services/api/models/api_provider_func_role.py @@ -0,0 +1,33 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model + + +class ApiProviderFuncRole(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self): # noqa: E501 + """ApiProviderFuncRole - a model defined in OpenAPI + + """ + self.openapi_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'ApiProviderFuncRole': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The ApiProviderFuncRole of this ApiProviderFuncRole. # noqa: E501 + :rtype: ApiProviderFuncRole + """ + return util.deserialize_model(dikt, cls) diff --git a/services/helper/helper_service/services/api/models/api_provider_function_details.py b/services/helper/helper_service/services/api/models/api_provider_function_details.py new file mode 100644 index 0000000000000000000000000000000000000000..2a0da6a6fa3398966996185e618120e37747f33f --- /dev/null +++ b/services/helper/helper_service/services/api/models/api_provider_function_details.py @@ -0,0 +1,149 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.api_provider_func_role import ApiProviderFuncRole # noqa: E501 +from api.models.base_model import Model +from api.models.registration_information import \ + RegistrationInformation # noqa: E501 + + +class APIProviderFunctionDetails(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, api_prov_func_id=None, reg_info=None, api_prov_func_role=None, api_prov_func_info=None): # noqa: E501 + """APIProviderFunctionDetails - a model defined in OpenAPI + + :param api_prov_func_id: The api_prov_func_id of this APIProviderFunctionDetails. # noqa: E501 + :type api_prov_func_id: str + :param reg_info: The reg_info of this APIProviderFunctionDetails. # noqa: E501 + :type reg_info: RegistrationInformation + :param api_prov_func_role: The api_prov_func_role of this APIProviderFunctionDetails. # noqa: E501 + :type api_prov_func_role: ApiProviderFuncRole + :param api_prov_func_info: The api_prov_func_info of this APIProviderFunctionDetails. # noqa: E501 + :type api_prov_func_info: str + """ + self.openapi_types = { + 'api_prov_func_id': str, + 'reg_info': RegistrationInformation, + 'api_prov_func_role': ApiProviderFuncRole, + 'api_prov_func_info': str + } + + self.attribute_map = { + 'api_prov_func_id': 'apiProvFuncId', + 'reg_info': 'regInfo', + 'api_prov_func_role': 'apiProvFuncRole', + 'api_prov_func_info': 'apiProvFuncInfo' + } + + self._api_prov_func_id = api_prov_func_id + self._reg_info = reg_info + self._api_prov_func_role = api_prov_func_role + self._api_prov_func_info = api_prov_func_info + + @classmethod + def from_dict(cls, dikt) -> 'APIProviderFunctionDetails': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The APIProviderFunctionDetails of this APIProviderFunctionDetails. # noqa: E501 + :rtype: APIProviderFunctionDetails + """ + return util.deserialize_model(dikt, cls) + + @property + def api_prov_func_id(self) -> str: + """Gets the api_prov_func_id of this APIProviderFunctionDetails. + + API provider domain functionID assigned by the CAPIF core function to the API provider domain function while registering/updating the API provider domain. Shall not be present in the HTTP POST request from the API management function to the CAPIF core function, to register itself. Shall be present in all other HTTP requests and responses. # noqa: E501 + + :return: The api_prov_func_id of this APIProviderFunctionDetails. + :rtype: str + """ + return self._api_prov_func_id + + @api_prov_func_id.setter + def api_prov_func_id(self, api_prov_func_id: str): + """Sets the api_prov_func_id of this APIProviderFunctionDetails. + + API provider domain functionID assigned by the CAPIF core function to the API provider domain function while registering/updating the API provider domain. Shall not be present in the HTTP POST request from the API management function to the CAPIF core function, to register itself. Shall be present in all other HTTP requests and responses. # noqa: E501 + + :param api_prov_func_id: The api_prov_func_id of this APIProviderFunctionDetails. + :type api_prov_func_id: str + """ + + self._api_prov_func_id = api_prov_func_id + + @property + def reg_info(self) -> RegistrationInformation: + """Gets the reg_info of this APIProviderFunctionDetails. + + + :return: The reg_info of this APIProviderFunctionDetails. + :rtype: RegistrationInformation + """ + return self._reg_info + + @reg_info.setter + def reg_info(self, reg_info: RegistrationInformation): + """Sets the reg_info of this APIProviderFunctionDetails. + + + :param reg_info: The reg_info of this APIProviderFunctionDetails. + :type reg_info: RegistrationInformation + """ + if reg_info is None: + raise ValueError("Invalid value for `reg_info`, must not be `None`") # noqa: E501 + + self._reg_info = reg_info + + @property + def api_prov_func_role(self) -> ApiProviderFuncRole: + """Gets the api_prov_func_role of this APIProviderFunctionDetails. + + + :return: The api_prov_func_role of this APIProviderFunctionDetails. + :rtype: ApiProviderFuncRole + """ + return self._api_prov_func_role + + @api_prov_func_role.setter + def api_prov_func_role(self, api_prov_func_role: ApiProviderFuncRole): + """Sets the api_prov_func_role of this APIProviderFunctionDetails. + + + :param api_prov_func_role: The api_prov_func_role of this APIProviderFunctionDetails. + :type api_prov_func_role: ApiProviderFuncRole + """ + if api_prov_func_role is None: + raise ValueError("Invalid value for `api_prov_func_role`, must not be `None`") # noqa: E501 + + self._api_prov_func_role = api_prov_func_role + + @property + def api_prov_func_info(self) -> str: + """Gets the api_prov_func_info of this APIProviderFunctionDetails. + + Generic information related to the API provider domain function such as details of the API provider applications. # noqa: E501 + + :return: The api_prov_func_info of this APIProviderFunctionDetails. + :rtype: str + """ + return self._api_prov_func_info + + @api_prov_func_info.setter + def api_prov_func_info(self, api_prov_func_info: str): + """Sets the api_prov_func_info of this APIProviderFunctionDetails. + + Generic information related to the API provider domain function such as details of the API provider applications. # noqa: E501 + + :param api_prov_func_info: The api_prov_func_info of this APIProviderFunctionDetails. + :type api_prov_func_info: str + """ + + self._api_prov_func_info = api_prov_func_info diff --git a/services/helper/helper_service/services/api/models/base_model.py b/services/helper/helper_service/services/api/models/base_model.py new file mode 100644 index 0000000000000000000000000000000000000000..2c5a2678d8b09ddb87cac2852063382ab606da82 --- /dev/null +++ b/services/helper/helper_service/services/api/models/base_model.py @@ -0,0 +1,67 @@ +import pprint +import typing + +from api import util + +T = typing.TypeVar('T') + + +class Model: + # openapiTypes: The key is attribute name and the + # value is attribute type. + openapi_types: typing.Dict[str, type] = {} + + # attributeMap: The key is attribute name and the + # value is json key in definition. + attribute_map: typing.Dict[str, str] = {} + + @classmethod + def from_dict(cls: typing.Type[T], dikt) -> T: + """Returns the dict as a model""" + return util.deserialize_model(dikt, cls) + + def to_dict(self): + """Returns the model properties as a dict + + :rtype: dict + """ + result = {} + + for attr in self.openapi_types: + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model + + :rtype: str + """ + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/services/helper/helper_service/services/api/models/capif_event.py b/services/helper/helper_service/services/api/models/capif_event.py new file mode 100644 index 0000000000000000000000000000000000000000..c67ba8cd96255e7133e676d50c301c659583400a --- /dev/null +++ b/services/helper/helper_service/services/api/models/capif_event.py @@ -0,0 +1,33 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model + + +class CAPIFEvent(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self): # noqa: E501 + """CAPIFEvent - a model defined in OpenAPI + + """ + self.openapi_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'CAPIFEvent': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The CAPIFEvent of this CAPIFEvent. # noqa: E501 + :rtype: CAPIFEvent + """ + return util.deserialize_model(dikt, cls) diff --git a/services/helper/helper_service/services/api/models/capif_event_filter.py b/services/helper/helper_service/services/api/models/capif_event_filter.py new file mode 100644 index 0000000000000000000000000000000000000000..7f14aca2f94c956531a341fdbc09c384c682e2a8 --- /dev/null +++ b/services/helper/helper_service/services/api/models/capif_event_filter.py @@ -0,0 +1,124 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model + + +class CAPIFEventFilter(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, api_ids=None, api_invoker_ids=None, aef_ids=None): # noqa: E501 + """CAPIFEventFilter - a model defined in OpenAPI + + :param api_ids: The api_ids of this CAPIFEventFilter. # noqa: E501 + :type api_ids: List[str] + :param api_invoker_ids: The api_invoker_ids of this CAPIFEventFilter. # noqa: E501 + :type api_invoker_ids: List[str] + :param aef_ids: The aef_ids of this CAPIFEventFilter. # noqa: E501 + :type aef_ids: List[str] + """ + self.openapi_types = { + 'api_ids': List[str], + 'api_invoker_ids': List[str], + 'aef_ids': List[str] + } + + self.attribute_map = { + 'api_ids': 'apiIds', + 'api_invoker_ids': 'apiInvokerIds', + 'aef_ids': 'aefIds' + } + + self._api_ids = api_ids + self._api_invoker_ids = api_invoker_ids + self._aef_ids = aef_ids + + @classmethod + def from_dict(cls, dikt) -> 'CAPIFEventFilter': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The CAPIFEventFilter of this CAPIFEventFilter. # noqa: E501 + :rtype: CAPIFEventFilter + """ + return util.deserialize_model(dikt, cls) + + @property + def api_ids(self) -> List[str]: + """Gets the api_ids of this CAPIFEventFilter. + + Identifier of the service API # noqa: E501 + + :return: The api_ids of this CAPIFEventFilter. + :rtype: List[str] + """ + return self._api_ids + + @api_ids.setter + def api_ids(self, api_ids: List[str]): + """Sets the api_ids of this CAPIFEventFilter. + + Identifier of the service API # noqa: E501 + + :param api_ids: The api_ids of this CAPIFEventFilter. + :type api_ids: List[str] + """ + if api_ids is not None and len(api_ids) < 1: + raise ValueError("Invalid value for `api_ids`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._api_ids = api_ids + + @property + def api_invoker_ids(self) -> List[str]: + """Gets the api_invoker_ids of this CAPIFEventFilter. + + Identity of the API invoker # noqa: E501 + + :return: The api_invoker_ids of this CAPIFEventFilter. + :rtype: List[str] + """ + return self._api_invoker_ids + + @api_invoker_ids.setter + def api_invoker_ids(self, api_invoker_ids: List[str]): + """Sets the api_invoker_ids of this CAPIFEventFilter. + + Identity of the API invoker # noqa: E501 + + :param api_invoker_ids: The api_invoker_ids of this CAPIFEventFilter. + :type api_invoker_ids: List[str] + """ + if api_invoker_ids is not None and len(api_invoker_ids) < 1: + raise ValueError("Invalid value for `api_invoker_ids`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._api_invoker_ids = api_invoker_ids + + @property + def aef_ids(self) -> List[str]: + """Gets the aef_ids of this CAPIFEventFilter. + + Identifier of the API exposing function # noqa: E501 + + :return: The aef_ids of this CAPIFEventFilter. + :rtype: List[str] + """ + return self._aef_ids + + @aef_ids.setter + def aef_ids(self, aef_ids: List[str]): + """Sets the aef_ids of this CAPIFEventFilter. + + Identifier of the API exposing function # noqa: E501 + + :param aef_ids: The aef_ids of this CAPIFEventFilter. + :type aef_ids: List[str] + """ + if aef_ids is not None and len(aef_ids) < 1: + raise ValueError("Invalid value for `aef_ids`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._aef_ids = aef_ids diff --git a/services/helper/helper_service/services/api/models/civic_address.py b/services/helper/helper_service/services/api/models/civic_address.py new file mode 100644 index 0000000000000000000000000000000000000000..26caca34b07b037b31e11a8b4a44628321685b5e --- /dev/null +++ b/services/helper/helper_service/services/api/models/civic_address.py @@ -0,0 +1,918 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model + + +class CivicAddress(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, country=None, a1=None, a2=None, a3=None, a4=None, a5=None, a6=None, prd=None, pod=None, sts=None, hno=None, hns=None, lmk=None, loc=None, nam=None, pc=None, bld=None, unit=None, flr=None, room=None, plc=None, pcn=None, pobox=None, addcode=None, seat=None, rd=None, rdsec=None, rdbr=None, rdsubbr=None, prm=None, pom=None, usage_rules=None, method=None, provided_by=None): # noqa: E501 + """CivicAddress - a model defined in OpenAPI + + :param country: The country of this CivicAddress. # noqa: E501 + :type country: str + :param a1: The a1 of this CivicAddress. # noqa: E501 + :type a1: str + :param a2: The a2 of this CivicAddress. # noqa: E501 + :type a2: str + :param a3: The a3 of this CivicAddress. # noqa: E501 + :type a3: str + :param a4: The a4 of this CivicAddress. # noqa: E501 + :type a4: str + :param a5: The a5 of this CivicAddress. # noqa: E501 + :type a5: str + :param a6: The a6 of this CivicAddress. # noqa: E501 + :type a6: str + :param prd: The prd of this CivicAddress. # noqa: E501 + :type prd: str + :param pod: The pod of this CivicAddress. # noqa: E501 + :type pod: str + :param sts: The sts of this CivicAddress. # noqa: E501 + :type sts: str + :param hno: The hno of this CivicAddress. # noqa: E501 + :type hno: str + :param hns: The hns of this CivicAddress. # noqa: E501 + :type hns: str + :param lmk: The lmk of this CivicAddress. # noqa: E501 + :type lmk: str + :param loc: The loc of this CivicAddress. # noqa: E501 + :type loc: str + :param nam: The nam of this CivicAddress. # noqa: E501 + :type nam: str + :param pc: The pc of this CivicAddress. # noqa: E501 + :type pc: str + :param bld: The bld of this CivicAddress. # noqa: E501 + :type bld: str + :param unit: The unit of this CivicAddress. # noqa: E501 + :type unit: str + :param flr: The flr of this CivicAddress. # noqa: E501 + :type flr: str + :param room: The room of this CivicAddress. # noqa: E501 + :type room: str + :param plc: The plc of this CivicAddress. # noqa: E501 + :type plc: str + :param pcn: The pcn of this CivicAddress. # noqa: E501 + :type pcn: str + :param pobox: The pobox of this CivicAddress. # noqa: E501 + :type pobox: str + :param addcode: The addcode of this CivicAddress. # noqa: E501 + :type addcode: str + :param seat: The seat of this CivicAddress. # noqa: E501 + :type seat: str + :param rd: The rd of this CivicAddress. # noqa: E501 + :type rd: str + :param rdsec: The rdsec of this CivicAddress. # noqa: E501 + :type rdsec: str + :param rdbr: The rdbr of this CivicAddress. # noqa: E501 + :type rdbr: str + :param rdsubbr: The rdsubbr of this CivicAddress. # noqa: E501 + :type rdsubbr: str + :param prm: The prm of this CivicAddress. # noqa: E501 + :type prm: str + :param pom: The pom of this CivicAddress. # noqa: E501 + :type pom: str + :param usage_rules: The usage_rules of this CivicAddress. # noqa: E501 + :type usage_rules: str + :param method: The method of this CivicAddress. # noqa: E501 + :type method: str + :param provided_by: The provided_by of this CivicAddress. # noqa: E501 + :type provided_by: str + """ + self.openapi_types = { + 'country': str, + 'a1': str, + 'a2': str, + 'a3': str, + 'a4': str, + 'a5': str, + 'a6': str, + 'prd': str, + 'pod': str, + 'sts': str, + 'hno': str, + 'hns': str, + 'lmk': str, + 'loc': str, + 'nam': str, + 'pc': str, + 'bld': str, + 'unit': str, + 'flr': str, + 'room': str, + 'plc': str, + 'pcn': str, + 'pobox': str, + 'addcode': str, + 'seat': str, + 'rd': str, + 'rdsec': str, + 'rdbr': str, + 'rdsubbr': str, + 'prm': str, + 'pom': str, + 'usage_rules': str, + 'method': str, + 'provided_by': str + } + + self.attribute_map = { + 'country': 'country', + 'a1': 'A1', + 'a2': 'A2', + 'a3': 'A3', + 'a4': 'A4', + 'a5': 'A5', + 'a6': 'A6', + 'prd': 'PRD', + 'pod': 'POD', + 'sts': 'STS', + 'hno': 'HNO', + 'hns': 'HNS', + 'lmk': 'LMK', + 'loc': 'LOC', + 'nam': 'NAM', + 'pc': 'PC', + 'bld': 'BLD', + 'unit': 'UNIT', + 'flr': 'FLR', + 'room': 'ROOM', + 'plc': 'PLC', + 'pcn': 'PCN', + 'pobox': 'POBOX', + 'addcode': 'ADDCODE', + 'seat': 'SEAT', + 'rd': 'RD', + 'rdsec': 'RDSEC', + 'rdbr': 'RDBR', + 'rdsubbr': 'RDSUBBR', + 'prm': 'PRM', + 'pom': 'POM', + 'usage_rules': 'usageRules', + 'method': 'method', + 'provided_by': 'providedBy' + } + + self._country = country + self._a1 = a1 + self._a2 = a2 + self._a3 = a3 + self._a4 = a4 + self._a5 = a5 + self._a6 = a6 + self._prd = prd + self._pod = pod + self._sts = sts + self._hno = hno + self._hns = hns + self._lmk = lmk + self._loc = loc + self._nam = nam + self._pc = pc + self._bld = bld + self._unit = unit + self._flr = flr + self._room = room + self._plc = plc + self._pcn = pcn + self._pobox = pobox + self._addcode = addcode + self._seat = seat + self._rd = rd + self._rdsec = rdsec + self._rdbr = rdbr + self._rdsubbr = rdsubbr + self._prm = prm + self._pom = pom + self._usage_rules = usage_rules + self._method = method + self._provided_by = provided_by + + @classmethod + def from_dict(cls, dikt) -> 'CivicAddress': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The CivicAddress of this CivicAddress. # noqa: E501 + :rtype: CivicAddress + """ + return util.deserialize_model(dikt, cls) + + @property + def country(self) -> str: + """Gets the country of this CivicAddress. + + + :return: The country of this CivicAddress. + :rtype: str + """ + return self._country + + @country.setter + def country(self, country: str): + """Sets the country of this CivicAddress. + + + :param country: The country of this CivicAddress. + :type country: str + """ + + self._country = country + + @property + def a1(self) -> str: + """Gets the a1 of this CivicAddress. + + + :return: The a1 of this CivicAddress. + :rtype: str + """ + return self._a1 + + @a1.setter + def a1(self, a1: str): + """Sets the a1 of this CivicAddress. + + + :param a1: The a1 of this CivicAddress. + :type a1: str + """ + + self._a1 = a1 + + @property + def a2(self) -> str: + """Gets the a2 of this CivicAddress. + + + :return: The a2 of this CivicAddress. + :rtype: str + """ + return self._a2 + + @a2.setter + def a2(self, a2: str): + """Sets the a2 of this CivicAddress. + + + :param a2: The a2 of this CivicAddress. + :type a2: str + """ + + self._a2 = a2 + + @property + def a3(self) -> str: + """Gets the a3 of this CivicAddress. + + + :return: The a3 of this CivicAddress. + :rtype: str + """ + return self._a3 + + @a3.setter + def a3(self, a3: str): + """Sets the a3 of this CivicAddress. + + + :param a3: The a3 of this CivicAddress. + :type a3: str + """ + + self._a3 = a3 + + @property + def a4(self) -> str: + """Gets the a4 of this CivicAddress. + + + :return: The a4 of this CivicAddress. + :rtype: str + """ + return self._a4 + + @a4.setter + def a4(self, a4: str): + """Sets the a4 of this CivicAddress. + + + :param a4: The a4 of this CivicAddress. + :type a4: str + """ + + self._a4 = a4 + + @property + def a5(self) -> str: + """Gets the a5 of this CivicAddress. + + + :return: The a5 of this CivicAddress. + :rtype: str + """ + return self._a5 + + @a5.setter + def a5(self, a5: str): + """Sets the a5 of this CivicAddress. + + + :param a5: The a5 of this CivicAddress. + :type a5: str + """ + + self._a5 = a5 + + @property + def a6(self) -> str: + """Gets the a6 of this CivicAddress. + + + :return: The a6 of this CivicAddress. + :rtype: str + """ + return self._a6 + + @a6.setter + def a6(self, a6: str): + """Sets the a6 of this CivicAddress. + + + :param a6: The a6 of this CivicAddress. + :type a6: str + """ + + self._a6 = a6 + + @property + def prd(self) -> str: + """Gets the prd of this CivicAddress. + + + :return: The prd of this CivicAddress. + :rtype: str + """ + return self._prd + + @prd.setter + def prd(self, prd: str): + """Sets the prd of this CivicAddress. + + + :param prd: The prd of this CivicAddress. + :type prd: str + """ + + self._prd = prd + + @property + def pod(self) -> str: + """Gets the pod of this CivicAddress. + + + :return: The pod of this CivicAddress. + :rtype: str + """ + return self._pod + + @pod.setter + def pod(self, pod: str): + """Sets the pod of this CivicAddress. + + + :param pod: The pod of this CivicAddress. + :type pod: str + """ + + self._pod = pod + + @property + def sts(self) -> str: + """Gets the sts of this CivicAddress. + + + :return: The sts of this CivicAddress. + :rtype: str + """ + return self._sts + + @sts.setter + def sts(self, sts: str): + """Sets the sts of this CivicAddress. + + + :param sts: The sts of this CivicAddress. + :type sts: str + """ + + self._sts = sts + + @property + def hno(self) -> str: + """Gets the hno of this CivicAddress. + + + :return: The hno of this CivicAddress. + :rtype: str + """ + return self._hno + + @hno.setter + def hno(self, hno: str): + """Sets the hno of this CivicAddress. + + + :param hno: The hno of this CivicAddress. + :type hno: str + """ + + self._hno = hno + + @property + def hns(self) -> str: + """Gets the hns of this CivicAddress. + + + :return: The hns of this CivicAddress. + :rtype: str + """ + return self._hns + + @hns.setter + def hns(self, hns: str): + """Sets the hns of this CivicAddress. + + + :param hns: The hns of this CivicAddress. + :type hns: str + """ + + self._hns = hns + + @property + def lmk(self) -> str: + """Gets the lmk of this CivicAddress. + + + :return: The lmk of this CivicAddress. + :rtype: str + """ + return self._lmk + + @lmk.setter + def lmk(self, lmk: str): + """Sets the lmk of this CivicAddress. + + + :param lmk: The lmk of this CivicAddress. + :type lmk: str + """ + + self._lmk = lmk + + @property + def loc(self) -> str: + """Gets the loc of this CivicAddress. + + + :return: The loc of this CivicAddress. + :rtype: str + """ + return self._loc + + @loc.setter + def loc(self, loc: str): + """Sets the loc of this CivicAddress. + + + :param loc: The loc of this CivicAddress. + :type loc: str + """ + + self._loc = loc + + @property + def nam(self) -> str: + """Gets the nam of this CivicAddress. + + + :return: The nam of this CivicAddress. + :rtype: str + """ + return self._nam + + @nam.setter + def nam(self, nam: str): + """Sets the nam of this CivicAddress. + + + :param nam: The nam of this CivicAddress. + :type nam: str + """ + + self._nam = nam + + @property + def pc(self) -> str: + """Gets the pc of this CivicAddress. + + + :return: The pc of this CivicAddress. + :rtype: str + """ + return self._pc + + @pc.setter + def pc(self, pc: str): + """Sets the pc of this CivicAddress. + + + :param pc: The pc of this CivicAddress. + :type pc: str + """ + + self._pc = pc + + @property + def bld(self) -> str: + """Gets the bld of this CivicAddress. + + + :return: The bld of this CivicAddress. + :rtype: str + """ + return self._bld + + @bld.setter + def bld(self, bld: str): + """Sets the bld of this CivicAddress. + + + :param bld: The bld of this CivicAddress. + :type bld: str + """ + + self._bld = bld + + @property + def unit(self) -> str: + """Gets the unit of this CivicAddress. + + + :return: The unit of this CivicAddress. + :rtype: str + """ + return self._unit + + @unit.setter + def unit(self, unit: str): + """Sets the unit of this CivicAddress. + + + :param unit: The unit of this CivicAddress. + :type unit: str + """ + + self._unit = unit + + @property + def flr(self) -> str: + """Gets the flr of this CivicAddress. + + + :return: The flr of this CivicAddress. + :rtype: str + """ + return self._flr + + @flr.setter + def flr(self, flr: str): + """Sets the flr of this CivicAddress. + + + :param flr: The flr of this CivicAddress. + :type flr: str + """ + + self._flr = flr + + @property + def room(self) -> str: + """Gets the room of this CivicAddress. + + + :return: The room of this CivicAddress. + :rtype: str + """ + return self._room + + @room.setter + def room(self, room: str): + """Sets the room of this CivicAddress. + + + :param room: The room of this CivicAddress. + :type room: str + """ + + self._room = room + + @property + def plc(self) -> str: + """Gets the plc of this CivicAddress. + + + :return: The plc of this CivicAddress. + :rtype: str + """ + return self._plc + + @plc.setter + def plc(self, plc: str): + """Sets the plc of this CivicAddress. + + + :param plc: The plc of this CivicAddress. + :type plc: str + """ + + self._plc = plc + + @property + def pcn(self) -> str: + """Gets the pcn of this CivicAddress. + + + :return: The pcn of this CivicAddress. + :rtype: str + """ + return self._pcn + + @pcn.setter + def pcn(self, pcn: str): + """Sets the pcn of this CivicAddress. + + + :param pcn: The pcn of this CivicAddress. + :type pcn: str + """ + + self._pcn = pcn + + @property + def pobox(self) -> str: + """Gets the pobox of this CivicAddress. + + + :return: The pobox of this CivicAddress. + :rtype: str + """ + return self._pobox + + @pobox.setter + def pobox(self, pobox: str): + """Sets the pobox of this CivicAddress. + + + :param pobox: The pobox of this CivicAddress. + :type pobox: str + """ + + self._pobox = pobox + + @property + def addcode(self) -> str: + """Gets the addcode of this CivicAddress. + + + :return: The addcode of this CivicAddress. + :rtype: str + """ + return self._addcode + + @addcode.setter + def addcode(self, addcode: str): + """Sets the addcode of this CivicAddress. + + + :param addcode: The addcode of this CivicAddress. + :type addcode: str + """ + + self._addcode = addcode + + @property + def seat(self) -> str: + """Gets the seat of this CivicAddress. + + + :return: The seat of this CivicAddress. + :rtype: str + """ + return self._seat + + @seat.setter + def seat(self, seat: str): + """Sets the seat of this CivicAddress. + + + :param seat: The seat of this CivicAddress. + :type seat: str + """ + + self._seat = seat + + @property + def rd(self) -> str: + """Gets the rd of this CivicAddress. + + + :return: The rd of this CivicAddress. + :rtype: str + """ + return self._rd + + @rd.setter + def rd(self, rd: str): + """Sets the rd of this CivicAddress. + + + :param rd: The rd of this CivicAddress. + :type rd: str + """ + + self._rd = rd + + @property + def rdsec(self) -> str: + """Gets the rdsec of this CivicAddress. + + + :return: The rdsec of this CivicAddress. + :rtype: str + """ + return self._rdsec + + @rdsec.setter + def rdsec(self, rdsec: str): + """Sets the rdsec of this CivicAddress. + + + :param rdsec: The rdsec of this CivicAddress. + :type rdsec: str + """ + + self._rdsec = rdsec + + @property + def rdbr(self) -> str: + """Gets the rdbr of this CivicAddress. + + + :return: The rdbr of this CivicAddress. + :rtype: str + """ + return self._rdbr + + @rdbr.setter + def rdbr(self, rdbr: str): + """Sets the rdbr of this CivicAddress. + + + :param rdbr: The rdbr of this CivicAddress. + :type rdbr: str + """ + + self._rdbr = rdbr + + @property + def rdsubbr(self) -> str: + """Gets the rdsubbr of this CivicAddress. + + + :return: The rdsubbr of this CivicAddress. + :rtype: str + """ + return self._rdsubbr + + @rdsubbr.setter + def rdsubbr(self, rdsubbr: str): + """Sets the rdsubbr of this CivicAddress. + + + :param rdsubbr: The rdsubbr of this CivicAddress. + :type rdsubbr: str + """ + + self._rdsubbr = rdsubbr + + @property + def prm(self) -> str: + """Gets the prm of this CivicAddress. + + + :return: The prm of this CivicAddress. + :rtype: str + """ + return self._prm + + @prm.setter + def prm(self, prm: str): + """Sets the prm of this CivicAddress. + + + :param prm: The prm of this CivicAddress. + :type prm: str + """ + + self._prm = prm + + @property + def pom(self) -> str: + """Gets the pom of this CivicAddress. + + + :return: The pom of this CivicAddress. + :rtype: str + """ + return self._pom + + @pom.setter + def pom(self, pom: str): + """Sets the pom of this CivicAddress. + + + :param pom: The pom of this CivicAddress. + :type pom: str + """ + + self._pom = pom + + @property + def usage_rules(self) -> str: + """Gets the usage_rules of this CivicAddress. + + + :return: The usage_rules of this CivicAddress. + :rtype: str + """ + return self._usage_rules + + @usage_rules.setter + def usage_rules(self, usage_rules: str): + """Sets the usage_rules of this CivicAddress. + + + :param usage_rules: The usage_rules of this CivicAddress. + :type usage_rules: str + """ + + self._usage_rules = usage_rules + + @property + def method(self) -> str: + """Gets the method of this CivicAddress. + + + :return: The method of this CivicAddress. + :rtype: str + """ + return self._method + + @method.setter + def method(self, method: str): + """Sets the method of this CivicAddress. + + + :param method: The method of this CivicAddress. + :type method: str + """ + + self._method = method + + @property + def provided_by(self) -> str: + """Gets the provided_by of this CivicAddress. + + + :return: The provided_by of this CivicAddress. + :rtype: str + """ + return self._provided_by + + @provided_by.setter + def provided_by(self, provided_by: str): + """Sets the provided_by of this CivicAddress. + + + :param provided_by: The provided_by of this CivicAddress. + :type provided_by: str + """ + + self._provided_by = provided_by diff --git a/services/helper/helper_service/services/api/models/communication_type.py b/services/helper/helper_service/services/api/models/communication_type.py new file mode 100644 index 0000000000000000000000000000000000000000..984740fc622a59258f76911a29bc78151b92432f --- /dev/null +++ b/services/helper/helper_service/services/api/models/communication_type.py @@ -0,0 +1,33 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model + + +class CommunicationType(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self): # noqa: E501 + """CommunicationType - a model defined in OpenAPI + + """ + self.openapi_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'CommunicationType': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The CommunicationType of this CommunicationType. # noqa: E501 + :rtype: CommunicationType + """ + return util.deserialize_model(dikt, cls) diff --git a/services/helper/helper_service/services/api/models/custom_operation.py b/services/helper/helper_service/services/api/models/custom_operation.py new file mode 100644 index 0000000000000000000000000000000000000000..478334c40755deb515262ef5e34f54dfde3cc7d7 --- /dev/null +++ b/services/helper/helper_service/services/api/models/custom_operation.py @@ -0,0 +1,152 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model +from api.models.communication_type import CommunicationType # noqa: E501 +from api.models.operation import Operation # noqa: E501 + + +class CustomOperation(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, comm_type=None, cust_op_name=None, operations=None, description=None): # noqa: E501 + """CustomOperation - a model defined in OpenAPI + + :param comm_type: The comm_type of this CustomOperation. # noqa: E501 + :type comm_type: CommunicationType + :param cust_op_name: The cust_op_name of this CustomOperation. # noqa: E501 + :type cust_op_name: str + :param operations: The operations of this CustomOperation. # noqa: E501 + :type operations: List[Operation] + :param description: The description of this CustomOperation. # noqa: E501 + :type description: str + """ + self.openapi_types = { + 'comm_type': CommunicationType, + 'cust_op_name': str, + 'operations': List[Operation], + 'description': str + } + + self.attribute_map = { + 'comm_type': 'commType', + 'cust_op_name': 'custOpName', + 'operations': 'operations', + 'description': 'description' + } + + self._comm_type = comm_type + self._cust_op_name = cust_op_name + self._operations = operations + self._description = description + + @classmethod + def from_dict(cls, dikt) -> 'CustomOperation': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The CustomOperation of this CustomOperation. # noqa: E501 + :rtype: CustomOperation + """ + return util.deserialize_model(dikt, cls) + + @property + def comm_type(self) -> CommunicationType: + """Gets the comm_type of this CustomOperation. + + + :return: The comm_type of this CustomOperation. + :rtype: CommunicationType + """ + return self._comm_type + + @comm_type.setter + def comm_type(self, comm_type: CommunicationType): + """Sets the comm_type of this CustomOperation. + + + :param comm_type: The comm_type of this CustomOperation. + :type comm_type: CommunicationType + """ + if comm_type is None: + raise ValueError("Invalid value for `comm_type`, must not be `None`") # noqa: E501 + + self._comm_type = comm_type + + @property + def cust_op_name(self) -> str: + """Gets the cust_op_name of this CustomOperation. + + it is set as {custOpName} part of the URI structure for a custom operation without resource association as defined in clause 5.2.4 of 3GPP TS 29.122. # noqa: E501 + + :return: The cust_op_name of this CustomOperation. + :rtype: str + """ + return self._cust_op_name + + @cust_op_name.setter + def cust_op_name(self, cust_op_name: str): + """Sets the cust_op_name of this CustomOperation. + + it is set as {custOpName} part of the URI structure for a custom operation without resource association as defined in clause 5.2.4 of 3GPP TS 29.122. # noqa: E501 + + :param cust_op_name: The cust_op_name of this CustomOperation. + :type cust_op_name: str + """ + if cust_op_name is None: + raise ValueError("Invalid value for `cust_op_name`, must not be `None`") # noqa: E501 + + self._cust_op_name = cust_op_name + + @property + def operations(self) -> List[Operation]: + """Gets the operations of this CustomOperation. + + Supported HTTP methods for the API resource. Only applicable when the protocol in AefProfile indicates HTTP. # noqa: E501 + + :return: The operations of this CustomOperation. + :rtype: List[Operation] + """ + return self._operations + + @operations.setter + def operations(self, operations: List[Operation]): + """Sets the operations of this CustomOperation. + + Supported HTTP methods for the API resource. Only applicable when the protocol in AefProfile indicates HTTP. # noqa: E501 + + :param operations: The operations of this CustomOperation. + :type operations: List[Operation] + """ + if operations is not None and len(operations) < 1: + raise ValueError("Invalid value for `operations`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._operations = operations + + @property + def description(self) -> str: + """Gets the description of this CustomOperation. + + Text description of the custom operation # noqa: E501 + + :return: The description of this CustomOperation. + :rtype: str + """ + return self._description + + @description.setter + def description(self, description: str): + """Sets the description of this CustomOperation. + + Text description of the custom operation # noqa: E501 + + :param description: The description of this CustomOperation. + :type description: str + """ + + self._description = description diff --git a/services/helper/helper_service/services/api/models/data_format.py b/services/helper/helper_service/services/api/models/data_format.py new file mode 100644 index 0000000000000000000000000000000000000000..49cba1d79af19c485ac0bc7c41db54fd541da744 --- /dev/null +++ b/services/helper/helper_service/services/api/models/data_format.py @@ -0,0 +1,33 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model + + +class DataFormat(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self): # noqa: E501 + """DataFormat - a model defined in OpenAPI + + """ + self.openapi_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'DataFormat': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The DataFormat of this DataFormat. # noqa: E501 + :rtype: DataFormat + """ + return util.deserialize_model(dikt, cls) diff --git a/services/helper/helper_service/services/api/models/ellipsoid_arc.py b/services/helper/helper_service/services/api/models/ellipsoid_arc.py new file mode 100644 index 0000000000000000000000000000000000000000..0bf4081f4a7d080c8207f504019a0226c23e953c --- /dev/null +++ b/services/helper/helper_service/services/api/models/ellipsoid_arc.py @@ -0,0 +1,262 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model +from api.models.gad_shape import GADShape # noqa: E501 +from api.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from api.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 + + +class EllipsoidArc(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, shape=None, point=None, inner_radius=None, uncertainty_radius=None, offset_angle=None, included_angle=None, confidence=None): # noqa: E501 + """EllipsoidArc - a model defined in OpenAPI + + :param shape: The shape of this EllipsoidArc. # noqa: E501 + :type shape: SupportedGADShapes + :param point: The point of this EllipsoidArc. # noqa: E501 + :type point: GeographicalCoordinates + :param inner_radius: The inner_radius of this EllipsoidArc. # noqa: E501 + :type inner_radius: int + :param uncertainty_radius: The uncertainty_radius of this EllipsoidArc. # noqa: E501 + :type uncertainty_radius: float + :param offset_angle: The offset_angle of this EllipsoidArc. # noqa: E501 + :type offset_angle: int + :param included_angle: The included_angle of this EllipsoidArc. # noqa: E501 + :type included_angle: int + :param confidence: The confidence of this EllipsoidArc. # noqa: E501 + :type confidence: int + """ + self.openapi_types = { + 'shape': SupportedGADShapes, + 'point': GeographicalCoordinates, + 'inner_radius': int, + 'uncertainty_radius': float, + 'offset_angle': int, + 'included_angle': int, + 'confidence': int + } + + self.attribute_map = { + 'shape': 'shape', + 'point': 'point', + 'inner_radius': 'innerRadius', + 'uncertainty_radius': 'uncertaintyRadius', + 'offset_angle': 'offsetAngle', + 'included_angle': 'includedAngle', + 'confidence': 'confidence' + } + + self._shape = shape + self._point = point + self._inner_radius = inner_radius + self._uncertainty_radius = uncertainty_radius + self._offset_angle = offset_angle + self._included_angle = included_angle + self._confidence = confidence + + @classmethod + def from_dict(cls, dikt) -> 'EllipsoidArc': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The EllipsoidArc of this EllipsoidArc. # noqa: E501 + :rtype: EllipsoidArc + """ + return util.deserialize_model(dikt, cls) + + @property + def shape(self) -> SupportedGADShapes: + """Gets the shape of this EllipsoidArc. + + + :return: The shape of this EllipsoidArc. + :rtype: SupportedGADShapes + """ + return self._shape + + @shape.setter + def shape(self, shape: SupportedGADShapes): + """Sets the shape of this EllipsoidArc. + + + :param shape: The shape of this EllipsoidArc. + :type shape: SupportedGADShapes + """ + if shape is None: + raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 + + self._shape = shape + + @property + def point(self) -> GeographicalCoordinates: + """Gets the point of this EllipsoidArc. + + + :return: The point of this EllipsoidArc. + :rtype: GeographicalCoordinates + """ + return self._point + + @point.setter + def point(self, point: GeographicalCoordinates): + """Sets the point of this EllipsoidArc. + + + :param point: The point of this EllipsoidArc. + :type point: GeographicalCoordinates + """ + if point is None: + raise ValueError("Invalid value for `point`, must not be `None`") # noqa: E501 + + self._point = point + + @property + def inner_radius(self) -> int: + """Gets the inner_radius of this EllipsoidArc. + + Indicates value of the inner radius. # noqa: E501 + + :return: The inner_radius of this EllipsoidArc. + :rtype: int + """ + return self._inner_radius + + @inner_radius.setter + def inner_radius(self, inner_radius: int): + """Sets the inner_radius of this EllipsoidArc. + + Indicates value of the inner radius. # noqa: E501 + + :param inner_radius: The inner_radius of this EllipsoidArc. + :type inner_radius: int + """ + if inner_radius is None: + raise ValueError("Invalid value for `inner_radius`, must not be `None`") # noqa: E501 + if inner_radius is not None and inner_radius > 327675: # noqa: E501 + raise ValueError("Invalid value for `inner_radius`, must be a value less than or equal to `327675`") # noqa: E501 + if inner_radius is not None and inner_radius < 0: # noqa: E501 + raise ValueError("Invalid value for `inner_radius`, must be a value greater than or equal to `0`") # noqa: E501 + + self._inner_radius = inner_radius + + @property + def uncertainty_radius(self) -> float: + """Gets the uncertainty_radius of this EllipsoidArc. + + Indicates value of uncertainty. # noqa: E501 + + :return: The uncertainty_radius of this EllipsoidArc. + :rtype: float + """ + return self._uncertainty_radius + + @uncertainty_radius.setter + def uncertainty_radius(self, uncertainty_radius: float): + """Sets the uncertainty_radius of this EllipsoidArc. + + Indicates value of uncertainty. # noqa: E501 + + :param uncertainty_radius: The uncertainty_radius of this EllipsoidArc. + :type uncertainty_radius: float + """ + if uncertainty_radius is None: + raise ValueError("Invalid value for `uncertainty_radius`, must not be `None`") # noqa: E501 + if uncertainty_radius is not None and uncertainty_radius < 0: # noqa: E501 + raise ValueError("Invalid value for `uncertainty_radius`, must be a value greater than or equal to `0`") # noqa: E501 + + self._uncertainty_radius = uncertainty_radius + + @property + def offset_angle(self) -> int: + """Gets the offset_angle of this EllipsoidArc. + + Indicates value of angle. # noqa: E501 + + :return: The offset_angle of this EllipsoidArc. + :rtype: int + """ + return self._offset_angle + + @offset_angle.setter + def offset_angle(self, offset_angle: int): + """Sets the offset_angle of this EllipsoidArc. + + Indicates value of angle. # noqa: E501 + + :param offset_angle: The offset_angle of this EllipsoidArc. + :type offset_angle: int + """ + if offset_angle is None: + raise ValueError("Invalid value for `offset_angle`, must not be `None`") # noqa: E501 + if offset_angle is not None and offset_angle > 360: # noqa: E501 + raise ValueError("Invalid value for `offset_angle`, must be a value less than or equal to `360`") # noqa: E501 + if offset_angle is not None and offset_angle < 0: # noqa: E501 + raise ValueError("Invalid value for `offset_angle`, must be a value greater than or equal to `0`") # noqa: E501 + + self._offset_angle = offset_angle + + @property + def included_angle(self) -> int: + """Gets the included_angle of this EllipsoidArc. + + Indicates value of angle. # noqa: E501 + + :return: The included_angle of this EllipsoidArc. + :rtype: int + """ + return self._included_angle + + @included_angle.setter + def included_angle(self, included_angle: int): + """Sets the included_angle of this EllipsoidArc. + + Indicates value of angle. # noqa: E501 + + :param included_angle: The included_angle of this EllipsoidArc. + :type included_angle: int + """ + if included_angle is None: + raise ValueError("Invalid value for `included_angle`, must not be `None`") # noqa: E501 + if included_angle is not None and included_angle > 360: # noqa: E501 + raise ValueError("Invalid value for `included_angle`, must be a value less than or equal to `360`") # noqa: E501 + if included_angle is not None and included_angle < 0: # noqa: E501 + raise ValueError("Invalid value for `included_angle`, must be a value greater than or equal to `0`") # noqa: E501 + + self._included_angle = included_angle + + @property + def confidence(self) -> int: + """Gets the confidence of this EllipsoidArc. + + Indicates value of confidence. # noqa: E501 + + :return: The confidence of this EllipsoidArc. + :rtype: int + """ + return self._confidence + + @confidence.setter + def confidence(self, confidence: int): + """Sets the confidence of this EllipsoidArc. + + Indicates value of confidence. # noqa: E501 + + :param confidence: The confidence of this EllipsoidArc. + :type confidence: int + """ + if confidence is None: + raise ValueError("Invalid value for `confidence`, must not be `None`") # noqa: E501 + if confidence is not None and confidence > 100: # noqa: E501 + raise ValueError("Invalid value for `confidence`, must be a value less than or equal to `100`") # noqa: E501 + if confidence is not None and confidence < 0: # noqa: E501 + raise ValueError("Invalid value for `confidence`, must be a value greater than or equal to `0`") # noqa: E501 + + self._confidence = confidence diff --git a/services/helper/helper_service/services/api/models/error_response.py b/services/helper/helper_service/services/api/models/error_response.py new file mode 100644 index 0000000000000000000000000000000000000000..8f5fd61b97824036d0488b8b2098fab9a9d05867 --- /dev/null +++ b/services/helper/helper_service/services/api/models/error_response.py @@ -0,0 +1,86 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model + + +class ErrorResponse(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, message=None, details=None): # noqa: E501 + """ErrorResponse - a model defined in OpenAPI + + :param message: The message of this ErrorResponse. # noqa: E501 + :type message: str + :param details: The details of this ErrorResponse. # noqa: E501 + :type details: str + """ + self.openapi_types = { + 'message': str, + 'details': str + } + + self.attribute_map = { + 'message': 'message', + 'details': 'details' + } + + self._message = message + self._details = details + + @classmethod + def from_dict(cls, dikt) -> 'ErrorResponse': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The ErrorResponse of this ErrorResponse. # noqa: E501 + :rtype: ErrorResponse + """ + return util.deserialize_model(dikt, cls) + + @property + def message(self) -> str: + """Gets the message of this ErrorResponse. + + + :return: The message of this ErrorResponse. + :rtype: str + """ + return self._message + + @message.setter + def message(self, message: str): + """Sets the message of this ErrorResponse. + + + :param message: The message of this ErrorResponse. + :type message: str + """ + + self._message = message + + @property + def details(self) -> str: + """Gets the details of this ErrorResponse. + + + :return: The details of this ErrorResponse. + :rtype: str + """ + return self._details + + @details.setter + def details(self, details: str): + """Sets the details of this ErrorResponse. + + + :param details: The details of this ErrorResponse. + :type details: str + """ + + self._details = details diff --git a/services/helper/helper_service/services/api/models/event_subscription.py b/services/helper/helper_service/services/api/models/event_subscription.py new file mode 100644 index 0000000000000000000000000000000000000000..fa2306dccdae227b3bec1860cd03d3766c616abb --- /dev/null +++ b/services/helper/helper_service/services/api/models/event_subscription.py @@ -0,0 +1,241 @@ +import re # noqa: E501 +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model +from api.models.capif_event import CAPIFEvent # noqa: E501 +from api.models.capif_event_filter import CAPIFEventFilter # noqa: E501 +from api.models.reporting_information import ReportingInformation # noqa: E501 +from api.models.websock_notif_config import WebsockNotifConfig # noqa: E501 + + +class EventSubscription(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, events=None, event_filters=None, event_req=None, notification_destination=None, request_test_notification=None, websock_notif_config=None, supported_features=None): # noqa: E501 + """EventSubscription - a model defined in OpenAPI + + :param events: The events of this EventSubscription. # noqa: E501 + :type events: List[CAPIFEvent] + :param event_filters: The event_filters of this EventSubscription. # noqa: E501 + :type event_filters: List[CAPIFEventFilter] + :param event_req: The event_req of this EventSubscription. # noqa: E501 + :type event_req: ReportingInformation + :param notification_destination: The notification_destination of this EventSubscription. # noqa: E501 + :type notification_destination: str + :param request_test_notification: The request_test_notification of this EventSubscription. # noqa: E501 + :type request_test_notification: bool + :param websock_notif_config: The websock_notif_config of this EventSubscription. # noqa: E501 + :type websock_notif_config: WebsockNotifConfig + :param supported_features: The supported_features of this EventSubscription. # noqa: E501 + :type supported_features: str + """ + self.openapi_types = { + 'events': List[CAPIFEvent], + 'event_filters': List[CAPIFEventFilter], + 'event_req': ReportingInformation, + 'notification_destination': str, + 'request_test_notification': bool, + 'websock_notif_config': WebsockNotifConfig, + 'supported_features': str + } + + self.attribute_map = { + 'events': 'events', + 'event_filters': 'eventFilters', + 'event_req': 'eventReq', + 'notification_destination': 'notificationDestination', + 'request_test_notification': 'requestTestNotification', + 'websock_notif_config': 'websockNotifConfig', + 'supported_features': 'supportedFeatures' + } + + self._events = events + self._event_filters = event_filters + self._event_req = event_req + self._notification_destination = notification_destination + self._request_test_notification = request_test_notification + self._websock_notif_config = websock_notif_config + self._supported_features = supported_features + + @classmethod + def from_dict(cls, dikt) -> 'EventSubscription': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The EventSubscription of this EventSubscription. # noqa: E501 + :rtype: EventSubscription + """ + return util.deserialize_model(dikt, cls) + + @property + def events(self) -> List[CAPIFEvent]: + """Gets the events of this EventSubscription. + + Subscribed events # noqa: E501 + + :return: The events of this EventSubscription. + :rtype: List[CAPIFEvent] + """ + return self._events + + @events.setter + def events(self, events: List[CAPIFEvent]): + """Sets the events of this EventSubscription. + + Subscribed events # noqa: E501 + + :param events: The events of this EventSubscription. + :type events: List[CAPIFEvent] + """ + if events is None: + raise ValueError("Invalid value for `events`, must not be `None`") # noqa: E501 + if events is not None and len(events) < 1: + raise ValueError("Invalid value for `events`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._events = events + + @property + def event_filters(self) -> List[CAPIFEventFilter]: + """Gets the event_filters of this EventSubscription. + + Subscribed event filters # noqa: E501 + + :return: The event_filters of this EventSubscription. + :rtype: List[CAPIFEventFilter] + """ + return self._event_filters + + @event_filters.setter + def event_filters(self, event_filters: List[CAPIFEventFilter]): + """Sets the event_filters of this EventSubscription. + + Subscribed event filters # noqa: E501 + + :param event_filters: The event_filters of this EventSubscription. + :type event_filters: List[CAPIFEventFilter] + """ + if event_filters is not None and len(event_filters) < 1: + raise ValueError("Invalid value for `event_filters`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._event_filters = event_filters + + @property + def event_req(self) -> ReportingInformation: + """Gets the event_req of this EventSubscription. + + + :return: The event_req of this EventSubscription. + :rtype: ReportingInformation + """ + return self._event_req + + @event_req.setter + def event_req(self, event_req: ReportingInformation): + """Sets the event_req of this EventSubscription. + + + :param event_req: The event_req of this EventSubscription. + :type event_req: ReportingInformation + """ + + self._event_req = event_req + + @property + def notification_destination(self) -> str: + """Gets the notification_destination of this EventSubscription. + + string providing an URI formatted according to IETF RFC 3986. # noqa: E501 + + :return: The notification_destination of this EventSubscription. + :rtype: str + """ + return self._notification_destination + + @notification_destination.setter + def notification_destination(self, notification_destination: str): + """Sets the notification_destination of this EventSubscription. + + string providing an URI formatted according to IETF RFC 3986. # noqa: E501 + + :param notification_destination: The notification_destination of this EventSubscription. + :type notification_destination: str + """ + if notification_destination is None: + raise ValueError("Invalid value for `notification_destination`, must not be `None`") # noqa: E501 + + self._notification_destination = notification_destination + + @property + def request_test_notification(self) -> bool: + """Gets the request_test_notification of this EventSubscription. + + Set to true by Subscriber to request the CAPIF core function to send a test notification as defined in in clause 7.6. Set to false or omitted otherwise. # noqa: E501 + + :return: The request_test_notification of this EventSubscription. + :rtype: bool + """ + return self._request_test_notification + + @request_test_notification.setter + def request_test_notification(self, request_test_notification: bool): + """Sets the request_test_notification of this EventSubscription. + + Set to true by Subscriber to request the CAPIF core function to send a test notification as defined in in clause 7.6. Set to false or omitted otherwise. # noqa: E501 + + :param request_test_notification: The request_test_notification of this EventSubscription. + :type request_test_notification: bool + """ + + self._request_test_notification = request_test_notification + + @property + def websock_notif_config(self) -> WebsockNotifConfig: + """Gets the websock_notif_config of this EventSubscription. + + + :return: The websock_notif_config of this EventSubscription. + :rtype: WebsockNotifConfig + """ + return self._websock_notif_config + + @websock_notif_config.setter + def websock_notif_config(self, websock_notif_config: WebsockNotifConfig): + """Sets the websock_notif_config of this EventSubscription. + + + :param websock_notif_config: The websock_notif_config of this EventSubscription. + :type websock_notif_config: WebsockNotifConfig + """ + + self._websock_notif_config = websock_notif_config + + @property + def supported_features(self) -> str: + """Gets the supported_features of this EventSubscription. + + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. # noqa: E501 + + :return: The supported_features of this EventSubscription. + :rtype: str + """ + return self._supported_features + + @supported_features.setter + def supported_features(self, supported_features: str): + """Sets the supported_features of this EventSubscription. + + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. # noqa: E501 + + :param supported_features: The supported_features of this EventSubscription. + :type supported_features: str + """ + if supported_features is not None and not re.search(r'^[A-Fa-f0-9]*$', supported_features): # noqa: E501 + raise ValueError(r"Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + + self._supported_features = supported_features diff --git a/services/helper/helper_service/services/api/models/gad_shape.py b/services/helper/helper_service/services/api/models/gad_shape.py new file mode 100644 index 0000000000000000000000000000000000000000..e4d83408e5e8cb886c458774d8ecbfeae1929d56 --- /dev/null +++ b/services/helper/helper_service/services/api/models/gad_shape.py @@ -0,0 +1,63 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model +from api.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 + + +class GADShape(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, shape=None): # noqa: E501 + """GADShape - a model defined in OpenAPI + + :param shape: The shape of this GADShape. # noqa: E501 + :type shape: SupportedGADShapes + """ + self.openapi_types = { + 'shape': SupportedGADShapes + } + + self.attribute_map = { + 'shape': 'shape' + } + + self._shape = shape + + @classmethod + def from_dict(cls, dikt) -> 'GADShape': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The GADShape of this GADShape. # noqa: E501 + :rtype: GADShape + """ + return util.deserialize_model(dikt, cls) + + @property + def shape(self) -> SupportedGADShapes: + """Gets the shape of this GADShape. + + + :return: The shape of this GADShape. + :rtype: SupportedGADShapes + """ + return self._shape + + @shape.setter + def shape(self, shape: SupportedGADShapes): + """Sets the shape of this GADShape. + + + :param shape: The shape of this GADShape. + :type shape: SupportedGADShapes + """ + if shape is None: + raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 + + self._shape = shape diff --git a/services/helper/helper_service/services/api/models/geographic_area.py b/services/helper/helper_service/services/api/models/geographic_area.py new file mode 100644 index 0000000000000000000000000000000000000000..69ff7fb4c781fc613014dfdbddd2ef5785425fad --- /dev/null +++ b/services/helper/helper_service/services/api/models/geographic_area.py @@ -0,0 +1,432 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model +from api.models.ellipsoid_arc import EllipsoidArc # noqa: E501 +from api.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from api.models.point import Point # noqa: E501 +from api.models.point_altitude import PointAltitude # noqa: E501 +from api.models.point_altitude_uncertainty import \ + PointAltitudeUncertainty # noqa: E501 +from api.models.point_uncertainty_circle import \ + PointUncertaintyCircle # noqa: E501 +from api.models.point_uncertainty_ellipse import \ + PointUncertaintyEllipse # noqa: E501 +from api.models.polygon import Polygon # noqa: E501 +from api.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 +from api.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 + + +class GeographicArea(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, shape=None, point=None, uncertainty=None, uncertainty_ellipse=None, confidence=None, point_list=None, altitude=None, uncertainty_altitude=None, inner_radius=None, uncertainty_radius=None, offset_angle=None, included_angle=None): # noqa: E501 + """GeographicArea - a model defined in OpenAPI + + :param shape: The shape of this GeographicArea. # noqa: E501 + :type shape: SupportedGADShapes + :param point: The point of this GeographicArea. # noqa: E501 + :type point: GeographicalCoordinates + :param uncertainty: The uncertainty of this GeographicArea. # noqa: E501 + :type uncertainty: float + :param uncertainty_ellipse: The uncertainty_ellipse of this GeographicArea. # noqa: E501 + :type uncertainty_ellipse: UncertaintyEllipse + :param confidence: The confidence of this GeographicArea. # noqa: E501 + :type confidence: int + :param point_list: The point_list of this GeographicArea. # noqa: E501 + :type point_list: List[GeographicalCoordinates] + :param altitude: The altitude of this GeographicArea. # noqa: E501 + :type altitude: float + :param uncertainty_altitude: The uncertainty_altitude of this GeographicArea. # noqa: E501 + :type uncertainty_altitude: float + :param inner_radius: The inner_radius of this GeographicArea. # noqa: E501 + :type inner_radius: int + :param uncertainty_radius: The uncertainty_radius of this GeographicArea. # noqa: E501 + :type uncertainty_radius: float + :param offset_angle: The offset_angle of this GeographicArea. # noqa: E501 + :type offset_angle: int + :param included_angle: The included_angle of this GeographicArea. # noqa: E501 + :type included_angle: int + """ + self.openapi_types = { + 'shape': SupportedGADShapes, + 'point': GeographicalCoordinates, + 'uncertainty': float, + 'uncertainty_ellipse': UncertaintyEllipse, + 'confidence': int, + 'point_list': List[GeographicalCoordinates], + 'altitude': float, + 'uncertainty_altitude': float, + 'inner_radius': int, + 'uncertainty_radius': float, + 'offset_angle': int, + 'included_angle': int + } + + self.attribute_map = { + 'shape': 'shape', + 'point': 'point', + 'uncertainty': 'uncertainty', + 'uncertainty_ellipse': 'uncertaintyEllipse', + 'confidence': 'confidence', + 'point_list': 'pointList', + 'altitude': 'altitude', + 'uncertainty_altitude': 'uncertaintyAltitude', + 'inner_radius': 'innerRadius', + 'uncertainty_radius': 'uncertaintyRadius', + 'offset_angle': 'offsetAngle', + 'included_angle': 'includedAngle' + } + + self._shape = shape + self._point = point + self._uncertainty = uncertainty + self._uncertainty_ellipse = uncertainty_ellipse + self._confidence = confidence + self._point_list = point_list + self._altitude = altitude + self._uncertainty_altitude = uncertainty_altitude + self._inner_radius = inner_radius + self._uncertainty_radius = uncertainty_radius + self._offset_angle = offset_angle + self._included_angle = included_angle + + @classmethod + def from_dict(cls, dikt) -> 'GeographicArea': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The GeographicArea of this GeographicArea. # noqa: E501 + :rtype: GeographicArea + """ + return util.deserialize_model(dikt, cls) + + @property + def shape(self) -> SupportedGADShapes: + """Gets the shape of this GeographicArea. + + + :return: The shape of this GeographicArea. + :rtype: SupportedGADShapes + """ + return self._shape + + @shape.setter + def shape(self, shape: SupportedGADShapes): + """Sets the shape of this GeographicArea. + + + :param shape: The shape of this GeographicArea. + :type shape: SupportedGADShapes + """ + if shape is None: + raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 + + self._shape = shape + + @property + def point(self) -> GeographicalCoordinates: + """Gets the point of this GeographicArea. + + + :return: The point of this GeographicArea. + :rtype: GeographicalCoordinates + """ + return self._point + + @point.setter + def point(self, point: GeographicalCoordinates): + """Sets the point of this GeographicArea. + + + :param point: The point of this GeographicArea. + :type point: GeographicalCoordinates + """ + if point is None: + raise ValueError("Invalid value for `point`, must not be `None`") # noqa: E501 + + self._point = point + + @property + def uncertainty(self) -> float: + """Gets the uncertainty of this GeographicArea. + + Indicates value of uncertainty. # noqa: E501 + + :return: The uncertainty of this GeographicArea. + :rtype: float + """ + return self._uncertainty + + @uncertainty.setter + def uncertainty(self, uncertainty: float): + """Sets the uncertainty of this GeographicArea. + + Indicates value of uncertainty. # noqa: E501 + + :param uncertainty: The uncertainty of this GeographicArea. + :type uncertainty: float + """ + if uncertainty is None: + raise ValueError("Invalid value for `uncertainty`, must not be `None`") # noqa: E501 + if uncertainty is not None and uncertainty < 0: # noqa: E501 + raise ValueError("Invalid value for `uncertainty`, must be a value greater than or equal to `0`") # noqa: E501 + + self._uncertainty = uncertainty + + @property + def uncertainty_ellipse(self) -> UncertaintyEllipse: + """Gets the uncertainty_ellipse of this GeographicArea. + + + :return: The uncertainty_ellipse of this GeographicArea. + :rtype: UncertaintyEllipse + """ + return self._uncertainty_ellipse + + @uncertainty_ellipse.setter + def uncertainty_ellipse(self, uncertainty_ellipse: UncertaintyEllipse): + """Sets the uncertainty_ellipse of this GeographicArea. + + + :param uncertainty_ellipse: The uncertainty_ellipse of this GeographicArea. + :type uncertainty_ellipse: UncertaintyEllipse + """ + if uncertainty_ellipse is None: + raise ValueError("Invalid value for `uncertainty_ellipse`, must not be `None`") # noqa: E501 + + self._uncertainty_ellipse = uncertainty_ellipse + + @property + def confidence(self) -> int: + """Gets the confidence of this GeographicArea. + + Indicates value of confidence. # noqa: E501 + + :return: The confidence of this GeographicArea. + :rtype: int + """ + return self._confidence + + @confidence.setter + def confidence(self, confidence: int): + """Sets the confidence of this GeographicArea. + + Indicates value of confidence. # noqa: E501 + + :param confidence: The confidence of this GeographicArea. + :type confidence: int + """ + if confidence is None: + raise ValueError("Invalid value for `confidence`, must not be `None`") # noqa: E501 + if confidence is not None and confidence > 100: # noqa: E501 + raise ValueError("Invalid value for `confidence`, must be a value less than or equal to `100`") # noqa: E501 + if confidence is not None and confidence < 0: # noqa: E501 + raise ValueError("Invalid value for `confidence`, must be a value greater than or equal to `0`") # noqa: E501 + + self._confidence = confidence + + @property + def point_list(self) -> List[GeographicalCoordinates]: + """Gets the point_list of this GeographicArea. + + List of points. # noqa: E501 + + :return: The point_list of this GeographicArea. + :rtype: List[GeographicalCoordinates] + """ + return self._point_list + + @point_list.setter + def point_list(self, point_list: List[GeographicalCoordinates]): + """Sets the point_list of this GeographicArea. + + List of points. # noqa: E501 + + :param point_list: The point_list of this GeographicArea. + :type point_list: List[GeographicalCoordinates] + """ + if point_list is None: + raise ValueError("Invalid value for `point_list`, must not be `None`") # noqa: E501 + if point_list is not None and len(point_list) > 15: + raise ValueError("Invalid value for `point_list`, number of items must be less than or equal to `15`") # noqa: E501 + if point_list is not None and len(point_list) < 3: + raise ValueError("Invalid value for `point_list`, number of items must be greater than or equal to `3`") # noqa: E501 + + self._point_list = point_list + + @property + def altitude(self) -> float: + """Gets the altitude of this GeographicArea. + + Indicates value of altitude. # noqa: E501 + + :return: The altitude of this GeographicArea. + :rtype: float + """ + return self._altitude + + @altitude.setter + def altitude(self, altitude: float): + """Sets the altitude of this GeographicArea. + + Indicates value of altitude. # noqa: E501 + + :param altitude: The altitude of this GeographicArea. + :type altitude: float + """ + if altitude is None: + raise ValueError("Invalid value for `altitude`, must not be `None`") # noqa: E501 + if altitude is not None and altitude > 32767: # noqa: E501 + raise ValueError("Invalid value for `altitude`, must be a value less than or equal to `32767`") # noqa: E501 + if altitude is not None and altitude < -32767: # noqa: E501 + raise ValueError("Invalid value for `altitude`, must be a value greater than or equal to `-32767`") # noqa: E501 + + self._altitude = altitude + + @property + def uncertainty_altitude(self) -> float: + """Gets the uncertainty_altitude of this GeographicArea. + + Indicates value of uncertainty. # noqa: E501 + + :return: The uncertainty_altitude of this GeographicArea. + :rtype: float + """ + return self._uncertainty_altitude + + @uncertainty_altitude.setter + def uncertainty_altitude(self, uncertainty_altitude: float): + """Sets the uncertainty_altitude of this GeographicArea. + + Indicates value of uncertainty. # noqa: E501 + + :param uncertainty_altitude: The uncertainty_altitude of this GeographicArea. + :type uncertainty_altitude: float + """ + if uncertainty_altitude is None: + raise ValueError("Invalid value for `uncertainty_altitude`, must not be `None`") # noqa: E501 + if uncertainty_altitude is not None and uncertainty_altitude < 0: # noqa: E501 + raise ValueError("Invalid value for `uncertainty_altitude`, must be a value greater than or equal to `0`") # noqa: E501 + + self._uncertainty_altitude = uncertainty_altitude + + @property + def inner_radius(self) -> int: + """Gets the inner_radius of this GeographicArea. + + Indicates value of the inner radius. # noqa: E501 + + :return: The inner_radius of this GeographicArea. + :rtype: int + """ + return self._inner_radius + + @inner_radius.setter + def inner_radius(self, inner_radius: int): + """Sets the inner_radius of this GeographicArea. + + Indicates value of the inner radius. # noqa: E501 + + :param inner_radius: The inner_radius of this GeographicArea. + :type inner_radius: int + """ + if inner_radius is None: + raise ValueError("Invalid value for `inner_radius`, must not be `None`") # noqa: E501 + if inner_radius is not None and inner_radius > 327675: # noqa: E501 + raise ValueError("Invalid value for `inner_radius`, must be a value less than or equal to `327675`") # noqa: E501 + if inner_radius is not None and inner_radius < 0: # noqa: E501 + raise ValueError("Invalid value for `inner_radius`, must be a value greater than or equal to `0`") # noqa: E501 + + self._inner_radius = inner_radius + + @property + def uncertainty_radius(self) -> float: + """Gets the uncertainty_radius of this GeographicArea. + + Indicates value of uncertainty. # noqa: E501 + + :return: The uncertainty_radius of this GeographicArea. + :rtype: float + """ + return self._uncertainty_radius + + @uncertainty_radius.setter + def uncertainty_radius(self, uncertainty_radius: float): + """Sets the uncertainty_radius of this GeographicArea. + + Indicates value of uncertainty. # noqa: E501 + + :param uncertainty_radius: The uncertainty_radius of this GeographicArea. + :type uncertainty_radius: float + """ + if uncertainty_radius is None: + raise ValueError("Invalid value for `uncertainty_radius`, must not be `None`") # noqa: E501 + if uncertainty_radius is not None and uncertainty_radius < 0: # noqa: E501 + raise ValueError("Invalid value for `uncertainty_radius`, must be a value greater than or equal to `0`") # noqa: E501 + + self._uncertainty_radius = uncertainty_radius + + @property + def offset_angle(self) -> int: + """Gets the offset_angle of this GeographicArea. + + Indicates value of angle. # noqa: E501 + + :return: The offset_angle of this GeographicArea. + :rtype: int + """ + return self._offset_angle + + @offset_angle.setter + def offset_angle(self, offset_angle: int): + """Sets the offset_angle of this GeographicArea. + + Indicates value of angle. # noqa: E501 + + :param offset_angle: The offset_angle of this GeographicArea. + :type offset_angle: int + """ + if offset_angle is None: + raise ValueError("Invalid value for `offset_angle`, must not be `None`") # noqa: E501 + if offset_angle is not None and offset_angle > 360: # noqa: E501 + raise ValueError("Invalid value for `offset_angle`, must be a value less than or equal to `360`") # noqa: E501 + if offset_angle is not None and offset_angle < 0: # noqa: E501 + raise ValueError("Invalid value for `offset_angle`, must be a value greater than or equal to `0`") # noqa: E501 + + self._offset_angle = offset_angle + + @property + def included_angle(self) -> int: + """Gets the included_angle of this GeographicArea. + + Indicates value of angle. # noqa: E501 + + :return: The included_angle of this GeographicArea. + :rtype: int + """ + return self._included_angle + + @included_angle.setter + def included_angle(self, included_angle: int): + """Sets the included_angle of this GeographicArea. + + Indicates value of angle. # noqa: E501 + + :param included_angle: The included_angle of this GeographicArea. + :type included_angle: int + """ + if included_angle is None: + raise ValueError("Invalid value for `included_angle`, must not be `None`") # noqa: E501 + if included_angle is not None and included_angle > 360: # noqa: E501 + raise ValueError("Invalid value for `included_angle`, must be a value less than or equal to `360`") # noqa: E501 + if included_angle is not None and included_angle < 0: # noqa: E501 + raise ValueError("Invalid value for `included_angle`, must be a value greater than or equal to `0`") # noqa: E501 + + self._included_angle = included_angle diff --git a/services/helper/helper_service/services/api/models/geographical_coordinates.py b/services/helper/helper_service/services/api/models/geographical_coordinates.py new file mode 100644 index 0000000000000000000000000000000000000000..368f9012be82204d159435fc5da246ddb93c6c9f --- /dev/null +++ b/services/helper/helper_service/services/api/models/geographical_coordinates.py @@ -0,0 +1,98 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model + + +class GeographicalCoordinates(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, lon=None, lat=None): # noqa: E501 + """GeographicalCoordinates - a model defined in OpenAPI + + :param lon: The lon of this GeographicalCoordinates. # noqa: E501 + :type lon: float + :param lat: The lat of this GeographicalCoordinates. # noqa: E501 + :type lat: float + """ + self.openapi_types = { + 'lon': float, + 'lat': float + } + + self.attribute_map = { + 'lon': 'lon', + 'lat': 'lat' + } + + self._lon = lon + self._lat = lat + + @classmethod + def from_dict(cls, dikt) -> 'GeographicalCoordinates': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The GeographicalCoordinates of this GeographicalCoordinates. # noqa: E501 + :rtype: GeographicalCoordinates + """ + return util.deserialize_model(dikt, cls) + + @property + def lon(self) -> float: + """Gets the lon of this GeographicalCoordinates. + + + :return: The lon of this GeographicalCoordinates. + :rtype: float + """ + return self._lon + + @lon.setter + def lon(self, lon: float): + """Sets the lon of this GeographicalCoordinates. + + + :param lon: The lon of this GeographicalCoordinates. + :type lon: float + """ + if lon is None: + raise ValueError("Invalid value for `lon`, must not be `None`") # noqa: E501 + if lon is not None and lon > 180: # noqa: E501 + raise ValueError("Invalid value for `lon`, must be a value less than or equal to `180`") # noqa: E501 + if lon is not None and lon < -180: # noqa: E501 + raise ValueError("Invalid value for `lon`, must be a value greater than or equal to `-180`") # noqa: E501 + + self._lon = lon + + @property + def lat(self) -> float: + """Gets the lat of this GeographicalCoordinates. + + + :return: The lat of this GeographicalCoordinates. + :rtype: float + """ + return self._lat + + @lat.setter + def lat(self, lat: float): + """Sets the lat of this GeographicalCoordinates. + + + :param lat: The lat of this GeographicalCoordinates. + :type lat: float + """ + if lat is None: + raise ValueError("Invalid value for `lat`, must not be `None`") # noqa: E501 + if lat is not None and lat > 90: # noqa: E501 + raise ValueError("Invalid value for `lat`, must be a value less than or equal to `90`") # noqa: E501 + if lat is not None and lat < -90: # noqa: E501 + raise ValueError("Invalid value for `lat`, must be a value greater than or equal to `-90`") # noqa: E501 + + self._lat = lat diff --git a/services/helper/helper_service/services/api/models/interface_description.py b/services/helper/helper_service/services/api/models/interface_description.py new file mode 100644 index 0000000000000000000000000000000000000000..1fbc82a2dce7c5001172514f460a9db410d4cb51 --- /dev/null +++ b/services/helper/helper_service/services/api/models/interface_description.py @@ -0,0 +1,153 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model +from api.models.security_method import SecurityMethod # noqa: E501 + + +class InterfaceDescription(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, ipv4_addr=None, ipv6_addr=None, port=None, security_methods=None): # noqa: E501 + """InterfaceDescription - a model defined in OpenAPI + + :param ipv4_addr: The ipv4_addr of this InterfaceDescription. # noqa: E501 + :type ipv4_addr: str + :param ipv6_addr: The ipv6_addr of this InterfaceDescription. # noqa: E501 + :type ipv6_addr: str + :param port: The port of this InterfaceDescription. # noqa: E501 + :type port: int + :param security_methods: The security_methods of this InterfaceDescription. # noqa: E501 + :type security_methods: List[SecurityMethod] + """ + self.openapi_types = { + 'ipv4_addr': str, + 'ipv6_addr': str, + 'port': int, + 'security_methods': List[SecurityMethod] + } + + self.attribute_map = { + 'ipv4_addr': 'ipv4Addr', + 'ipv6_addr': 'ipv6Addr', + 'port': 'port', + 'security_methods': 'securityMethods' + } + + self._ipv4_addr = ipv4_addr + self._ipv6_addr = ipv6_addr + self._port = port + self._security_methods = security_methods + + @classmethod + def from_dict(cls, dikt) -> 'InterfaceDescription': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The InterfaceDescription of this InterfaceDescription. # noqa: E501 + :rtype: InterfaceDescription + """ + return util.deserialize_model(dikt, cls) + + @property + def ipv4_addr(self) -> str: + """Gets the ipv4_addr of this InterfaceDescription. + + string identifying a Ipv4 address formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166. # noqa: E501 + + :return: The ipv4_addr of this InterfaceDescription. + :rtype: str + """ + return self._ipv4_addr + + @ipv4_addr.setter + def ipv4_addr(self, ipv4_addr: str): + """Sets the ipv4_addr of this InterfaceDescription. + + string identifying a Ipv4 address formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166. # noqa: E501 + + :param ipv4_addr: The ipv4_addr of this InterfaceDescription. + :type ipv4_addr: str + """ + + self._ipv4_addr = ipv4_addr + + @property + def ipv6_addr(self) -> str: + """Gets the ipv6_addr of this InterfaceDescription. + + string identifying a Ipv6 address formatted according to clause 4 in IETF RFC 5952. The mixed Ipv4 Ipv6 notation according to clause 5 of IETF RFC 5952 shall not be used. # noqa: E501 + + :return: The ipv6_addr of this InterfaceDescription. + :rtype: str + """ + return self._ipv6_addr + + @ipv6_addr.setter + def ipv6_addr(self, ipv6_addr: str): + """Sets the ipv6_addr of this InterfaceDescription. + + string identifying a Ipv6 address formatted according to clause 4 in IETF RFC 5952. The mixed Ipv4 Ipv6 notation according to clause 5 of IETF RFC 5952 shall not be used. # noqa: E501 + + :param ipv6_addr: The ipv6_addr of this InterfaceDescription. + :type ipv6_addr: str + """ + + self._ipv6_addr = ipv6_addr + + @property + def port(self) -> int: + """Gets the port of this InterfaceDescription. + + Unsigned integer with valid values between 0 and 65535. # noqa: E501 + + :return: The port of this InterfaceDescription. + :rtype: int + """ + return self._port + + @port.setter + def port(self, port: int): + """Sets the port of this InterfaceDescription. + + Unsigned integer with valid values between 0 and 65535. # noqa: E501 + + :param port: The port of this InterfaceDescription. + :type port: int + """ + if port is not None and port > 65535: # noqa: E501 + raise ValueError("Invalid value for `port`, must be a value less than or equal to `65535`") # noqa: E501 + if port is not None and port < 0: # noqa: E501 + raise ValueError("Invalid value for `port`, must be a value greater than or equal to `0`") # noqa: E501 + + self._port = port + + @property + def security_methods(self) -> List[SecurityMethod]: + """Gets the security_methods of this InterfaceDescription. + + Security methods supported by the interface, it take precedence over the security methods provided in AefProfile, for this specific interface. # noqa: E501 + + :return: The security_methods of this InterfaceDescription. + :rtype: List[SecurityMethod] + """ + return self._security_methods + + @security_methods.setter + def security_methods(self, security_methods: List[SecurityMethod]): + """Sets the security_methods of this InterfaceDescription. + + Security methods supported by the interface, it take precedence over the security methods provided in AefProfile, for this specific interface. # noqa: E501 + + :param security_methods: The security_methods of this InterfaceDescription. + :type security_methods: List[SecurityMethod] + """ + if security_methods is not None and len(security_methods) < 1: + raise ValueError("Invalid value for `security_methods`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._security_methods = security_methods diff --git a/services/helper/helper_service/services/api/models/notification_flag.py b/services/helper/helper_service/services/api/models/notification_flag.py new file mode 100644 index 0000000000000000000000000000000000000000..199fc2cd30518bbdf3a58a208531a8ce383fbc17 --- /dev/null +++ b/services/helper/helper_service/services/api/models/notification_flag.py @@ -0,0 +1,33 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model + + +class NotificationFlag(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self): # noqa: E501 + """NotificationFlag - a model defined in OpenAPI + + """ + self.openapi_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'NotificationFlag': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The NotificationFlag of this NotificationFlag. # noqa: E501 + :rtype: NotificationFlag + """ + return util.deserialize_model(dikt, cls) diff --git a/services/helper/helper_service/services/api/models/notification_method.py b/services/helper/helper_service/services/api/models/notification_method.py new file mode 100644 index 0000000000000000000000000000000000000000..09c6cdf0c0209656049493ed33fd56e1be92bff5 --- /dev/null +++ b/services/helper/helper_service/services/api/models/notification_method.py @@ -0,0 +1,33 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model + + +class NotificationMethod(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self): # noqa: E501 + """NotificationMethod - a model defined in OpenAPI + + """ + self.openapi_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'NotificationMethod': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The NotificationMethod of this NotificationMethod. # noqa: E501 + :rtype: NotificationMethod + """ + return util.deserialize_model(dikt, cls) diff --git a/services/helper/helper_service/services/api/models/onboarding_information.py b/services/helper/helper_service/services/api/models/onboarding_information.py new file mode 100644 index 0000000000000000000000000000000000000000..e0de508ab978d76cc91c214e5361194f3f236dc4 --- /dev/null +++ b/services/helper/helper_service/services/api/models/onboarding_information.py @@ -0,0 +1,120 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model + + +class OnboardingInformation(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, api_invoker_public_key=None, api_invoker_certificate=None, onboarding_secret=None): # noqa: E501 + """OnboardingInformation - a model defined in OpenAPI + + :param api_invoker_public_key: The api_invoker_public_key of this OnboardingInformation. # noqa: E501 + :type api_invoker_public_key: str + :param api_invoker_certificate: The api_invoker_certificate of this OnboardingInformation. # noqa: E501 + :type api_invoker_certificate: str + :param onboarding_secret: The onboarding_secret of this OnboardingInformation. # noqa: E501 + :type onboarding_secret: str + """ + self.openapi_types = { + 'api_invoker_public_key': str, + 'api_invoker_certificate': str, + 'onboarding_secret': str + } + + self.attribute_map = { + 'api_invoker_public_key': 'apiInvokerPublicKey', + 'api_invoker_certificate': 'apiInvokerCertificate', + 'onboarding_secret': 'onboardingSecret' + } + + self._api_invoker_public_key = api_invoker_public_key + self._api_invoker_certificate = api_invoker_certificate + self._onboarding_secret = onboarding_secret + + @classmethod + def from_dict(cls, dikt) -> 'OnboardingInformation': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The OnboardingInformation of this OnboardingInformation. # noqa: E501 + :rtype: OnboardingInformation + """ + return util.deserialize_model(dikt, cls) + + @property + def api_invoker_public_key(self) -> str: + """Gets the api_invoker_public_key of this OnboardingInformation. + + The API Invoker's public key # noqa: E501 + + :return: The api_invoker_public_key of this OnboardingInformation. + :rtype: str + """ + return self._api_invoker_public_key + + @api_invoker_public_key.setter + def api_invoker_public_key(self, api_invoker_public_key: str): + """Sets the api_invoker_public_key of this OnboardingInformation. + + The API Invoker's public key # noqa: E501 + + :param api_invoker_public_key: The api_invoker_public_key of this OnboardingInformation. + :type api_invoker_public_key: str + """ + if api_invoker_public_key is None: + raise ValueError("Invalid value for `api_invoker_public_key`, must not be `None`") # noqa: E501 + + self._api_invoker_public_key = api_invoker_public_key + + @property + def api_invoker_certificate(self) -> str: + """Gets the api_invoker_certificate of this OnboardingInformation. + + The API Invoker's generic client certificate, provided by the CAPIF core function. # noqa: E501 + + :return: The api_invoker_certificate of this OnboardingInformation. + :rtype: str + """ + return self._api_invoker_certificate + + @api_invoker_certificate.setter + def api_invoker_certificate(self, api_invoker_certificate: str): + """Sets the api_invoker_certificate of this OnboardingInformation. + + The API Invoker's generic client certificate, provided by the CAPIF core function. # noqa: E501 + + :param api_invoker_certificate: The api_invoker_certificate of this OnboardingInformation. + :type api_invoker_certificate: str + """ + + self._api_invoker_certificate = api_invoker_certificate + + @property + def onboarding_secret(self) -> str: + """Gets the onboarding_secret of this OnboardingInformation. + + The API Invoker's onboarding secret, provided by the CAPIF core function. # noqa: E501 + + :return: The onboarding_secret of this OnboardingInformation. + :rtype: str + """ + return self._onboarding_secret + + @onboarding_secret.setter + def onboarding_secret(self, onboarding_secret: str): + """Sets the onboarding_secret of this OnboardingInformation. + + The API Invoker's onboarding secret, provided by the CAPIF core function. # noqa: E501 + + :param onboarding_secret: The onboarding_secret of this OnboardingInformation. + :type onboarding_secret: str + """ + + self._onboarding_secret = onboarding_secret diff --git a/services/helper/helper_service/services/api/models/operation.py b/services/helper/helper_service/services/api/models/operation.py new file mode 100644 index 0000000000000000000000000000000000000000..e081461bf6515aea94c6747b96e83777169caf51 --- /dev/null +++ b/services/helper/helper_service/services/api/models/operation.py @@ -0,0 +1,33 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model + + +class Operation(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self): # noqa: E501 + """Operation - a model defined in OpenAPI + + """ + self.openapi_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'Operation': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The Operation of this Operation. # noqa: E501 + :rtype: Operation + """ + return util.deserialize_model(dikt, cls) diff --git a/services/helper/helper_service/services/api/models/paginated_response_base.py b/services/helper/helper_service/services/api/models/paginated_response_base.py new file mode 100644 index 0000000000000000000000000000000000000000..be72e6a9710450dc48ff4fff1086e64c472670a9 --- /dev/null +++ b/services/helper/helper_service/services/api/models/paginated_response_base.py @@ -0,0 +1,152 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model + + +class PaginatedResponseBase(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, total=None, long=None, total_pages=None, sort_order=None): # noqa: E501 + """PaginatedResponseBase - a model defined in OpenAPI + + :param total: The total of this PaginatedResponseBase. # noqa: E501 + :type total: int + :param long: The long of this PaginatedResponseBase. # noqa: E501 + :type long: int + :param total_pages: The total_pages of this PaginatedResponseBase. # noqa: E501 + :type total_pages: int + :param sort_order: The sort_order of this PaginatedResponseBase. # noqa: E501 + :type sort_order: str + """ + self.openapi_types = { + 'total': int, + 'long': int, + 'total_pages': int, + 'sort_order': str + } + + self.attribute_map = { + 'total': 'total', + 'long': 'long', + 'total_pages': 'totalPages', + 'sort_order': 'sort_order' + } + + self._total = total + self._long = long + self._total_pages = total_pages + self._sort_order = sort_order + + @classmethod + def from_dict(cls, dikt) -> 'PaginatedResponseBase': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The PaginatedResponseBase of this PaginatedResponseBase. # noqa: E501 + :rtype: PaginatedResponseBase + """ + return util.deserialize_model(dikt, cls) + + @property + def total(self) -> int: + """Gets the total of this PaginatedResponseBase. + + Total number of resources in CAPIF. # noqa: E501 + + :return: The total of this PaginatedResponseBase. + :rtype: int + """ + return self._total + + @total.setter + def total(self, total: int): + """Sets the total of this PaginatedResponseBase. + + Total number of resources in CAPIF. # noqa: E501 + + :param total: The total of this PaginatedResponseBase. + :type total: int + """ + + self._total = total + + @property + def long(self) -> int: + """Gets the long of this PaginatedResponseBase. + + Total number of resources that match the given parameters # noqa: E501 + + :return: The long of this PaginatedResponseBase. + :rtype: int + """ + return self._long + + @long.setter + def long(self, long: int): + """Sets the long of this PaginatedResponseBase. + + Total number of resources that match the given parameters # noqa: E501 + + :param long: The long of this PaginatedResponseBase. + :type long: int + """ + + self._long = long + + @property + def total_pages(self) -> int: + """Gets the total_pages of this PaginatedResponseBase. + + Total number of pages given page size. # noqa: E501 + + :return: The total_pages of this PaginatedResponseBase. + :rtype: int + """ + return self._total_pages + + @total_pages.setter + def total_pages(self, total_pages: int): + """Sets the total_pages of this PaginatedResponseBase. + + Total number of pages given page size. # noqa: E501 + + :param total_pages: The total_pages of this PaginatedResponseBase. + :type total_pages: int + """ + + self._total_pages = total_pages + + @property + def sort_order(self) -> str: + """Gets the sort_order of this PaginatedResponseBase. + + Sorting by creation date of the resources (ascending or descending). # noqa: E501 + + :return: The sort_order of this PaginatedResponseBase. + :rtype: str + """ + return self._sort_order + + @sort_order.setter + def sort_order(self, sort_order: str): + """Sets the sort_order of this PaginatedResponseBase. + + Sorting by creation date of the resources (ascending or descending). # noqa: E501 + + :param sort_order: The sort_order of this PaginatedResponseBase. + :type sort_order: str + """ + allowed_values = ["asc", "desc"] # noqa: E501 + if sort_order not in allowed_values: + raise ValueError( + "Invalid value for `sort_order` ({0}), must be one of {1}" + .format(sort_order, allowed_values) + ) + + self._sort_order = sort_order diff --git a/services/helper/helper_service/services/api/models/paginated_response_event.py b/services/helper/helper_service/services/api/models/paginated_response_event.py new file mode 100644 index 0000000000000000000000000000000000000000..dd0c96020435b740055ea64ddb756bce7faa16d3 --- /dev/null +++ b/services/helper/helper_service/services/api/models/paginated_response_event.py @@ -0,0 +1,181 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model +from api.models.event_subscription import EventSubscription # noqa: E501 + + +class PaginatedResponseEvent(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, total=None, long=None, total_pages=None, sort_order=None, events=None): # noqa: E501 + """PaginatedResponseEvent - a model defined in OpenAPI + + :param total: The total of this PaginatedResponseEvent. # noqa: E501 + :type total: int + :param long: The long of this PaginatedResponseEvent. # noqa: E501 + :type long: int + :param total_pages: The total_pages of this PaginatedResponseEvent. # noqa: E501 + :type total_pages: int + :param sort_order: The sort_order of this PaginatedResponseEvent. # noqa: E501 + :type sort_order: str + :param events: The events of this PaginatedResponseEvent. # noqa: E501 + :type events: List[EventSubscription] + """ + self.openapi_types = { + 'total': int, + 'long': int, + 'total_pages': int, + 'sort_order': str, + 'events': List[EventSubscription] + } + + self.attribute_map = { + 'total': 'total', + 'long': 'long', + 'total_pages': 'totalPages', + 'sort_order': 'sort_order', + 'events': 'events' + } + + self._total = total + self._long = long + self._total_pages = total_pages + self._sort_order = sort_order + self._events = events + + @classmethod + def from_dict(cls, dikt) -> 'PaginatedResponseEvent': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The PaginatedResponseEvent of this PaginatedResponseEvent. # noqa: E501 + :rtype: PaginatedResponseEvent + """ + return util.deserialize_model(dikt, cls) + + @property + def total(self) -> int: + """Gets the total of this PaginatedResponseEvent. + + Total number of resources in CAPIF. # noqa: E501 + + :return: The total of this PaginatedResponseEvent. + :rtype: int + """ + return self._total + + @total.setter + def total(self, total: int): + """Sets the total of this PaginatedResponseEvent. + + Total number of resources in CAPIF. # noqa: E501 + + :param total: The total of this PaginatedResponseEvent. + :type total: int + """ + + self._total = total + + @property + def long(self) -> int: + """Gets the long of this PaginatedResponseEvent. + + Total number of resources that match the given parameters # noqa: E501 + + :return: The long of this PaginatedResponseEvent. + :rtype: int + """ + return self._long + + @long.setter + def long(self, long: int): + """Sets the long of this PaginatedResponseEvent. + + Total number of resources that match the given parameters # noqa: E501 + + :param long: The long of this PaginatedResponseEvent. + :type long: int + """ + + self._long = long + + @property + def total_pages(self) -> int: + """Gets the total_pages of this PaginatedResponseEvent. + + Total number of pages given page size. # noqa: E501 + + :return: The total_pages of this PaginatedResponseEvent. + :rtype: int + """ + return self._total_pages + + @total_pages.setter + def total_pages(self, total_pages: int): + """Sets the total_pages of this PaginatedResponseEvent. + + Total number of pages given page size. # noqa: E501 + + :param total_pages: The total_pages of this PaginatedResponseEvent. + :type total_pages: int + """ + + self._total_pages = total_pages + + @property + def sort_order(self) -> str: + """Gets the sort_order of this PaginatedResponseEvent. + + Sorting by creation date of the resources (ascending or descending). # noqa: E501 + + :return: The sort_order of this PaginatedResponseEvent. + :rtype: str + """ + return self._sort_order + + @sort_order.setter + def sort_order(self, sort_order: str): + """Sets the sort_order of this PaginatedResponseEvent. + + Sorting by creation date of the resources (ascending or descending). # noqa: E501 + + :param sort_order: The sort_order of this PaginatedResponseEvent. + :type sort_order: str + """ + allowed_values = ["asc", "desc"] # noqa: E501 + if sort_order not in allowed_values: + raise ValueError( + "Invalid value for `sort_order` ({0}), must be one of {1}" + .format(sort_order, allowed_values) + ) + + self._sort_order = sort_order + + @property + def events(self) -> List[EventSubscription]: + """Gets the events of this PaginatedResponseEvent. + + CAPIF events list. # noqa: E501 + + :return: The events of this PaginatedResponseEvent. + :rtype: List[EventSubscription] + """ + return self._events + + @events.setter + def events(self, events: List[EventSubscription]): + """Sets the events of this PaginatedResponseEvent. + + CAPIF events list. # noqa: E501 + + :param events: The events of this PaginatedResponseEvent. + :type events: List[EventSubscription] + """ + + self._events = events diff --git a/services/helper/helper_service/services/api/models/paginated_response_invoker.py b/services/helper/helper_service/services/api/models/paginated_response_invoker.py new file mode 100644 index 0000000000000000000000000000000000000000..2bef346b75d876d4b9c65029afdecc7eee1a67f4 --- /dev/null +++ b/services/helper/helper_service/services/api/models/paginated_response_invoker.py @@ -0,0 +1,182 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.api_invoker_enrolment_details import \ + APIInvokerEnrolmentDetails # noqa: E501 +from api.models.base_model import Model + + +class PaginatedResponseInvoker(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, total=None, long=None, total_pages=None, sort_order=None, invokers=None): # noqa: E501 + """PaginatedResponseInvoker - a model defined in OpenAPI + + :param total: The total of this PaginatedResponseInvoker. # noqa: E501 + :type total: int + :param long: The long of this PaginatedResponseInvoker. # noqa: E501 + :type long: int + :param total_pages: The total_pages of this PaginatedResponseInvoker. # noqa: E501 + :type total_pages: int + :param sort_order: The sort_order of this PaginatedResponseInvoker. # noqa: E501 + :type sort_order: str + :param invokers: The invokers of this PaginatedResponseInvoker. # noqa: E501 + :type invokers: List[APIInvokerEnrolmentDetails] + """ + self.openapi_types = { + 'total': int, + 'long': int, + 'total_pages': int, + 'sort_order': str, + 'invokers': List[APIInvokerEnrolmentDetails] + } + + self.attribute_map = { + 'total': 'total', + 'long': 'long', + 'total_pages': 'totalPages', + 'sort_order': 'sort_order', + 'invokers': 'invokers' + } + + self._total = total + self._long = long + self._total_pages = total_pages + self._sort_order = sort_order + self._invokers = invokers + + @classmethod + def from_dict(cls, dikt) -> 'PaginatedResponseInvoker': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The PaginatedResponseInvoker of this PaginatedResponseInvoker. # noqa: E501 + :rtype: PaginatedResponseInvoker + """ + return util.deserialize_model(dikt, cls) + + @property + def total(self) -> int: + """Gets the total of this PaginatedResponseInvoker. + + Total number of resources in CAPIF. # noqa: E501 + + :return: The total of this PaginatedResponseInvoker. + :rtype: int + """ + return self._total + + @total.setter + def total(self, total: int): + """Sets the total of this PaginatedResponseInvoker. + + Total number of resources in CAPIF. # noqa: E501 + + :param total: The total of this PaginatedResponseInvoker. + :type total: int + """ + + self._total = total + + @property + def long(self) -> int: + """Gets the long of this PaginatedResponseInvoker. + + Total number of resources that match the given parameters # noqa: E501 + + :return: The long of this PaginatedResponseInvoker. + :rtype: int + """ + return self._long + + @long.setter + def long(self, long: int): + """Sets the long of this PaginatedResponseInvoker. + + Total number of resources that match the given parameters # noqa: E501 + + :param long: The long of this PaginatedResponseInvoker. + :type long: int + """ + + self._long = long + + @property + def total_pages(self) -> int: + """Gets the total_pages of this PaginatedResponseInvoker. + + Total number of pages given page size. # noqa: E501 + + :return: The total_pages of this PaginatedResponseInvoker. + :rtype: int + """ + return self._total_pages + + @total_pages.setter + def total_pages(self, total_pages: int): + """Sets the total_pages of this PaginatedResponseInvoker. + + Total number of pages given page size. # noqa: E501 + + :param total_pages: The total_pages of this PaginatedResponseInvoker. + :type total_pages: int + """ + + self._total_pages = total_pages + + @property + def sort_order(self) -> str: + """Gets the sort_order of this PaginatedResponseInvoker. + + Sorting by creation date of the resources (ascending or descending). # noqa: E501 + + :return: The sort_order of this PaginatedResponseInvoker. + :rtype: str + """ + return self._sort_order + + @sort_order.setter + def sort_order(self, sort_order: str): + """Sets the sort_order of this PaginatedResponseInvoker. + + Sorting by creation date of the resources (ascending or descending). # noqa: E501 + + :param sort_order: The sort_order of this PaginatedResponseInvoker. + :type sort_order: str + """ + allowed_values = ["asc", "desc"] # noqa: E501 + if sort_order not in allowed_values: + raise ValueError( + "Invalid value for `sort_order` ({0}), must be one of {1}" + .format(sort_order, allowed_values) + ) + + self._sort_order = sort_order + + @property + def invokers(self) -> List[APIInvokerEnrolmentDetails]: + """Gets the invokers of this PaginatedResponseInvoker. + + CAPIF invokers list # noqa: E501 + + :return: The invokers of this PaginatedResponseInvoker. + :rtype: List[APIInvokerEnrolmentDetails] + """ + return self._invokers + + @invokers.setter + def invokers(self, invokers: List[APIInvokerEnrolmentDetails]): + """Sets the invokers of this PaginatedResponseInvoker. + + CAPIF invokers list # noqa: E501 + + :param invokers: The invokers of this PaginatedResponseInvoker. + :type invokers: List[APIInvokerEnrolmentDetails] + """ + + self._invokers = invokers diff --git a/services/helper/helper_service/services/api/models/paginated_response_provider.py b/services/helper/helper_service/services/api/models/paginated_response_provider.py new file mode 100644 index 0000000000000000000000000000000000000000..277632afe206521551e571ca95b8fc6a2515aa3d --- /dev/null +++ b/services/helper/helper_service/services/api/models/paginated_response_provider.py @@ -0,0 +1,182 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.api_provider_enrolment_details import \ + APIProviderEnrolmentDetails # noqa: E501 +from api.models.base_model import Model + + +class PaginatedResponseProvider(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, total=None, long=None, total_pages=None, sort_order=None, providers=None): # noqa: E501 + """PaginatedResponseProvider - a model defined in OpenAPI + + :param total: The total of this PaginatedResponseProvider. # noqa: E501 + :type total: int + :param long: The long of this PaginatedResponseProvider. # noqa: E501 + :type long: int + :param total_pages: The total_pages of this PaginatedResponseProvider. # noqa: E501 + :type total_pages: int + :param sort_order: The sort_order of this PaginatedResponseProvider. # noqa: E501 + :type sort_order: str + :param providers: The providers of this PaginatedResponseProvider. # noqa: E501 + :type providers: List[APIProviderEnrolmentDetails] + """ + self.openapi_types = { + 'total': int, + 'long': int, + 'total_pages': int, + 'sort_order': str, + 'providers': List[APIProviderEnrolmentDetails] + } + + self.attribute_map = { + 'total': 'total', + 'long': 'long', + 'total_pages': 'totalPages', + 'sort_order': 'sort_order', + 'providers': 'providers' + } + + self._total = total + self._long = long + self._total_pages = total_pages + self._sort_order = sort_order + self._providers = providers + + @classmethod + def from_dict(cls, dikt) -> 'PaginatedResponseProvider': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The PaginatedResponseProvider of this PaginatedResponseProvider. # noqa: E501 + :rtype: PaginatedResponseProvider + """ + return util.deserialize_model(dikt, cls) + + @property + def total(self) -> int: + """Gets the total of this PaginatedResponseProvider. + + Total number of resources in CAPIF. # noqa: E501 + + :return: The total of this PaginatedResponseProvider. + :rtype: int + """ + return self._total + + @total.setter + def total(self, total: int): + """Sets the total of this PaginatedResponseProvider. + + Total number of resources in CAPIF. # noqa: E501 + + :param total: The total of this PaginatedResponseProvider. + :type total: int + """ + + self._total = total + + @property + def long(self) -> int: + """Gets the long of this PaginatedResponseProvider. + + Total number of resources that match the given parameters # noqa: E501 + + :return: The long of this PaginatedResponseProvider. + :rtype: int + """ + return self._long + + @long.setter + def long(self, long: int): + """Sets the long of this PaginatedResponseProvider. + + Total number of resources that match the given parameters # noqa: E501 + + :param long: The long of this PaginatedResponseProvider. + :type long: int + """ + + self._long = long + + @property + def total_pages(self) -> int: + """Gets the total_pages of this PaginatedResponseProvider. + + Total number of pages given page size. # noqa: E501 + + :return: The total_pages of this PaginatedResponseProvider. + :rtype: int + """ + return self._total_pages + + @total_pages.setter + def total_pages(self, total_pages: int): + """Sets the total_pages of this PaginatedResponseProvider. + + Total number of pages given page size. # noqa: E501 + + :param total_pages: The total_pages of this PaginatedResponseProvider. + :type total_pages: int + """ + + self._total_pages = total_pages + + @property + def sort_order(self) -> str: + """Gets the sort_order of this PaginatedResponseProvider. + + Sorting by creation date of the resources (ascending or descending). # noqa: E501 + + :return: The sort_order of this PaginatedResponseProvider. + :rtype: str + """ + return self._sort_order + + @sort_order.setter + def sort_order(self, sort_order: str): + """Sets the sort_order of this PaginatedResponseProvider. + + Sorting by creation date of the resources (ascending or descending). # noqa: E501 + + :param sort_order: The sort_order of this PaginatedResponseProvider. + :type sort_order: str + """ + allowed_values = ["asc", "desc"] # noqa: E501 + if sort_order not in allowed_values: + raise ValueError( + "Invalid value for `sort_order` ({0}), must be one of {1}" + .format(sort_order, allowed_values) + ) + + self._sort_order = sort_order + + @property + def providers(self) -> List[APIProviderEnrolmentDetails]: + """Gets the providers of this PaginatedResponseProvider. + + CAPIF providers list # noqa: E501 + + :return: The providers of this PaginatedResponseProvider. + :rtype: List[APIProviderEnrolmentDetails] + """ + return self._providers + + @providers.setter + def providers(self, providers: List[APIProviderEnrolmentDetails]): + """Sets the providers of this PaginatedResponseProvider. + + CAPIF providers list # noqa: E501 + + :param providers: The providers of this PaginatedResponseProvider. + :type providers: List[APIProviderEnrolmentDetails] + """ + + self._providers = providers diff --git a/services/helper/helper_service/services/api/models/paginated_response_security.py b/services/helper/helper_service/services/api/models/paginated_response_security.py new file mode 100644 index 0000000000000000000000000000000000000000..070416db256ebf839dee62d4eaac9571df34e0ed --- /dev/null +++ b/services/helper/helper_service/services/api/models/paginated_response_security.py @@ -0,0 +1,181 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model +from api.models.service_security import ServiceSecurity # noqa: E501 + + +class PaginatedResponseSecurity(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, total=None, long=None, total_pages=None, sort_order=None, security=None): # noqa: E501 + """PaginatedResponseSecurity - a model defined in OpenAPI + + :param total: The total of this PaginatedResponseSecurity. # noqa: E501 + :type total: int + :param long: The long of this PaginatedResponseSecurity. # noqa: E501 + :type long: int + :param total_pages: The total_pages of this PaginatedResponseSecurity. # noqa: E501 + :type total_pages: int + :param sort_order: The sort_order of this PaginatedResponseSecurity. # noqa: E501 + :type sort_order: str + :param security: The security of this PaginatedResponseSecurity. # noqa: E501 + :type security: List[ServiceSecurity] + """ + self.openapi_types = { + 'total': int, + 'long': int, + 'total_pages': int, + 'sort_order': str, + 'security': List[ServiceSecurity] + } + + self.attribute_map = { + 'total': 'total', + 'long': 'long', + 'total_pages': 'totalPages', + 'sort_order': 'sort_order', + 'security': 'security' + } + + self._total = total + self._long = long + self._total_pages = total_pages + self._sort_order = sort_order + self._security = security + + @classmethod + def from_dict(cls, dikt) -> 'PaginatedResponseSecurity': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The PaginatedResponseSecurity of this PaginatedResponseSecurity. # noqa: E501 + :rtype: PaginatedResponseSecurity + """ + return util.deserialize_model(dikt, cls) + + @property + def total(self) -> int: + """Gets the total of this PaginatedResponseSecurity. + + Total number of resources in CAPIF. # noqa: E501 + + :return: The total of this PaginatedResponseSecurity. + :rtype: int + """ + return self._total + + @total.setter + def total(self, total: int): + """Sets the total of this PaginatedResponseSecurity. + + Total number of resources in CAPIF. # noqa: E501 + + :param total: The total of this PaginatedResponseSecurity. + :type total: int + """ + + self._total = total + + @property + def long(self) -> int: + """Gets the long of this PaginatedResponseSecurity. + + Total number of resources that match the given parameters # noqa: E501 + + :return: The long of this PaginatedResponseSecurity. + :rtype: int + """ + return self._long + + @long.setter + def long(self, long: int): + """Sets the long of this PaginatedResponseSecurity. + + Total number of resources that match the given parameters # noqa: E501 + + :param long: The long of this PaginatedResponseSecurity. + :type long: int + """ + + self._long = long + + @property + def total_pages(self) -> int: + """Gets the total_pages of this PaginatedResponseSecurity. + + Total number of pages given page size. # noqa: E501 + + :return: The total_pages of this PaginatedResponseSecurity. + :rtype: int + """ + return self._total_pages + + @total_pages.setter + def total_pages(self, total_pages: int): + """Sets the total_pages of this PaginatedResponseSecurity. + + Total number of pages given page size. # noqa: E501 + + :param total_pages: The total_pages of this PaginatedResponseSecurity. + :type total_pages: int + """ + + self._total_pages = total_pages + + @property + def sort_order(self) -> str: + """Gets the sort_order of this PaginatedResponseSecurity. + + Sorting by creation date of the resources (ascending or descending). # noqa: E501 + + :return: The sort_order of this PaginatedResponseSecurity. + :rtype: str + """ + return self._sort_order + + @sort_order.setter + def sort_order(self, sort_order: str): + """Sets the sort_order of this PaginatedResponseSecurity. + + Sorting by creation date of the resources (ascending or descending). # noqa: E501 + + :param sort_order: The sort_order of this PaginatedResponseSecurity. + :type sort_order: str + """ + allowed_values = ["asc", "desc"] # noqa: E501 + if sort_order not in allowed_values: + raise ValueError( + "Invalid value for `sort_order` ({0}), must be one of {1}" + .format(sort_order, allowed_values) + ) + + self._sort_order = sort_order + + @property + def security(self) -> List[ServiceSecurity]: + """Gets the security of this PaginatedResponseSecurity. + + CAPIF security context list. # noqa: E501 + + :return: The security of this PaginatedResponseSecurity. + :rtype: List[ServiceSecurity] + """ + return self._security + + @security.setter + def security(self, security: List[ServiceSecurity]): + """Sets the security of this PaginatedResponseSecurity. + + CAPIF security context list. # noqa: E501 + + :param security: The security of this PaginatedResponseSecurity. + :type security: List[ServiceSecurity] + """ + + self._security = security diff --git a/services/helper/helper_service/services/api/models/paginated_response_service.py b/services/helper/helper_service/services/api/models/paginated_response_service.py new file mode 100644 index 0000000000000000000000000000000000000000..e1ea68f4093b186250ca19282d007096c1fc6667 --- /dev/null +++ b/services/helper/helper_service/services/api/models/paginated_response_service.py @@ -0,0 +1,182 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model +from api.models.service_api_description import \ + ServiceAPIDescription # noqa: E501 + + +class PaginatedResponseService(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, total=None, long=None, total_pages=None, sort_order=None, services=None): # noqa: E501 + """PaginatedResponseService - a model defined in OpenAPI + + :param total: The total of this PaginatedResponseService. # noqa: E501 + :type total: int + :param long: The long of this PaginatedResponseService. # noqa: E501 + :type long: int + :param total_pages: The total_pages of this PaginatedResponseService. # noqa: E501 + :type total_pages: int + :param sort_order: The sort_order of this PaginatedResponseService. # noqa: E501 + :type sort_order: str + :param services: The services of this PaginatedResponseService. # noqa: E501 + :type services: List[ServiceAPIDescription] + """ + self.openapi_types = { + 'total': int, + 'long': int, + 'total_pages': int, + 'sort_order': str, + 'services': List[ServiceAPIDescription] + } + + self.attribute_map = { + 'total': 'total', + 'long': 'long', + 'total_pages': 'totalPages', + 'sort_order': 'sort_order', + 'services': 'services' + } + + self._total = total + self._long = long + self._total_pages = total_pages + self._sort_order = sort_order + self._services = services + + @classmethod + def from_dict(cls, dikt) -> 'PaginatedResponseService': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The PaginatedResponseService of this PaginatedResponseService. # noqa: E501 + :rtype: PaginatedResponseService + """ + return util.deserialize_model(dikt, cls) + + @property + def total(self) -> int: + """Gets the total of this PaginatedResponseService. + + Total number of resources in CAPIF. # noqa: E501 + + :return: The total of this PaginatedResponseService. + :rtype: int + """ + return self._total + + @total.setter + def total(self, total: int): + """Sets the total of this PaginatedResponseService. + + Total number of resources in CAPIF. # noqa: E501 + + :param total: The total of this PaginatedResponseService. + :type total: int + """ + + self._total = total + + @property + def long(self) -> int: + """Gets the long of this PaginatedResponseService. + + Total number of resources that match the given parameters # noqa: E501 + + :return: The long of this PaginatedResponseService. + :rtype: int + """ + return self._long + + @long.setter + def long(self, long: int): + """Sets the long of this PaginatedResponseService. + + Total number of resources that match the given parameters # noqa: E501 + + :param long: The long of this PaginatedResponseService. + :type long: int + """ + + self._long = long + + @property + def total_pages(self) -> int: + """Gets the total_pages of this PaginatedResponseService. + + Total number of pages given page size. # noqa: E501 + + :return: The total_pages of this PaginatedResponseService. + :rtype: int + """ + return self._total_pages + + @total_pages.setter + def total_pages(self, total_pages: int): + """Sets the total_pages of this PaginatedResponseService. + + Total number of pages given page size. # noqa: E501 + + :param total_pages: The total_pages of this PaginatedResponseService. + :type total_pages: int + """ + + self._total_pages = total_pages + + @property + def sort_order(self) -> str: + """Gets the sort_order of this PaginatedResponseService. + + Sorting by creation date of the resources (ascending or descending). # noqa: E501 + + :return: The sort_order of this PaginatedResponseService. + :rtype: str + """ + return self._sort_order + + @sort_order.setter + def sort_order(self, sort_order: str): + """Sets the sort_order of this PaginatedResponseService. + + Sorting by creation date of the resources (ascending or descending). # noqa: E501 + + :param sort_order: The sort_order of this PaginatedResponseService. + :type sort_order: str + """ + allowed_values = ["asc", "desc"] # noqa: E501 + if sort_order not in allowed_values: + raise ValueError( + "Invalid value for `sort_order` ({0}), must be one of {1}" + .format(sort_order, allowed_values) + ) + + self._sort_order = sort_order + + @property + def services(self) -> List[ServiceAPIDescription]: + """Gets the services of this PaginatedResponseService. + + CAPIF services list. # noqa: E501 + + :return: The services of this PaginatedResponseService. + :rtype: List[ServiceAPIDescription] + """ + return self._services + + @services.setter + def services(self, services: List[ServiceAPIDescription]): + """Sets the services of this PaginatedResponseService. + + CAPIF services list. # noqa: E501 + + :param services: The services of this PaginatedResponseService. + :type services: List[ServiceAPIDescription] + """ + + self._services = services diff --git a/services/helper/helper_service/services/api/models/partitioning_criteria.py b/services/helper/helper_service/services/api/models/partitioning_criteria.py new file mode 100644 index 0000000000000000000000000000000000000000..6908835cebc6f71bab2352438951d512e329d564 --- /dev/null +++ b/services/helper/helper_service/services/api/models/partitioning_criteria.py @@ -0,0 +1,33 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model + + +class PartitioningCriteria(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self): # noqa: E501 + """PartitioningCriteria - a model defined in OpenAPI + + """ + self.openapi_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'PartitioningCriteria': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The PartitioningCriteria of this PartitioningCriteria. # noqa: E501 + :rtype: PartitioningCriteria + """ + return util.deserialize_model(dikt, cls) diff --git a/services/helper/helper_service/services/api/models/point.py b/services/helper/helper_service/services/api/models/point.py new file mode 100644 index 0000000000000000000000000000000000000000..1468812f4c8d5d56d25f18b08e0b513fae324d85 --- /dev/null +++ b/services/helper/helper_service/services/api/models/point.py @@ -0,0 +1,94 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model +from api.models.gad_shape import GADShape # noqa: E501 +from api.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from api.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 + + +class Point(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, shape=None, point=None): # noqa: E501 + """Point - a model defined in OpenAPI + + :param shape: The shape of this Point. # noqa: E501 + :type shape: SupportedGADShapes + :param point: The point of this Point. # noqa: E501 + :type point: GeographicalCoordinates + """ + self.openapi_types = { + 'shape': SupportedGADShapes, + 'point': GeographicalCoordinates + } + + self.attribute_map = { + 'shape': 'shape', + 'point': 'point' + } + + self._shape = shape + self._point = point + + @classmethod + def from_dict(cls, dikt) -> 'Point': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The Point of this Point. # noqa: E501 + :rtype: Point + """ + return util.deserialize_model(dikt, cls) + + @property + def shape(self) -> SupportedGADShapes: + """Gets the shape of this Point. + + + :return: The shape of this Point. + :rtype: SupportedGADShapes + """ + return self._shape + + @shape.setter + def shape(self, shape: SupportedGADShapes): + """Sets the shape of this Point. + + + :param shape: The shape of this Point. + :type shape: SupportedGADShapes + """ + if shape is None: + raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 + + self._shape = shape + + @property + def point(self) -> GeographicalCoordinates: + """Gets the point of this Point. + + + :return: The point of this Point. + :rtype: GeographicalCoordinates + """ + return self._point + + @point.setter + def point(self, point: GeographicalCoordinates): + """Sets the point of this Point. + + + :param point: The point of this Point. + :type point: GeographicalCoordinates + """ + if point is None: + raise ValueError("Invalid value for `point`, must not be `None`") # noqa: E501 + + self._point = point diff --git a/services/helper/helper_service/services/api/models/point_altitude.py b/services/helper/helper_service/services/api/models/point_altitude.py new file mode 100644 index 0000000000000000000000000000000000000000..74de994c7bc635939fdf833719ed9beadb81e860 --- /dev/null +++ b/services/helper/helper_service/services/api/models/point_altitude.py @@ -0,0 +1,128 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model +from api.models.gad_shape import GADShape # noqa: E501 +from api.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from api.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 + + +class PointAltitude(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, shape=None, point=None, altitude=None): # noqa: E501 + """PointAltitude - a model defined in OpenAPI + + :param shape: The shape of this PointAltitude. # noqa: E501 + :type shape: SupportedGADShapes + :param point: The point of this PointAltitude. # noqa: E501 + :type point: GeographicalCoordinates + :param altitude: The altitude of this PointAltitude. # noqa: E501 + :type altitude: float + """ + self.openapi_types = { + 'shape': SupportedGADShapes, + 'point': GeographicalCoordinates, + 'altitude': float + } + + self.attribute_map = { + 'shape': 'shape', + 'point': 'point', + 'altitude': 'altitude' + } + + self._shape = shape + self._point = point + self._altitude = altitude + + @classmethod + def from_dict(cls, dikt) -> 'PointAltitude': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The PointAltitude of this PointAltitude. # noqa: E501 + :rtype: PointAltitude + """ + return util.deserialize_model(dikt, cls) + + @property + def shape(self) -> SupportedGADShapes: + """Gets the shape of this PointAltitude. + + + :return: The shape of this PointAltitude. + :rtype: SupportedGADShapes + """ + return self._shape + + @shape.setter + def shape(self, shape: SupportedGADShapes): + """Sets the shape of this PointAltitude. + + + :param shape: The shape of this PointAltitude. + :type shape: SupportedGADShapes + """ + if shape is None: + raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 + + self._shape = shape + + @property + def point(self) -> GeographicalCoordinates: + """Gets the point of this PointAltitude. + + + :return: The point of this PointAltitude. + :rtype: GeographicalCoordinates + """ + return self._point + + @point.setter + def point(self, point: GeographicalCoordinates): + """Sets the point of this PointAltitude. + + + :param point: The point of this PointAltitude. + :type point: GeographicalCoordinates + """ + if point is None: + raise ValueError("Invalid value for `point`, must not be `None`") # noqa: E501 + + self._point = point + + @property + def altitude(self) -> float: + """Gets the altitude of this PointAltitude. + + Indicates value of altitude. # noqa: E501 + + :return: The altitude of this PointAltitude. + :rtype: float + """ + return self._altitude + + @altitude.setter + def altitude(self, altitude: float): + """Sets the altitude of this PointAltitude. + + Indicates value of altitude. # noqa: E501 + + :param altitude: The altitude of this PointAltitude. + :type altitude: float + """ + if altitude is None: + raise ValueError("Invalid value for `altitude`, must not be `None`") # noqa: E501 + if altitude is not None and altitude > 32767: # noqa: E501 + raise ValueError("Invalid value for `altitude`, must be a value less than or equal to `32767`") # noqa: E501 + if altitude is not None and altitude < -32767: # noqa: E501 + raise ValueError("Invalid value for `altitude`, must be a value greater than or equal to `-32767`") # noqa: E501 + + self._altitude = altitude diff --git a/services/helper/helper_service/services/api/models/point_altitude_uncertainty.py b/services/helper/helper_service/services/api/models/point_altitude_uncertainty.py new file mode 100644 index 0000000000000000000000000000000000000000..1bd39c27d216c96717e98101684c2449fc1b2efd --- /dev/null +++ b/services/helper/helper_service/services/api/models/point_altitude_uncertainty.py @@ -0,0 +1,223 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model +from api.models.gad_shape import GADShape # noqa: E501 +from api.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from api.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 +from api.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 + + +class PointAltitudeUncertainty(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, shape=None, point=None, altitude=None, uncertainty_ellipse=None, uncertainty_altitude=None, confidence=None): # noqa: E501 + """PointAltitudeUncertainty - a model defined in OpenAPI + + :param shape: The shape of this PointAltitudeUncertainty. # noqa: E501 + :type shape: SupportedGADShapes + :param point: The point of this PointAltitudeUncertainty. # noqa: E501 + :type point: GeographicalCoordinates + :param altitude: The altitude of this PointAltitudeUncertainty. # noqa: E501 + :type altitude: float + :param uncertainty_ellipse: The uncertainty_ellipse of this PointAltitudeUncertainty. # noqa: E501 + :type uncertainty_ellipse: UncertaintyEllipse + :param uncertainty_altitude: The uncertainty_altitude of this PointAltitudeUncertainty. # noqa: E501 + :type uncertainty_altitude: float + :param confidence: The confidence of this PointAltitudeUncertainty. # noqa: E501 + :type confidence: int + """ + self.openapi_types = { + 'shape': SupportedGADShapes, + 'point': GeographicalCoordinates, + 'altitude': float, + 'uncertainty_ellipse': UncertaintyEllipse, + 'uncertainty_altitude': float, + 'confidence': int + } + + self.attribute_map = { + 'shape': 'shape', + 'point': 'point', + 'altitude': 'altitude', + 'uncertainty_ellipse': 'uncertaintyEllipse', + 'uncertainty_altitude': 'uncertaintyAltitude', + 'confidence': 'confidence' + } + + self._shape = shape + self._point = point + self._altitude = altitude + self._uncertainty_ellipse = uncertainty_ellipse + self._uncertainty_altitude = uncertainty_altitude + self._confidence = confidence + + @classmethod + def from_dict(cls, dikt) -> 'PointAltitudeUncertainty': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The PointAltitudeUncertainty of this PointAltitudeUncertainty. # noqa: E501 + :rtype: PointAltitudeUncertainty + """ + return util.deserialize_model(dikt, cls) + + @property + def shape(self) -> SupportedGADShapes: + """Gets the shape of this PointAltitudeUncertainty. + + + :return: The shape of this PointAltitudeUncertainty. + :rtype: SupportedGADShapes + """ + return self._shape + + @shape.setter + def shape(self, shape: SupportedGADShapes): + """Sets the shape of this PointAltitudeUncertainty. + + + :param shape: The shape of this PointAltitudeUncertainty. + :type shape: SupportedGADShapes + """ + if shape is None: + raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 + + self._shape = shape + + @property + def point(self) -> GeographicalCoordinates: + """Gets the point of this PointAltitudeUncertainty. + + + :return: The point of this PointAltitudeUncertainty. + :rtype: GeographicalCoordinates + """ + return self._point + + @point.setter + def point(self, point: GeographicalCoordinates): + """Sets the point of this PointAltitudeUncertainty. + + + :param point: The point of this PointAltitudeUncertainty. + :type point: GeographicalCoordinates + """ + if point is None: + raise ValueError("Invalid value for `point`, must not be `None`") # noqa: E501 + + self._point = point + + @property + def altitude(self) -> float: + """Gets the altitude of this PointAltitudeUncertainty. + + Indicates value of altitude. # noqa: E501 + + :return: The altitude of this PointAltitudeUncertainty. + :rtype: float + """ + return self._altitude + + @altitude.setter + def altitude(self, altitude: float): + """Sets the altitude of this PointAltitudeUncertainty. + + Indicates value of altitude. # noqa: E501 + + :param altitude: The altitude of this PointAltitudeUncertainty. + :type altitude: float + """ + if altitude is None: + raise ValueError("Invalid value for `altitude`, must not be `None`") # noqa: E501 + if altitude is not None and altitude > 32767: # noqa: E501 + raise ValueError("Invalid value for `altitude`, must be a value less than or equal to `32767`") # noqa: E501 + if altitude is not None and altitude < -32767: # noqa: E501 + raise ValueError("Invalid value for `altitude`, must be a value greater than or equal to `-32767`") # noqa: E501 + + self._altitude = altitude + + @property + def uncertainty_ellipse(self) -> UncertaintyEllipse: + """Gets the uncertainty_ellipse of this PointAltitudeUncertainty. + + + :return: The uncertainty_ellipse of this PointAltitudeUncertainty. + :rtype: UncertaintyEllipse + """ + return self._uncertainty_ellipse + + @uncertainty_ellipse.setter + def uncertainty_ellipse(self, uncertainty_ellipse: UncertaintyEllipse): + """Sets the uncertainty_ellipse of this PointAltitudeUncertainty. + + + :param uncertainty_ellipse: The uncertainty_ellipse of this PointAltitudeUncertainty. + :type uncertainty_ellipse: UncertaintyEllipse + """ + if uncertainty_ellipse is None: + raise ValueError("Invalid value for `uncertainty_ellipse`, must not be `None`") # noqa: E501 + + self._uncertainty_ellipse = uncertainty_ellipse + + @property + def uncertainty_altitude(self) -> float: + """Gets the uncertainty_altitude of this PointAltitudeUncertainty. + + Indicates value of uncertainty. # noqa: E501 + + :return: The uncertainty_altitude of this PointAltitudeUncertainty. + :rtype: float + """ + return self._uncertainty_altitude + + @uncertainty_altitude.setter + def uncertainty_altitude(self, uncertainty_altitude: float): + """Sets the uncertainty_altitude of this PointAltitudeUncertainty. + + Indicates value of uncertainty. # noqa: E501 + + :param uncertainty_altitude: The uncertainty_altitude of this PointAltitudeUncertainty. + :type uncertainty_altitude: float + """ + if uncertainty_altitude is None: + raise ValueError("Invalid value for `uncertainty_altitude`, must not be `None`") # noqa: E501 + if uncertainty_altitude is not None and uncertainty_altitude < 0: # noqa: E501 + raise ValueError("Invalid value for `uncertainty_altitude`, must be a value greater than or equal to `0`") # noqa: E501 + + self._uncertainty_altitude = uncertainty_altitude + + @property + def confidence(self) -> int: + """Gets the confidence of this PointAltitudeUncertainty. + + Indicates value of confidence. # noqa: E501 + + :return: The confidence of this PointAltitudeUncertainty. + :rtype: int + """ + return self._confidence + + @confidence.setter + def confidence(self, confidence: int): + """Sets the confidence of this PointAltitudeUncertainty. + + Indicates value of confidence. # noqa: E501 + + :param confidence: The confidence of this PointAltitudeUncertainty. + :type confidence: int + """ + if confidence is None: + raise ValueError("Invalid value for `confidence`, must not be `None`") # noqa: E501 + if confidence is not None and confidence > 100: # noqa: E501 + raise ValueError("Invalid value for `confidence`, must be a value less than or equal to `100`") # noqa: E501 + if confidence is not None and confidence < 0: # noqa: E501 + raise ValueError("Invalid value for `confidence`, must be a value greater than or equal to `0`") # noqa: E501 + + self._confidence = confidence diff --git a/services/helper/helper_service/services/api/models/point_uncertainty_circle.py b/services/helper/helper_service/services/api/models/point_uncertainty_circle.py new file mode 100644 index 0000000000000000000000000000000000000000..de5057599339f45773691a6a5fb2477e4a73f508 --- /dev/null +++ b/services/helper/helper_service/services/api/models/point_uncertainty_circle.py @@ -0,0 +1,126 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model +from api.models.gad_shape import GADShape # noqa: E501 +from api.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from api.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 + + +class PointUncertaintyCircle(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, shape=None, point=None, uncertainty=None): # noqa: E501 + """PointUncertaintyCircle - a model defined in OpenAPI + + :param shape: The shape of this PointUncertaintyCircle. # noqa: E501 + :type shape: SupportedGADShapes + :param point: The point of this PointUncertaintyCircle. # noqa: E501 + :type point: GeographicalCoordinates + :param uncertainty: The uncertainty of this PointUncertaintyCircle. # noqa: E501 + :type uncertainty: float + """ + self.openapi_types = { + 'shape': SupportedGADShapes, + 'point': GeographicalCoordinates, + 'uncertainty': float + } + + self.attribute_map = { + 'shape': 'shape', + 'point': 'point', + 'uncertainty': 'uncertainty' + } + + self._shape = shape + self._point = point + self._uncertainty = uncertainty + + @classmethod + def from_dict(cls, dikt) -> 'PointUncertaintyCircle': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The PointUncertaintyCircle of this PointUncertaintyCircle. # noqa: E501 + :rtype: PointUncertaintyCircle + """ + return util.deserialize_model(dikt, cls) + + @property + def shape(self) -> SupportedGADShapes: + """Gets the shape of this PointUncertaintyCircle. + + + :return: The shape of this PointUncertaintyCircle. + :rtype: SupportedGADShapes + """ + return self._shape + + @shape.setter + def shape(self, shape: SupportedGADShapes): + """Sets the shape of this PointUncertaintyCircle. + + + :param shape: The shape of this PointUncertaintyCircle. + :type shape: SupportedGADShapes + """ + if shape is None: + raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 + + self._shape = shape + + @property + def point(self) -> GeographicalCoordinates: + """Gets the point of this PointUncertaintyCircle. + + + :return: The point of this PointUncertaintyCircle. + :rtype: GeographicalCoordinates + """ + return self._point + + @point.setter + def point(self, point: GeographicalCoordinates): + """Sets the point of this PointUncertaintyCircle. + + + :param point: The point of this PointUncertaintyCircle. + :type point: GeographicalCoordinates + """ + if point is None: + raise ValueError("Invalid value for `point`, must not be `None`") # noqa: E501 + + self._point = point + + @property + def uncertainty(self) -> float: + """Gets the uncertainty of this PointUncertaintyCircle. + + Indicates value of uncertainty. # noqa: E501 + + :return: The uncertainty of this PointUncertaintyCircle. + :rtype: float + """ + return self._uncertainty + + @uncertainty.setter + def uncertainty(self, uncertainty: float): + """Sets the uncertainty of this PointUncertaintyCircle. + + Indicates value of uncertainty. # noqa: E501 + + :param uncertainty: The uncertainty of this PointUncertaintyCircle. + :type uncertainty: float + """ + if uncertainty is None: + raise ValueError("Invalid value for `uncertainty`, must not be `None`") # noqa: E501 + if uncertainty is not None and uncertainty < 0: # noqa: E501 + raise ValueError("Invalid value for `uncertainty`, must be a value greater than or equal to `0`") # noqa: E501 + + self._uncertainty = uncertainty diff --git a/services/helper/helper_service/services/api/models/point_uncertainty_ellipse.py b/services/helper/helper_service/services/api/models/point_uncertainty_ellipse.py new file mode 100644 index 0000000000000000000000000000000000000000..55c25cb09ae5e906712eed578d303dc3141a46e1 --- /dev/null +++ b/services/helper/helper_service/services/api/models/point_uncertainty_ellipse.py @@ -0,0 +1,157 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model +from api.models.gad_shape import GADShape # noqa: E501 +from api.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from api.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 +from api.models.uncertainty_ellipse import UncertaintyEllipse # noqa: E501 + + +class PointUncertaintyEllipse(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, shape=None, point=None, uncertainty_ellipse=None, confidence=None): # noqa: E501 + """PointUncertaintyEllipse - a model defined in OpenAPI + + :param shape: The shape of this PointUncertaintyEllipse. # noqa: E501 + :type shape: SupportedGADShapes + :param point: The point of this PointUncertaintyEllipse. # noqa: E501 + :type point: GeographicalCoordinates + :param uncertainty_ellipse: The uncertainty_ellipse of this PointUncertaintyEllipse. # noqa: E501 + :type uncertainty_ellipse: UncertaintyEllipse + :param confidence: The confidence of this PointUncertaintyEllipse. # noqa: E501 + :type confidence: int + """ + self.openapi_types = { + 'shape': SupportedGADShapes, + 'point': GeographicalCoordinates, + 'uncertainty_ellipse': UncertaintyEllipse, + 'confidence': int + } + + self.attribute_map = { + 'shape': 'shape', + 'point': 'point', + 'uncertainty_ellipse': 'uncertaintyEllipse', + 'confidence': 'confidence' + } + + self._shape = shape + self._point = point + self._uncertainty_ellipse = uncertainty_ellipse + self._confidence = confidence + + @classmethod + def from_dict(cls, dikt) -> 'PointUncertaintyEllipse': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The PointUncertaintyEllipse of this PointUncertaintyEllipse. # noqa: E501 + :rtype: PointUncertaintyEllipse + """ + return util.deserialize_model(dikt, cls) + + @property + def shape(self) -> SupportedGADShapes: + """Gets the shape of this PointUncertaintyEllipse. + + + :return: The shape of this PointUncertaintyEllipse. + :rtype: SupportedGADShapes + """ + return self._shape + + @shape.setter + def shape(self, shape: SupportedGADShapes): + """Sets the shape of this PointUncertaintyEllipse. + + + :param shape: The shape of this PointUncertaintyEllipse. + :type shape: SupportedGADShapes + """ + if shape is None: + raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 + + self._shape = shape + + @property + def point(self) -> GeographicalCoordinates: + """Gets the point of this PointUncertaintyEllipse. + + + :return: The point of this PointUncertaintyEllipse. + :rtype: GeographicalCoordinates + """ + return self._point + + @point.setter + def point(self, point: GeographicalCoordinates): + """Sets the point of this PointUncertaintyEllipse. + + + :param point: The point of this PointUncertaintyEllipse. + :type point: GeographicalCoordinates + """ + if point is None: + raise ValueError("Invalid value for `point`, must not be `None`") # noqa: E501 + + self._point = point + + @property + def uncertainty_ellipse(self) -> UncertaintyEllipse: + """Gets the uncertainty_ellipse of this PointUncertaintyEllipse. + + + :return: The uncertainty_ellipse of this PointUncertaintyEllipse. + :rtype: UncertaintyEllipse + """ + return self._uncertainty_ellipse + + @uncertainty_ellipse.setter + def uncertainty_ellipse(self, uncertainty_ellipse: UncertaintyEllipse): + """Sets the uncertainty_ellipse of this PointUncertaintyEllipse. + + + :param uncertainty_ellipse: The uncertainty_ellipse of this PointUncertaintyEllipse. + :type uncertainty_ellipse: UncertaintyEllipse + """ + if uncertainty_ellipse is None: + raise ValueError("Invalid value for `uncertainty_ellipse`, must not be `None`") # noqa: E501 + + self._uncertainty_ellipse = uncertainty_ellipse + + @property + def confidence(self) -> int: + """Gets the confidence of this PointUncertaintyEllipse. + + Indicates value of confidence. # noqa: E501 + + :return: The confidence of this PointUncertaintyEllipse. + :rtype: int + """ + return self._confidence + + @confidence.setter + def confidence(self, confidence: int): + """Sets the confidence of this PointUncertaintyEllipse. + + Indicates value of confidence. # noqa: E501 + + :param confidence: The confidence of this PointUncertaintyEllipse. + :type confidence: int + """ + if confidence is None: + raise ValueError("Invalid value for `confidence`, must not be `None`") # noqa: E501 + if confidence is not None and confidence > 100: # noqa: E501 + raise ValueError("Invalid value for `confidence`, must be a value less than or equal to `100`") # noqa: E501 + if confidence is not None and confidence < 0: # noqa: E501 + raise ValueError("Invalid value for `confidence`, must be a value greater than or equal to `0`") # noqa: E501 + + self._confidence = confidence diff --git a/services/helper/helper_service/services/api/models/polygon.py b/services/helper/helper_service/services/api/models/polygon.py new file mode 100644 index 0000000000000000000000000000000000000000..800ffe051b4527767109458f6748b31623b281b1 --- /dev/null +++ b/services/helper/helper_service/services/api/models/polygon.py @@ -0,0 +1,100 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model +from api.models.gad_shape import GADShape # noqa: E501 +from api.models.geographical_coordinates import \ + GeographicalCoordinates # noqa: E501 +from api.models.supported_gad_shapes import SupportedGADShapes # noqa: E501 + + +class Polygon(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, shape=None, point_list=None): # noqa: E501 + """Polygon - a model defined in OpenAPI + + :param shape: The shape of this Polygon. # noqa: E501 + :type shape: SupportedGADShapes + :param point_list: The point_list of this Polygon. # noqa: E501 + :type point_list: List[GeographicalCoordinates] + """ + self.openapi_types = { + 'shape': SupportedGADShapes, + 'point_list': List[GeographicalCoordinates] + } + + self.attribute_map = { + 'shape': 'shape', + 'point_list': 'pointList' + } + + self._shape = shape + self._point_list = point_list + + @classmethod + def from_dict(cls, dikt) -> 'Polygon': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The Polygon of this Polygon. # noqa: E501 + :rtype: Polygon + """ + return util.deserialize_model(dikt, cls) + + @property + def shape(self) -> SupportedGADShapes: + """Gets the shape of this Polygon. + + + :return: The shape of this Polygon. + :rtype: SupportedGADShapes + """ + return self._shape + + @shape.setter + def shape(self, shape: SupportedGADShapes): + """Sets the shape of this Polygon. + + + :param shape: The shape of this Polygon. + :type shape: SupportedGADShapes + """ + if shape is None: + raise ValueError("Invalid value for `shape`, must not be `None`") # noqa: E501 + + self._shape = shape + + @property + def point_list(self) -> List[GeographicalCoordinates]: + """Gets the point_list of this Polygon. + + List of points. # noqa: E501 + + :return: The point_list of this Polygon. + :rtype: List[GeographicalCoordinates] + """ + return self._point_list + + @point_list.setter + def point_list(self, point_list: List[GeographicalCoordinates]): + """Sets the point_list of this Polygon. + + List of points. # noqa: E501 + + :param point_list: The point_list of this Polygon. + :type point_list: List[GeographicalCoordinates] + """ + if point_list is None: + raise ValueError("Invalid value for `point_list`, must not be `None`") # noqa: E501 + if point_list is not None and len(point_list) > 15: + raise ValueError("Invalid value for `point_list`, number of items must be less than or equal to `15`") # noqa: E501 + if point_list is not None and len(point_list) < 3: + raise ValueError("Invalid value for `point_list`, number of items must be greater than or equal to `3`") # noqa: E501 + + self._point_list = point_list diff --git a/services/helper/helper_service/services/api/models/protocol.py b/services/helper/helper_service/services/api/models/protocol.py new file mode 100644 index 0000000000000000000000000000000000000000..12d1f2fbb692c051ef2b70e094df6115c059b023 --- /dev/null +++ b/services/helper/helper_service/services/api/models/protocol.py @@ -0,0 +1,33 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model + + +class Protocol(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self): # noqa: E501 + """Protocol - a model defined in OpenAPI + + """ + self.openapi_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'Protocol': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The Protocol of this Protocol. # noqa: E501 + :rtype: Protocol + """ + return util.deserialize_model(dikt, cls) diff --git a/services/helper/helper_service/services/api/models/published_api_path.py b/services/helper/helper_service/services/api/models/published_api_path.py new file mode 100644 index 0000000000000000000000000000000000000000..765b4a46bec0bab52bbfa5d4557befc217d55278 --- /dev/null +++ b/services/helper/helper_service/services/api/models/published_api_path.py @@ -0,0 +1,64 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model + + +class PublishedApiPath(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, ccf_ids=None): # noqa: E501 + """PublishedApiPath - a model defined in OpenAPI + + :param ccf_ids: The ccf_ids of this PublishedApiPath. # noqa: E501 + :type ccf_ids: List[str] + """ + self.openapi_types = { + 'ccf_ids': List[str] + } + + self.attribute_map = { + 'ccf_ids': 'ccfIds' + } + + self._ccf_ids = ccf_ids + + @classmethod + def from_dict(cls, dikt) -> 'PublishedApiPath': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The PublishedApiPath of this PublishedApiPath. # noqa: E501 + :rtype: PublishedApiPath + """ + return util.deserialize_model(dikt, cls) + + @property + def ccf_ids(self) -> List[str]: + """Gets the ccf_ids of this PublishedApiPath. + + A list of CCF identifiers where the service API is already published. # noqa: E501 + + :return: The ccf_ids of this PublishedApiPath. + :rtype: List[str] + """ + return self._ccf_ids + + @ccf_ids.setter + def ccf_ids(self, ccf_ids: List[str]): + """Sets the ccf_ids of this PublishedApiPath. + + A list of CCF identifiers where the service API is already published. # noqa: E501 + + :param ccf_ids: The ccf_ids of this PublishedApiPath. + :type ccf_ids: List[str] + """ + if ccf_ids is not None and len(ccf_ids) < 1: + raise ValueError("Invalid value for `ccf_ids`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._ccf_ids = ccf_ids diff --git a/services/helper/helper_service/services/api/models/registration_information.py b/services/helper/helper_service/services/api/models/registration_information.py new file mode 100644 index 0000000000000000000000000000000000000000..ff8a9b4c8063ab52d076640439187fc3c3561f06 --- /dev/null +++ b/services/helper/helper_service/services/api/models/registration_information.py @@ -0,0 +1,92 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model + + +class RegistrationInformation(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, api_prov_pub_key=None, api_prov_cert=None): # noqa: E501 + """RegistrationInformation - a model defined in OpenAPI + + :param api_prov_pub_key: The api_prov_pub_key of this RegistrationInformation. # noqa: E501 + :type api_prov_pub_key: str + :param api_prov_cert: The api_prov_cert of this RegistrationInformation. # noqa: E501 + :type api_prov_cert: str + """ + self.openapi_types = { + 'api_prov_pub_key': str, + 'api_prov_cert': str + } + + self.attribute_map = { + 'api_prov_pub_key': 'apiProvPubKey', + 'api_prov_cert': 'apiProvCert' + } + + self._api_prov_pub_key = api_prov_pub_key + self._api_prov_cert = api_prov_cert + + @classmethod + def from_dict(cls, dikt) -> 'RegistrationInformation': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The RegistrationInformation of this RegistrationInformation. # noqa: E501 + :rtype: RegistrationInformation + """ + return util.deserialize_model(dikt, cls) + + @property + def api_prov_pub_key(self) -> str: + """Gets the api_prov_pub_key of this RegistrationInformation. + + Public Key of API Provider domain function. # noqa: E501 + + :return: The api_prov_pub_key of this RegistrationInformation. + :rtype: str + """ + return self._api_prov_pub_key + + @api_prov_pub_key.setter + def api_prov_pub_key(self, api_prov_pub_key: str): + """Sets the api_prov_pub_key of this RegistrationInformation. + + Public Key of API Provider domain function. # noqa: E501 + + :param api_prov_pub_key: The api_prov_pub_key of this RegistrationInformation. + :type api_prov_pub_key: str + """ + if api_prov_pub_key is None: + raise ValueError("Invalid value for `api_prov_pub_key`, must not be `None`") # noqa: E501 + + self._api_prov_pub_key = api_prov_pub_key + + @property + def api_prov_cert(self) -> str: + """Gets the api_prov_cert of this RegistrationInformation. + + API provider domain function's client certificate # noqa: E501 + + :return: The api_prov_cert of this RegistrationInformation. + :rtype: str + """ + return self._api_prov_cert + + @api_prov_cert.setter + def api_prov_cert(self, api_prov_cert: str): + """Sets the api_prov_cert of this RegistrationInformation. + + API provider domain function's client certificate # noqa: E501 + + :param api_prov_cert: The api_prov_cert of this RegistrationInformation. + :type api_prov_cert: str + """ + + self._api_prov_cert = api_prov_cert diff --git a/services/helper/helper_service/services/api/models/reporting_information.py b/services/helper/helper_service/services/api/models/reporting_information.py new file mode 100644 index 0000000000000000000000000000000000000000..766261fd77123045330878de3946e93cf3b1b6a5 --- /dev/null +++ b/services/helper/helper_service/services/api/models/reporting_information.py @@ -0,0 +1,291 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model +from api.models.notification_flag import NotificationFlag # noqa: E501 +from api.models.notification_method import NotificationMethod # noqa: E501 +from api.models.partitioning_criteria import PartitioningCriteria # noqa: E501 + + +class ReportingInformation(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, imm_rep=None, notif_method=None, max_report_nbr=None, mon_dur=None, rep_period=None, samp_ratio=None, partition_criteria=None, grp_rep_time=None, notif_flag=None): # noqa: E501 + """ReportingInformation - a model defined in OpenAPI + + :param imm_rep: The imm_rep of this ReportingInformation. # noqa: E501 + :type imm_rep: bool + :param notif_method: The notif_method of this ReportingInformation. # noqa: E501 + :type notif_method: NotificationMethod + :param max_report_nbr: The max_report_nbr of this ReportingInformation. # noqa: E501 + :type max_report_nbr: int + :param mon_dur: The mon_dur of this ReportingInformation. # noqa: E501 + :type mon_dur: datetime + :param rep_period: The rep_period of this ReportingInformation. # noqa: E501 + :type rep_period: int + :param samp_ratio: The samp_ratio of this ReportingInformation. # noqa: E501 + :type samp_ratio: int + :param partition_criteria: The partition_criteria of this ReportingInformation. # noqa: E501 + :type partition_criteria: List[PartitioningCriteria] + :param grp_rep_time: The grp_rep_time of this ReportingInformation. # noqa: E501 + :type grp_rep_time: int + :param notif_flag: The notif_flag of this ReportingInformation. # noqa: E501 + :type notif_flag: NotificationFlag + """ + self.openapi_types = { + 'imm_rep': bool, + 'notif_method': NotificationMethod, + 'max_report_nbr': int, + 'mon_dur': datetime, + 'rep_period': int, + 'samp_ratio': int, + 'partition_criteria': List[PartitioningCriteria], + 'grp_rep_time': int, + 'notif_flag': NotificationFlag + } + + self.attribute_map = { + 'imm_rep': 'immRep', + 'notif_method': 'notifMethod', + 'max_report_nbr': 'maxReportNbr', + 'mon_dur': 'monDur', + 'rep_period': 'repPeriod', + 'samp_ratio': 'sampRatio', + 'partition_criteria': 'partitionCriteria', + 'grp_rep_time': 'grpRepTime', + 'notif_flag': 'notifFlag' + } + + self._imm_rep = imm_rep + self._notif_method = notif_method + self._max_report_nbr = max_report_nbr + self._mon_dur = mon_dur + self._rep_period = rep_period + self._samp_ratio = samp_ratio + self._partition_criteria = partition_criteria + self._grp_rep_time = grp_rep_time + self._notif_flag = notif_flag + + @classmethod + def from_dict(cls, dikt) -> 'ReportingInformation': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The ReportingInformation of this ReportingInformation. # noqa: E501 + :rtype: ReportingInformation + """ + return util.deserialize_model(dikt, cls) + + @property + def imm_rep(self) -> bool: + """Gets the imm_rep of this ReportingInformation. + + + :return: The imm_rep of this ReportingInformation. + :rtype: bool + """ + return self._imm_rep + + @imm_rep.setter + def imm_rep(self, imm_rep: bool): + """Sets the imm_rep of this ReportingInformation. + + + :param imm_rep: The imm_rep of this ReportingInformation. + :type imm_rep: bool + """ + + self._imm_rep = imm_rep + + @property + def notif_method(self) -> NotificationMethod: + """Gets the notif_method of this ReportingInformation. + + + :return: The notif_method of this ReportingInformation. + :rtype: NotificationMethod + """ + return self._notif_method + + @notif_method.setter + def notif_method(self, notif_method: NotificationMethod): + """Sets the notif_method of this ReportingInformation. + + + :param notif_method: The notif_method of this ReportingInformation. + :type notif_method: NotificationMethod + """ + + self._notif_method = notif_method + + @property + def max_report_nbr(self) -> int: + """Gets the max_report_nbr of this ReportingInformation. + + Unsigned Integer, i.e. only value 0 and integers above 0 are permissible. # noqa: E501 + + :return: The max_report_nbr of this ReportingInformation. + :rtype: int + """ + return self._max_report_nbr + + @max_report_nbr.setter + def max_report_nbr(self, max_report_nbr: int): + """Sets the max_report_nbr of this ReportingInformation. + + Unsigned Integer, i.e. only value 0 and integers above 0 are permissible. # noqa: E501 + + :param max_report_nbr: The max_report_nbr of this ReportingInformation. + :type max_report_nbr: int + """ + if max_report_nbr is not None and max_report_nbr < 0: # noqa: E501 + raise ValueError("Invalid value for `max_report_nbr`, must be a value greater than or equal to `0`") # noqa: E501 + + self._max_report_nbr = max_report_nbr + + @property + def mon_dur(self) -> datetime: + """Gets the mon_dur of this ReportingInformation. + + string with format \"date-time\" as defined in OpenAPI. # noqa: E501 + + :return: The mon_dur of this ReportingInformation. + :rtype: datetime + """ + return self._mon_dur + + @mon_dur.setter + def mon_dur(self, mon_dur: datetime): + """Sets the mon_dur of this ReportingInformation. + + string with format \"date-time\" as defined in OpenAPI. # noqa: E501 + + :param mon_dur: The mon_dur of this ReportingInformation. + :type mon_dur: datetime + """ + + self._mon_dur = mon_dur + + @property + def rep_period(self) -> int: + """Gets the rep_period of this ReportingInformation. + + indicating a time in seconds. # noqa: E501 + + :return: The rep_period of this ReportingInformation. + :rtype: int + """ + return self._rep_period + + @rep_period.setter + def rep_period(self, rep_period: int): + """Sets the rep_period of this ReportingInformation. + + indicating a time in seconds. # noqa: E501 + + :param rep_period: The rep_period of this ReportingInformation. + :type rep_period: int + """ + + self._rep_period = rep_period + + @property + def samp_ratio(self) -> int: + """Gets the samp_ratio of this ReportingInformation. + + Unsigned integer indicating Sampling Ratio (see clauses 4.15.1 of 3GPP TS 23.502), expressed in percent. # noqa: E501 + + :return: The samp_ratio of this ReportingInformation. + :rtype: int + """ + return self._samp_ratio + + @samp_ratio.setter + def samp_ratio(self, samp_ratio: int): + """Sets the samp_ratio of this ReportingInformation. + + Unsigned integer indicating Sampling Ratio (see clauses 4.15.1 of 3GPP TS 23.502), expressed in percent. # noqa: E501 + + :param samp_ratio: The samp_ratio of this ReportingInformation. + :type samp_ratio: int + """ + if samp_ratio is not None and samp_ratio > 100: # noqa: E501 + raise ValueError("Invalid value for `samp_ratio`, must be a value less than or equal to `100`") # noqa: E501 + if samp_ratio is not None and samp_ratio < 1: # noqa: E501 + raise ValueError("Invalid value for `samp_ratio`, must be a value greater than or equal to `1`") # noqa: E501 + + self._samp_ratio = samp_ratio + + @property + def partition_criteria(self) -> List[PartitioningCriteria]: + """Gets the partition_criteria of this ReportingInformation. + + Criteria for partitioning the UEs before applying the sampling ratio. # noqa: E501 + + :return: The partition_criteria of this ReportingInformation. + :rtype: List[PartitioningCriteria] + """ + return self._partition_criteria + + @partition_criteria.setter + def partition_criteria(self, partition_criteria: List[PartitioningCriteria]): + """Sets the partition_criteria of this ReportingInformation. + + Criteria for partitioning the UEs before applying the sampling ratio. # noqa: E501 + + :param partition_criteria: The partition_criteria of this ReportingInformation. + :type partition_criteria: List[PartitioningCriteria] + """ + if partition_criteria is not None and len(partition_criteria) < 1: + raise ValueError("Invalid value for `partition_criteria`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._partition_criteria = partition_criteria + + @property + def grp_rep_time(self) -> int: + """Gets the grp_rep_time of this ReportingInformation. + + indicating a time in seconds. # noqa: E501 + + :return: The grp_rep_time of this ReportingInformation. + :rtype: int + """ + return self._grp_rep_time + + @grp_rep_time.setter + def grp_rep_time(self, grp_rep_time: int): + """Sets the grp_rep_time of this ReportingInformation. + + indicating a time in seconds. # noqa: E501 + + :param grp_rep_time: The grp_rep_time of this ReportingInformation. + :type grp_rep_time: int + """ + + self._grp_rep_time = grp_rep_time + + @property + def notif_flag(self) -> NotificationFlag: + """Gets the notif_flag of this ReportingInformation. + + + :return: The notif_flag of this ReportingInformation. + :rtype: NotificationFlag + """ + return self._notif_flag + + @notif_flag.setter + def notif_flag(self, notif_flag: NotificationFlag): + """Sets the notif_flag of this ReportingInformation. + + + :param notif_flag: The notif_flag of this ReportingInformation. + :type notif_flag: NotificationFlag + """ + + self._notif_flag = notif_flag diff --git a/services/helper/helper_service/services/api/models/resource.py b/services/helper/helper_service/services/api/models/resource.py new file mode 100644 index 0000000000000000000000000000000000000000..e7282fa6a01da430ed92a9ed499990fc1ebda27f --- /dev/null +++ b/services/helper/helper_service/services/api/models/resource.py @@ -0,0 +1,210 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model +from api.models.communication_type import CommunicationType # noqa: E501 +from api.models.operation import Operation # noqa: E501 + + +class Resource(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, resource_name=None, comm_type=None, uri=None, cust_op_name=None, operations=None, description=None): # noqa: E501 + """Resource - a model defined in OpenAPI + + :param resource_name: The resource_name of this Resource. # noqa: E501 + :type resource_name: str + :param comm_type: The comm_type of this Resource. # noqa: E501 + :type comm_type: CommunicationType + :param uri: The uri of this Resource. # noqa: E501 + :type uri: str + :param cust_op_name: The cust_op_name of this Resource. # noqa: E501 + :type cust_op_name: str + :param operations: The operations of this Resource. # noqa: E501 + :type operations: List[Operation] + :param description: The description of this Resource. # noqa: E501 + :type description: str + """ + self.openapi_types = { + 'resource_name': str, + 'comm_type': CommunicationType, + 'uri': str, + 'cust_op_name': str, + 'operations': List[Operation], + 'description': str + } + + self.attribute_map = { + 'resource_name': 'resourceName', + 'comm_type': 'commType', + 'uri': 'uri', + 'cust_op_name': 'custOpName', + 'operations': 'operations', + 'description': 'description' + } + + self._resource_name = resource_name + self._comm_type = comm_type + self._uri = uri + self._cust_op_name = cust_op_name + self._operations = operations + self._description = description + + @classmethod + def from_dict(cls, dikt) -> 'Resource': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The Resource of this Resource. # noqa: E501 + :rtype: Resource + """ + return util.deserialize_model(dikt, cls) + + @property + def resource_name(self) -> str: + """Gets the resource_name of this Resource. + + Resource name # noqa: E501 + + :return: The resource_name of this Resource. + :rtype: str + """ + return self._resource_name + + @resource_name.setter + def resource_name(self, resource_name: str): + """Sets the resource_name of this Resource. + + Resource name # noqa: E501 + + :param resource_name: The resource_name of this Resource. + :type resource_name: str + """ + if resource_name is None: + raise ValueError("Invalid value for `resource_name`, must not be `None`") # noqa: E501 + + self._resource_name = resource_name + + @property + def comm_type(self) -> CommunicationType: + """Gets the comm_type of this Resource. + + + :return: The comm_type of this Resource. + :rtype: CommunicationType + """ + return self._comm_type + + @comm_type.setter + def comm_type(self, comm_type: CommunicationType): + """Sets the comm_type of this Resource. + + + :param comm_type: The comm_type of this Resource. + :type comm_type: CommunicationType + """ + if comm_type is None: + raise ValueError("Invalid value for `comm_type`, must not be `None`") # noqa: E501 + + self._comm_type = comm_type + + @property + def uri(self) -> str: + """Gets the uri of this Resource. + + Relative URI of the API resource, it is set as {apiSpecificSuffixes} part of the URI structure as defined in clause 5.2.4 of 3GPP TS 29.122. # noqa: E501 + + :return: The uri of this Resource. + :rtype: str + """ + return self._uri + + @uri.setter + def uri(self, uri: str): + """Sets the uri of this Resource. + + Relative URI of the API resource, it is set as {apiSpecificSuffixes} part of the URI structure as defined in clause 5.2.4 of 3GPP TS 29.122. # noqa: E501 + + :param uri: The uri of this Resource. + :type uri: str + """ + if uri is None: + raise ValueError("Invalid value for `uri`, must not be `None`") # noqa: E501 + + self._uri = uri + + @property + def cust_op_name(self) -> str: + """Gets the cust_op_name of this Resource. + + it is set as {custOpName} part of the URI structure for a custom operation associated with a resource as defined in clause 5.2.4 of 3GPP TS 29.122. # noqa: E501 + + :return: The cust_op_name of this Resource. + :rtype: str + """ + return self._cust_op_name + + @cust_op_name.setter + def cust_op_name(self, cust_op_name: str): + """Sets the cust_op_name of this Resource. + + it is set as {custOpName} part of the URI structure for a custom operation associated with a resource as defined in clause 5.2.4 of 3GPP TS 29.122. # noqa: E501 + + :param cust_op_name: The cust_op_name of this Resource. + :type cust_op_name: str + """ + + self._cust_op_name = cust_op_name + + @property + def operations(self) -> List[Operation]: + """Gets the operations of this Resource. + + Supported HTTP methods for the API resource. Only applicable when the protocol in AefProfile indicates HTTP. # noqa: E501 + + :return: The operations of this Resource. + :rtype: List[Operation] + """ + return self._operations + + @operations.setter + def operations(self, operations: List[Operation]): + """Sets the operations of this Resource. + + Supported HTTP methods for the API resource. Only applicable when the protocol in AefProfile indicates HTTP. # noqa: E501 + + :param operations: The operations of this Resource. + :type operations: List[Operation] + """ + if operations is not None and len(operations) < 1: + raise ValueError("Invalid value for `operations`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._operations = operations + + @property + def description(self) -> str: + """Gets the description of this Resource. + + Text description of the API resource # noqa: E501 + + :return: The description of this Resource. + :rtype: str + """ + return self._description + + @description.setter + def description(self, description: str): + """Sets the description of this Resource. + + Text description of the API resource # noqa: E501 + + :param description: The description of this Resource. + :type description: str + """ + + self._description = description diff --git a/services/helper/helper_service/services/api/models/security_information.py b/services/helper/helper_service/services/api/models/security_information.py new file mode 100644 index 0000000000000000000000000000000000000000..20e92e47ff9c1373187d22cb13250bd4db1d8c2b --- /dev/null +++ b/services/helper/helper_service/services/api/models/security_information.py @@ -0,0 +1,232 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model +from api.models.interface_description import InterfaceDescription # noqa: E501 +from api.models.security_method import SecurityMethod # noqa: E501 + + +class SecurityInformation(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, interface_details=None, aef_id=None, api_id=None, pref_security_methods=None, sel_security_method=None, authentication_info=None, authorization_info=None): # noqa: E501 + """SecurityInformation - a model defined in OpenAPI + + :param interface_details: The interface_details of this SecurityInformation. # noqa: E501 + :type interface_details: InterfaceDescription + :param aef_id: The aef_id of this SecurityInformation. # noqa: E501 + :type aef_id: str + :param api_id: The api_id of this SecurityInformation. # noqa: E501 + :type api_id: str + :param pref_security_methods: The pref_security_methods of this SecurityInformation. # noqa: E501 + :type pref_security_methods: List[SecurityMethod] + :param sel_security_method: The sel_security_method of this SecurityInformation. # noqa: E501 + :type sel_security_method: SecurityMethod + :param authentication_info: The authentication_info of this SecurityInformation. # noqa: E501 + :type authentication_info: str + :param authorization_info: The authorization_info of this SecurityInformation. # noqa: E501 + :type authorization_info: str + """ + self.openapi_types = { + 'interface_details': InterfaceDescription, + 'aef_id': str, + 'api_id': str, + 'pref_security_methods': List[SecurityMethod], + 'sel_security_method': SecurityMethod, + 'authentication_info': str, + 'authorization_info': str + } + + self.attribute_map = { + 'interface_details': 'interfaceDetails', + 'aef_id': 'aefId', + 'api_id': 'apiId', + 'pref_security_methods': 'prefSecurityMethods', + 'sel_security_method': 'selSecurityMethod', + 'authentication_info': 'authenticationInfo', + 'authorization_info': 'authorizationInfo' + } + + self._interface_details = interface_details + self._aef_id = aef_id + self._api_id = api_id + self._pref_security_methods = pref_security_methods + self._sel_security_method = sel_security_method + self._authentication_info = authentication_info + self._authorization_info = authorization_info + + @classmethod + def from_dict(cls, dikt) -> 'SecurityInformation': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The SecurityInformation of this SecurityInformation. # noqa: E501 + :rtype: SecurityInformation + """ + return util.deserialize_model(dikt, cls) + + @property + def interface_details(self) -> InterfaceDescription: + """Gets the interface_details of this SecurityInformation. + + + :return: The interface_details of this SecurityInformation. + :rtype: InterfaceDescription + """ + return self._interface_details + + @interface_details.setter + def interface_details(self, interface_details: InterfaceDescription): + """Sets the interface_details of this SecurityInformation. + + + :param interface_details: The interface_details of this SecurityInformation. + :type interface_details: InterfaceDescription + """ + + self._interface_details = interface_details + + @property + def aef_id(self) -> str: + """Gets the aef_id of this SecurityInformation. + + Identifier of the API exposing function # noqa: E501 + + :return: The aef_id of this SecurityInformation. + :rtype: str + """ + return self._aef_id + + @aef_id.setter + def aef_id(self, aef_id: str): + """Sets the aef_id of this SecurityInformation. + + Identifier of the API exposing function # noqa: E501 + + :param aef_id: The aef_id of this SecurityInformation. + :type aef_id: str + """ + + self._aef_id = aef_id + + @property + def api_id(self) -> str: + """Gets the api_id of this SecurityInformation. + + API identifier # noqa: E501 + + :return: The api_id of this SecurityInformation. + :rtype: str + """ + return self._api_id + + @api_id.setter + def api_id(self, api_id: str): + """Sets the api_id of this SecurityInformation. + + API identifier # noqa: E501 + + :param api_id: The api_id of this SecurityInformation. + :type api_id: str + """ + + self._api_id = api_id + + @property + def pref_security_methods(self) -> List[SecurityMethod]: + """Gets the pref_security_methods of this SecurityInformation. + + Security methods preferred by the API invoker for the API interface. # noqa: E501 + + :return: The pref_security_methods of this SecurityInformation. + :rtype: List[SecurityMethod] + """ + return self._pref_security_methods + + @pref_security_methods.setter + def pref_security_methods(self, pref_security_methods: List[SecurityMethod]): + """Sets the pref_security_methods of this SecurityInformation. + + Security methods preferred by the API invoker for the API interface. # noqa: E501 + + :param pref_security_methods: The pref_security_methods of this SecurityInformation. + :type pref_security_methods: List[SecurityMethod] + """ + if pref_security_methods is None: + raise ValueError("Invalid value for `pref_security_methods`, must not be `None`") # noqa: E501 + if pref_security_methods is not None and len(pref_security_methods) < 1: + raise ValueError("Invalid value for `pref_security_methods`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._pref_security_methods = pref_security_methods + + @property + def sel_security_method(self) -> SecurityMethod: + """Gets the sel_security_method of this SecurityInformation. + + + :return: The sel_security_method of this SecurityInformation. + :rtype: SecurityMethod + """ + return self._sel_security_method + + @sel_security_method.setter + def sel_security_method(self, sel_security_method: SecurityMethod): + """Sets the sel_security_method of this SecurityInformation. + + + :param sel_security_method: The sel_security_method of this SecurityInformation. + :type sel_security_method: SecurityMethod + """ + + self._sel_security_method = sel_security_method + + @property + def authentication_info(self) -> str: + """Gets the authentication_info of this SecurityInformation. + + Authentication related information # noqa: E501 + + :return: The authentication_info of this SecurityInformation. + :rtype: str + """ + return self._authentication_info + + @authentication_info.setter + def authentication_info(self, authentication_info: str): + """Sets the authentication_info of this SecurityInformation. + + Authentication related information # noqa: E501 + + :param authentication_info: The authentication_info of this SecurityInformation. + :type authentication_info: str + """ + + self._authentication_info = authentication_info + + @property + def authorization_info(self) -> str: + """Gets the authorization_info of this SecurityInformation. + + Authorization related information # noqa: E501 + + :return: The authorization_info of this SecurityInformation. + :rtype: str + """ + return self._authorization_info + + @authorization_info.setter + def authorization_info(self, authorization_info: str): + """Sets the authorization_info of this SecurityInformation. + + Authorization related information # noqa: E501 + + :param authorization_info: The authorization_info of this SecurityInformation. + :type authorization_info: str + """ + + self._authorization_info = authorization_info diff --git a/services/helper/helper_service/services/api/models/security_method.py b/services/helper/helper_service/services/api/models/security_method.py new file mode 100644 index 0000000000000000000000000000000000000000..69fed445184e864dbddc9463a573a382d181895d --- /dev/null +++ b/services/helper/helper_service/services/api/models/security_method.py @@ -0,0 +1,33 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model + + +class SecurityMethod(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self): # noqa: E501 + """SecurityMethod - a model defined in OpenAPI + + """ + self.openapi_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'SecurityMethod': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The SecurityMethod of this SecurityMethod. # noqa: E501 + :rtype: SecurityMethod + """ + return util.deserialize_model(dikt, cls) diff --git a/services/helper/helper_service/services/api/models/service_api_description.py b/services/helper/helper_service/services/api/models/service_api_description.py new file mode 100644 index 0000000000000000000000000000000000000000..ca5a3f16d63c41ee62b3b91b7b7b7008b3047829 --- /dev/null +++ b/services/helper/helper_service/services/api/models/service_api_description.py @@ -0,0 +1,320 @@ +import re # noqa: E501 +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.aef_profile import AefProfile # noqa: E501 +from api.models.base_model import Model +from api.models.published_api_path import PublishedApiPath # noqa: E501 +from api.models.shareable_information import ShareableInformation # noqa: E501 + + +class ServiceAPIDescription(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, api_name=None, api_id=None, aef_profiles=None, description=None, supported_features=None, shareable_info=None, service_api_category=None, api_supp_feats=None, pub_api_path=None, ccf_id=None): # noqa: E501 + """ServiceAPIDescription - a model defined in OpenAPI + + :param api_name: The api_name of this ServiceAPIDescription. # noqa: E501 + :type api_name: str + :param api_id: The api_id of this ServiceAPIDescription. # noqa: E501 + :type api_id: str + :param aef_profiles: The aef_profiles of this ServiceAPIDescription. # noqa: E501 + :type aef_profiles: List[AefProfile] + :param description: The description of this ServiceAPIDescription. # noqa: E501 + :type description: str + :param supported_features: The supported_features of this ServiceAPIDescription. # noqa: E501 + :type supported_features: str + :param shareable_info: The shareable_info of this ServiceAPIDescription. # noqa: E501 + :type shareable_info: ShareableInformation + :param service_api_category: The service_api_category of this ServiceAPIDescription. # noqa: E501 + :type service_api_category: str + :param api_supp_feats: The api_supp_feats of this ServiceAPIDescription. # noqa: E501 + :type api_supp_feats: str + :param pub_api_path: The pub_api_path of this ServiceAPIDescription. # noqa: E501 + :type pub_api_path: PublishedApiPath + :param ccf_id: The ccf_id of this ServiceAPIDescription. # noqa: E501 + :type ccf_id: str + """ + self.openapi_types = { + 'api_name': str, + 'api_id': str, + 'aef_profiles': List[AefProfile], + 'description': str, + 'supported_features': str, + 'shareable_info': ShareableInformation, + 'service_api_category': str, + 'api_supp_feats': str, + 'pub_api_path': PublishedApiPath, + 'ccf_id': str + } + + self.attribute_map = { + 'api_name': 'apiName', + 'api_id': 'apiId', + 'aef_profiles': 'aefProfiles', + 'description': 'description', + 'supported_features': 'supportedFeatures', + 'shareable_info': 'shareableInfo', + 'service_api_category': 'serviceAPICategory', + 'api_supp_feats': 'apiSuppFeats', + 'pub_api_path': 'pubApiPath', + 'ccf_id': 'ccfId' + } + + self._api_name = api_name + self._api_id = api_id + self._aef_profiles = aef_profiles + self._description = description + self._supported_features = supported_features + self._shareable_info = shareable_info + self._service_api_category = service_api_category + self._api_supp_feats = api_supp_feats + self._pub_api_path = pub_api_path + self._ccf_id = ccf_id + + @classmethod + def from_dict(cls, dikt) -> 'ServiceAPIDescription': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The ServiceAPIDescription of this ServiceAPIDescription. # noqa: E501 + :rtype: ServiceAPIDescription + """ + return util.deserialize_model(dikt, cls) + + @property + def api_name(self) -> str: + """Gets the api_name of this ServiceAPIDescription. + + API name, it is set as {apiName} part of the URI structure as defined in clause 5.2.4 of 3GPP TS 29.122. # noqa: E501 + + :return: The api_name of this ServiceAPIDescription. + :rtype: str + """ + return self._api_name + + @api_name.setter + def api_name(self, api_name: str): + """Sets the api_name of this ServiceAPIDescription. + + API name, it is set as {apiName} part of the URI structure as defined in clause 5.2.4 of 3GPP TS 29.122. # noqa: E501 + + :param api_name: The api_name of this ServiceAPIDescription. + :type api_name: str + """ + if api_name is None: + raise ValueError("Invalid value for `api_name`, must not be `None`") # noqa: E501 + + self._api_name = api_name + + @property + def api_id(self) -> str: + """Gets the api_id of this ServiceAPIDescription. + + API identifier assigned by the CAPIF core function to the published service API. Shall not be present in the HTTP POST request from the API publishing function to the CAPIF core function. Shall be present in the HTTP POST response from the CAPIF core function to the API publishing function and in the HTTP GET response from the CAPIF core function to the API invoker (discovery API). # noqa: E501 + + :return: The api_id of this ServiceAPIDescription. + :rtype: str + """ + return self._api_id + + @api_id.setter + def api_id(self, api_id: str): + """Sets the api_id of this ServiceAPIDescription. + + API identifier assigned by the CAPIF core function to the published service API. Shall not be present in the HTTP POST request from the API publishing function to the CAPIF core function. Shall be present in the HTTP POST response from the CAPIF core function to the API publishing function and in the HTTP GET response from the CAPIF core function to the API invoker (discovery API). # noqa: E501 + + :param api_id: The api_id of this ServiceAPIDescription. + :type api_id: str + """ + + self._api_id = api_id + + @property + def aef_profiles(self) -> List[AefProfile]: + """Gets the aef_profiles of this ServiceAPIDescription. + + AEF profile information, which includes the exposed API details (e.g. protocol). # noqa: E501 + + :return: The aef_profiles of this ServiceAPIDescription. + :rtype: List[AefProfile] + """ + return self._aef_profiles + + @aef_profiles.setter + def aef_profiles(self, aef_profiles: List[AefProfile]): + """Sets the aef_profiles of this ServiceAPIDescription. + + AEF profile information, which includes the exposed API details (e.g. protocol). # noqa: E501 + + :param aef_profiles: The aef_profiles of this ServiceAPIDescription. + :type aef_profiles: List[AefProfile] + """ + if aef_profiles is not None and len(aef_profiles) < 1: + raise ValueError("Invalid value for `aef_profiles`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._aef_profiles = aef_profiles + + @property + def description(self) -> str: + """Gets the description of this ServiceAPIDescription. + + Text description of the API # noqa: E501 + + :return: The description of this ServiceAPIDescription. + :rtype: str + """ + return self._description + + @description.setter + def description(self, description: str): + """Sets the description of this ServiceAPIDescription. + + Text description of the API # noqa: E501 + + :param description: The description of this ServiceAPIDescription. + :type description: str + """ + + self._description = description + + @property + def supported_features(self) -> str: + """Gets the supported_features of this ServiceAPIDescription. + + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. # noqa: E501 + + :return: The supported_features of this ServiceAPIDescription. + :rtype: str + """ + return self._supported_features + + @supported_features.setter + def supported_features(self, supported_features: str): + """Sets the supported_features of this ServiceAPIDescription. + + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. # noqa: E501 + + :param supported_features: The supported_features of this ServiceAPIDescription. + :type supported_features: str + """ + if supported_features is not None and not re.search(r'^[A-Fa-f0-9]*$', supported_features): # noqa: E501 + raise ValueError(r"Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + + self._supported_features = supported_features + + @property + def shareable_info(self) -> ShareableInformation: + """Gets the shareable_info of this ServiceAPIDescription. + + + :return: The shareable_info of this ServiceAPIDescription. + :rtype: ShareableInformation + """ + return self._shareable_info + + @shareable_info.setter + def shareable_info(self, shareable_info: ShareableInformation): + """Sets the shareable_info of this ServiceAPIDescription. + + + :param shareable_info: The shareable_info of this ServiceAPIDescription. + :type shareable_info: ShareableInformation + """ + + self._shareable_info = shareable_info + + @property + def service_api_category(self) -> str: + """Gets the service_api_category of this ServiceAPIDescription. + + + :return: The service_api_category of this ServiceAPIDescription. + :rtype: str + """ + return self._service_api_category + + @service_api_category.setter + def service_api_category(self, service_api_category: str): + """Sets the service_api_category of this ServiceAPIDescription. + + + :param service_api_category: The service_api_category of this ServiceAPIDescription. + :type service_api_category: str + """ + + self._service_api_category = service_api_category + + @property + def api_supp_feats(self) -> str: + """Gets the api_supp_feats of this ServiceAPIDescription. + + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. # noqa: E501 + + :return: The api_supp_feats of this ServiceAPIDescription. + :rtype: str + """ + return self._api_supp_feats + + @api_supp_feats.setter + def api_supp_feats(self, api_supp_feats: str): + """Sets the api_supp_feats of this ServiceAPIDescription. + + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. # noqa: E501 + + :param api_supp_feats: The api_supp_feats of this ServiceAPIDescription. + :type api_supp_feats: str + """ + if api_supp_feats is not None and not re.search(r'^[A-Fa-f0-9]*$', api_supp_feats): # noqa: E501 + raise ValueError(r"Invalid value for `api_supp_feats`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + + self._api_supp_feats = api_supp_feats + + @property + def pub_api_path(self) -> PublishedApiPath: + """Gets the pub_api_path of this ServiceAPIDescription. + + + :return: The pub_api_path of this ServiceAPIDescription. + :rtype: PublishedApiPath + """ + return self._pub_api_path + + @pub_api_path.setter + def pub_api_path(self, pub_api_path: PublishedApiPath): + """Sets the pub_api_path of this ServiceAPIDescription. + + + :param pub_api_path: The pub_api_path of this ServiceAPIDescription. + :type pub_api_path: PublishedApiPath + """ + + self._pub_api_path = pub_api_path + + @property + def ccf_id(self) -> str: + """Gets the ccf_id of this ServiceAPIDescription. + + CAPIF core function identifier. # noqa: E501 + + :return: The ccf_id of this ServiceAPIDescription. + :rtype: str + """ + return self._ccf_id + + @ccf_id.setter + def ccf_id(self, ccf_id: str): + """Sets the ccf_id of this ServiceAPIDescription. + + CAPIF core function identifier. # noqa: E501 + + :param ccf_id: The ccf_id of this ServiceAPIDescription. + :type ccf_id: str + """ + + self._ccf_id = ccf_id diff --git a/services/helper/helper_service/services/api/models/service_security.py b/services/helper/helper_service/services/api/models/service_security.py new file mode 100644 index 0000000000000000000000000000000000000000..4d8f76b1582b013aa323ab1e0287d0b077f436f7 --- /dev/null +++ b/services/helper/helper_service/services/api/models/service_security.py @@ -0,0 +1,207 @@ +import re # noqa: E501 +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model +from api.models.security_information import SecurityInformation # noqa: E501 +from api.models.websock_notif_config import WebsockNotifConfig # noqa: E501 + + +class ServiceSecurity(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, api_invoker_id=None, security_info=None, notification_destination=None, request_test_notification=None, websock_notif_config=None, supported_features=None): # noqa: E501 + """ServiceSecurity - a model defined in OpenAPI + + :param api_invoker_id: The api_invoker_id of this ServiceSecurity. # noqa: E501 + :type api_invoker_id: str + :param security_info: The security_info of this ServiceSecurity. # noqa: E501 + :type security_info: List[SecurityInformation] + :param notification_destination: The notification_destination of this ServiceSecurity. # noqa: E501 + :type notification_destination: str + :param request_test_notification: The request_test_notification of this ServiceSecurity. # noqa: E501 + :type request_test_notification: bool + :param websock_notif_config: The websock_notif_config of this ServiceSecurity. # noqa: E501 + :type websock_notif_config: WebsockNotifConfig + :param supported_features: The supported_features of this ServiceSecurity. # noqa: E501 + :type supported_features: str + """ + self.openapi_types = { + 'api_invoker_id': str, + 'security_info': List[SecurityInformation], + 'notification_destination': str, + 'request_test_notification': bool, + 'websock_notif_config': WebsockNotifConfig, + 'supported_features': str + } + + self.attribute_map = { + 'api_invoker_id': 'api_invoker_id', + 'security_info': 'securityInfo', + 'notification_destination': 'notificationDestination', + 'request_test_notification': 'requestTestNotification', + 'websock_notif_config': 'websockNotifConfig', + 'supported_features': 'supportedFeatures' + } + + self._api_invoker_id = api_invoker_id + self._security_info = security_info + self._notification_destination = notification_destination + self._request_test_notification = request_test_notification + self._websock_notif_config = websock_notif_config + self._supported_features = supported_features + + @classmethod + def from_dict(cls, dikt) -> 'ServiceSecurity': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The ServiceSecurity of this ServiceSecurity. # noqa: E501 + :rtype: ServiceSecurity + """ + return util.deserialize_model(dikt, cls) + + @property + def api_invoker_id(self) -> str: + """Gets the api_invoker_id of this ServiceSecurity. + + Id of the invoker of this security context. # noqa: E501 + + :return: The api_invoker_id of this ServiceSecurity. + :rtype: str + """ + return self._api_invoker_id + + @api_invoker_id.setter + def api_invoker_id(self, api_invoker_id: str): + """Sets the api_invoker_id of this ServiceSecurity. + + Id of the invoker of this security context. # noqa: E501 + + :param api_invoker_id: The api_invoker_id of this ServiceSecurity. + :type api_invoker_id: str + """ + + self._api_invoker_id = api_invoker_id + + @property + def security_info(self) -> List[SecurityInformation]: + """Gets the security_info of this ServiceSecurity. + + + :return: The security_info of this ServiceSecurity. + :rtype: List[SecurityInformation] + """ + return self._security_info + + @security_info.setter + def security_info(self, security_info: List[SecurityInformation]): + """Sets the security_info of this ServiceSecurity. + + + :param security_info: The security_info of this ServiceSecurity. + :type security_info: List[SecurityInformation] + """ + if security_info is None: + raise ValueError("Invalid value for `security_info`, must not be `None`") # noqa: E501 + + self._security_info = security_info + + @property + def notification_destination(self) -> str: + """Gets the notification_destination of this ServiceSecurity. + + string providing an URI formatted according to IETF RFC 3986. # noqa: E501 + + :return: The notification_destination of this ServiceSecurity. + :rtype: str + """ + return self._notification_destination + + @notification_destination.setter + def notification_destination(self, notification_destination: str): + """Sets the notification_destination of this ServiceSecurity. + + string providing an URI formatted according to IETF RFC 3986. # noqa: E501 + + :param notification_destination: The notification_destination of this ServiceSecurity. + :type notification_destination: str + """ + if notification_destination is None: + raise ValueError("Invalid value for `notification_destination`, must not be `None`") # noqa: E501 + + self._notification_destination = notification_destination + + @property + def request_test_notification(self) -> bool: + """Gets the request_test_notification of this ServiceSecurity. + + Set to true by API invoker to request the CAPIF core function to send a test notification as defined in in clause 7.6. Set to false or omitted otherwise. # noqa: E501 + + :return: The request_test_notification of this ServiceSecurity. + :rtype: bool + """ + return self._request_test_notification + + @request_test_notification.setter + def request_test_notification(self, request_test_notification: bool): + """Sets the request_test_notification of this ServiceSecurity. + + Set to true by API invoker to request the CAPIF core function to send a test notification as defined in in clause 7.6. Set to false or omitted otherwise. # noqa: E501 + + :param request_test_notification: The request_test_notification of this ServiceSecurity. + :type request_test_notification: bool + """ + + self._request_test_notification = request_test_notification + + @property + def websock_notif_config(self) -> WebsockNotifConfig: + """Gets the websock_notif_config of this ServiceSecurity. + + + :return: The websock_notif_config of this ServiceSecurity. + :rtype: WebsockNotifConfig + """ + return self._websock_notif_config + + @websock_notif_config.setter + def websock_notif_config(self, websock_notif_config: WebsockNotifConfig): + """Sets the websock_notif_config of this ServiceSecurity. + + + :param websock_notif_config: The websock_notif_config of this ServiceSecurity. + :type websock_notif_config: WebsockNotifConfig + """ + + self._websock_notif_config = websock_notif_config + + @property + def supported_features(self) -> str: + """Gets the supported_features of this ServiceSecurity. + + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. # noqa: E501 + + :return: The supported_features of this ServiceSecurity. + :rtype: str + """ + return self._supported_features + + @supported_features.setter + def supported_features(self, supported_features: str): + """Sets the supported_features of this ServiceSecurity. + + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. # noqa: E501 + + :param supported_features: The supported_features of this ServiceSecurity. + :type supported_features: str + """ + if supported_features is not None and not re.search(r'^[A-Fa-f0-9]*$', supported_features): # noqa: E501 + raise ValueError(r"Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + + self._supported_features = supported_features diff --git a/services/helper/helper_service/services/api/models/shareable_information.py b/services/helper/helper_service/services/api/models/shareable_information.py new file mode 100644 index 0000000000000000000000000000000000000000..744803b31c3f5e7aeea1248429281a802f9cfd55 --- /dev/null +++ b/services/helper/helper_service/services/api/models/shareable_information.py @@ -0,0 +1,94 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model + + +class ShareableInformation(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, is_shareable=None, capif_prov_doms=None): # noqa: E501 + """ShareableInformation - a model defined in OpenAPI + + :param is_shareable: The is_shareable of this ShareableInformation. # noqa: E501 + :type is_shareable: bool + :param capif_prov_doms: The capif_prov_doms of this ShareableInformation. # noqa: E501 + :type capif_prov_doms: List[str] + """ + self.openapi_types = { + 'is_shareable': bool, + 'capif_prov_doms': List[str] + } + + self.attribute_map = { + 'is_shareable': 'isShareable', + 'capif_prov_doms': 'capifProvDoms' + } + + self._is_shareable = is_shareable + self._capif_prov_doms = capif_prov_doms + + @classmethod + def from_dict(cls, dikt) -> 'ShareableInformation': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The ShareableInformation of this ShareableInformation. # noqa: E501 + :rtype: ShareableInformation + """ + return util.deserialize_model(dikt, cls) + + @property + def is_shareable(self) -> bool: + """Gets the is_shareable of this ShareableInformation. + + Set to \"true\" indicates that the service API and/or the service API category can be shared to the list of CAPIF provider domain information. Otherwise set to \"false\". # noqa: E501 + + :return: The is_shareable of this ShareableInformation. + :rtype: bool + """ + return self._is_shareable + + @is_shareable.setter + def is_shareable(self, is_shareable: bool): + """Sets the is_shareable of this ShareableInformation. + + Set to \"true\" indicates that the service API and/or the service API category can be shared to the list of CAPIF provider domain information. Otherwise set to \"false\". # noqa: E501 + + :param is_shareable: The is_shareable of this ShareableInformation. + :type is_shareable: bool + """ + if is_shareable is None: + raise ValueError("Invalid value for `is_shareable`, must not be `None`") # noqa: E501 + + self._is_shareable = is_shareable + + @property + def capif_prov_doms(self) -> List[str]: + """Gets the capif_prov_doms of this ShareableInformation. + + List of CAPIF provider domains to which the service API information to be shared. # noqa: E501 + + :return: The capif_prov_doms of this ShareableInformation. + :rtype: List[str] + """ + return self._capif_prov_doms + + @capif_prov_doms.setter + def capif_prov_doms(self, capif_prov_doms: List[str]): + """Sets the capif_prov_doms of this ShareableInformation. + + List of CAPIF provider domains to which the service API information to be shared. # noqa: E501 + + :param capif_prov_doms: The capif_prov_doms of this ShareableInformation. + :type capif_prov_doms: List[str] + """ + if capif_prov_doms is not None and len(capif_prov_doms) < 1: + raise ValueError("Invalid value for `capif_prov_doms`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._capif_prov_doms = capif_prov_doms diff --git a/services/helper/helper_service/services/api/models/supported_gad_shapes.py b/services/helper/helper_service/services/api/models/supported_gad_shapes.py new file mode 100644 index 0000000000000000000000000000000000000000..bab499b0edb37a2f7122106e7d4889389715ee57 --- /dev/null +++ b/services/helper/helper_service/services/api/models/supported_gad_shapes.py @@ -0,0 +1,33 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model + + +class SupportedGADShapes(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self): # noqa: E501 + """SupportedGADShapes - a model defined in OpenAPI + + """ + self.openapi_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'SupportedGADShapes': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The SupportedGADShapes of this SupportedGADShapes. # noqa: E501 + :rtype: SupportedGADShapes + """ + return util.deserialize_model(dikt, cls) diff --git a/services/helper/helper_service/services/api/models/uncertainty_ellipse.py b/services/helper/helper_service/services/api/models/uncertainty_ellipse.py new file mode 100644 index 0000000000000000000000000000000000000000..1d4bfed3ad8d722a0482dc8ad37f3185da58fbdc --- /dev/null +++ b/services/helper/helper_service/services/api/models/uncertainty_ellipse.py @@ -0,0 +1,132 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model + + +class UncertaintyEllipse(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, semi_major=None, semi_minor=None, orientation_major=None): # noqa: E501 + """UncertaintyEllipse - a model defined in OpenAPI + + :param semi_major: The semi_major of this UncertaintyEllipse. # noqa: E501 + :type semi_major: float + :param semi_minor: The semi_minor of this UncertaintyEllipse. # noqa: E501 + :type semi_minor: float + :param orientation_major: The orientation_major of this UncertaintyEllipse. # noqa: E501 + :type orientation_major: int + """ + self.openapi_types = { + 'semi_major': float, + 'semi_minor': float, + 'orientation_major': int + } + + self.attribute_map = { + 'semi_major': 'semiMajor', + 'semi_minor': 'semiMinor', + 'orientation_major': 'orientationMajor' + } + + self._semi_major = semi_major + self._semi_minor = semi_minor + self._orientation_major = orientation_major + + @classmethod + def from_dict(cls, dikt) -> 'UncertaintyEllipse': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The UncertaintyEllipse of this UncertaintyEllipse. # noqa: E501 + :rtype: UncertaintyEllipse + """ + return util.deserialize_model(dikt, cls) + + @property + def semi_major(self) -> float: + """Gets the semi_major of this UncertaintyEllipse. + + Indicates value of uncertainty. # noqa: E501 + + :return: The semi_major of this UncertaintyEllipse. + :rtype: float + """ + return self._semi_major + + @semi_major.setter + def semi_major(self, semi_major: float): + """Sets the semi_major of this UncertaintyEllipse. + + Indicates value of uncertainty. # noqa: E501 + + :param semi_major: The semi_major of this UncertaintyEllipse. + :type semi_major: float + """ + if semi_major is None: + raise ValueError("Invalid value for `semi_major`, must not be `None`") # noqa: E501 + if semi_major is not None and semi_major < 0: # noqa: E501 + raise ValueError("Invalid value for `semi_major`, must be a value greater than or equal to `0`") # noqa: E501 + + self._semi_major = semi_major + + @property + def semi_minor(self) -> float: + """Gets the semi_minor of this UncertaintyEllipse. + + Indicates value of uncertainty. # noqa: E501 + + :return: The semi_minor of this UncertaintyEllipse. + :rtype: float + """ + return self._semi_minor + + @semi_minor.setter + def semi_minor(self, semi_minor: float): + """Sets the semi_minor of this UncertaintyEllipse. + + Indicates value of uncertainty. # noqa: E501 + + :param semi_minor: The semi_minor of this UncertaintyEllipse. + :type semi_minor: float + """ + if semi_minor is None: + raise ValueError("Invalid value for `semi_minor`, must not be `None`") # noqa: E501 + if semi_minor is not None and semi_minor < 0: # noqa: E501 + raise ValueError("Invalid value for `semi_minor`, must be a value greater than or equal to `0`") # noqa: E501 + + self._semi_minor = semi_minor + + @property + def orientation_major(self) -> int: + """Gets the orientation_major of this UncertaintyEllipse. + + Indicates value of orientation angle. # noqa: E501 + + :return: The orientation_major of this UncertaintyEllipse. + :rtype: int + """ + return self._orientation_major + + @orientation_major.setter + def orientation_major(self, orientation_major: int): + """Sets the orientation_major of this UncertaintyEllipse. + + Indicates value of orientation angle. # noqa: E501 + + :param orientation_major: The orientation_major of this UncertaintyEllipse. + :type orientation_major: int + """ + if orientation_major is None: + raise ValueError("Invalid value for `orientation_major`, must not be `None`") # noqa: E501 + if orientation_major is not None and orientation_major > 180: # noqa: E501 + raise ValueError("Invalid value for `orientation_major`, must be a value less than or equal to `180`") # noqa: E501 + if orientation_major is not None and orientation_major < 0: # noqa: E501 + raise ValueError("Invalid value for `orientation_major`, must be a value greater than or equal to `0`") # noqa: E501 + + self._orientation_major = orientation_major diff --git a/services/helper/helper_service/services/api/models/version.py b/services/helper/helper_service/services/api/models/version.py new file mode 100644 index 0000000000000000000000000000000000000000..5cb0e71296450c88a318d9ac9cf0db38346168b5 --- /dev/null +++ b/services/helper/helper_service/services/api/models/version.py @@ -0,0 +1,154 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model +from api.models.custom_operation import CustomOperation # noqa: E501 +from api.models.resource import Resource # noqa: E501 + + +class Version(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, api_version=None, expiry=None, resources=None, cust_operations=None): # noqa: E501 + """Version - a model defined in OpenAPI + + :param api_version: The api_version of this Version. # noqa: E501 + :type api_version: str + :param expiry: The expiry of this Version. # noqa: E501 + :type expiry: datetime + :param resources: The resources of this Version. # noqa: E501 + :type resources: List[Resource] + :param cust_operations: The cust_operations of this Version. # noqa: E501 + :type cust_operations: List[CustomOperation] + """ + self.openapi_types = { + 'api_version': str, + 'expiry': datetime, + 'resources': List[Resource], + 'cust_operations': List[CustomOperation] + } + + self.attribute_map = { + 'api_version': 'apiVersion', + 'expiry': 'expiry', + 'resources': 'resources', + 'cust_operations': 'custOperations' + } + + self._api_version = api_version + self._expiry = expiry + self._resources = resources + self._cust_operations = cust_operations + + @classmethod + def from_dict(cls, dikt) -> 'Version': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The Version of this Version. # noqa: E501 + :rtype: Version + """ + return util.deserialize_model(dikt, cls) + + @property + def api_version(self) -> str: + """Gets the api_version of this Version. + + API major version in URI (e.g. v1) # noqa: E501 + + :return: The api_version of this Version. + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version: str): + """Sets the api_version of this Version. + + API major version in URI (e.g. v1) # noqa: E501 + + :param api_version: The api_version of this Version. + :type api_version: str + """ + if api_version is None: + raise ValueError("Invalid value for `api_version`, must not be `None`") # noqa: E501 + + self._api_version = api_version + + @property + def expiry(self) -> datetime: + """Gets the expiry of this Version. + + string with format \"date-time\" as defined in OpenAPI. # noqa: E501 + + :return: The expiry of this Version. + :rtype: datetime + """ + return self._expiry + + @expiry.setter + def expiry(self, expiry: datetime): + """Sets the expiry of this Version. + + string with format \"date-time\" as defined in OpenAPI. # noqa: E501 + + :param expiry: The expiry of this Version. + :type expiry: datetime + """ + + self._expiry = expiry + + @property + def resources(self) -> List[Resource]: + """Gets the resources of this Version. + + Resources supported by the API. # noqa: E501 + + :return: The resources of this Version. + :rtype: List[Resource] + """ + return self._resources + + @resources.setter + def resources(self, resources: List[Resource]): + """Sets the resources of this Version. + + Resources supported by the API. # noqa: E501 + + :param resources: The resources of this Version. + :type resources: List[Resource] + """ + if resources is not None and len(resources) < 1: + raise ValueError("Invalid value for `resources`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._resources = resources + + @property + def cust_operations(self) -> List[CustomOperation]: + """Gets the cust_operations of this Version. + + Custom operations without resource association. # noqa: E501 + + :return: The cust_operations of this Version. + :rtype: List[CustomOperation] + """ + return self._cust_operations + + @cust_operations.setter + def cust_operations(self, cust_operations: List[CustomOperation]): + """Sets the cust_operations of this Version. + + Custom operations without resource association. # noqa: E501 + + :param cust_operations: The cust_operations of this Version. + :type cust_operations: List[CustomOperation] + """ + if cust_operations is not None and len(cust_operations) < 1: + raise ValueError("Invalid value for `cust_operations`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._cust_operations = cust_operations diff --git a/services/helper/helper_service/services/api/models/websock_notif_config.py b/services/helper/helper_service/services/api/models/websock_notif_config.py new file mode 100644 index 0000000000000000000000000000000000000000..b26056202644df9bee31b12b94da232fb445dae7 --- /dev/null +++ b/services/helper/helper_service/services/api/models/websock_notif_config.py @@ -0,0 +1,90 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from api import util +from api.models.base_model import Model + + +class WebsockNotifConfig(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, websocket_uri=None, request_websocket_uri=None): # noqa: E501 + """WebsockNotifConfig - a model defined in OpenAPI + + :param websocket_uri: The websocket_uri of this WebsockNotifConfig. # noqa: E501 + :type websocket_uri: str + :param request_websocket_uri: The request_websocket_uri of this WebsockNotifConfig. # noqa: E501 + :type request_websocket_uri: bool + """ + self.openapi_types = { + 'websocket_uri': str, + 'request_websocket_uri': bool + } + + self.attribute_map = { + 'websocket_uri': 'websocketUri', + 'request_websocket_uri': 'requestWebsocketUri' + } + + self._websocket_uri = websocket_uri + self._request_websocket_uri = request_websocket_uri + + @classmethod + def from_dict(cls, dikt) -> 'WebsockNotifConfig': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The WebsockNotifConfig of this WebsockNotifConfig. # noqa: E501 + :rtype: WebsockNotifConfig + """ + return util.deserialize_model(dikt, cls) + + @property + def websocket_uri(self) -> str: + """Gets the websocket_uri of this WebsockNotifConfig. + + string formatted according to IETF RFC 3986 identifying a referenced resource. # noqa: E501 + + :return: The websocket_uri of this WebsockNotifConfig. + :rtype: str + """ + return self._websocket_uri + + @websocket_uri.setter + def websocket_uri(self, websocket_uri: str): + """Sets the websocket_uri of this WebsockNotifConfig. + + string formatted according to IETF RFC 3986 identifying a referenced resource. # noqa: E501 + + :param websocket_uri: The websocket_uri of this WebsockNotifConfig. + :type websocket_uri: str + """ + + self._websocket_uri = websocket_uri + + @property + def request_websocket_uri(self) -> bool: + """Gets the request_websocket_uri of this WebsockNotifConfig. + + Set by the SCS/AS to indicate that the Websocket delivery is requested. # noqa: E501 + + :return: The request_websocket_uri of this WebsockNotifConfig. + :rtype: bool + """ + return self._request_websocket_uri + + @request_websocket_uri.setter + def request_websocket_uri(self, request_websocket_uri: bool): + """Sets the request_websocket_uri of this WebsockNotifConfig. + + Set by the SCS/AS to indicate that the Websocket delivery is requested. # noqa: E501 + + :param request_websocket_uri: The request_websocket_uri of this WebsockNotifConfig. + :type request_websocket_uri: bool + """ + + self._request_websocket_uri = request_websocket_uri diff --git a/services/helper/helper_service/services/api/openapi/openapi.yaml b/services/helper/helper_service/services/api/openapi/openapi.yaml new file mode 100644 index 0000000000000000000000000000000000000000..9853138be497da7e36464cf78080d8e2c85dda93 --- /dev/null +++ b/services/helper/helper_service/services/api/openapi/openapi.yaml @@ -0,0 +1,5521 @@ +openapi: 3.0.1 +info: + description: | + CAPIF Helper API for browsing CAPIF runtime data: invokers, providers, services, + security bindings, and subscriptions/events. This is an internal helper interface. + title: Helper API + version: 1.0.0 +servers: +- url: "{apiRoot}/api" + variables: + apiRoot: + default: http://localhost:8080 + description: Base URL of the Helper service. +paths: + /deleteEntities/{uuid}: + delete: + description: "Deletes all CAPIF entities (invokers, providers, services, security\ + \ contexts, events) associated with the given UUID." + operationId: helper_controller_delete_entities + parameters: + - description: UUID of the user whose entities are to be deleted. + explode: false + in: path + name: uuid + required: true + schema: + type: string + style: simple + responses: + "200": + description: Entities deleted successfully. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Bad request. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Internal server error. + default: + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Generic error response. + summary: Delete entities by UUID + x-openapi-router-controller: api.controllers.default_controller + /getCcfId: + get: + description: Retrieves the CCF ID of the CAPIF Core Function. + operationId: helper_controller_get_ccf_id + responses: + "200": + description: CCF ID retrieved successfully. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Bad request. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Internal server error. + default: + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Generic error response. + summary: Get CCF ID + x-openapi-router-controller: api.controllers.default_controller + /getEvents: + get: + description: Returns CAPIF event subscriptions or delivered events. + operationId: helper_controller_get_events + parameters: + - description: Filter by subscriber identifier. + explode: true + in: query + name: subscriber_id + required: false + schema: + type: string + style: form + - description: Filter by subscription identifier. + explode: true + in: query + name: subscription_id + required: false + schema: + type: string + style: form + - description: Page size. + explode: true + in: query + name: page_size + required: false + schema: + default: 20 + minimum: 1 + type: integer + style: form + - description: Page index (0-based). + explode: true + in: query + name: page + required: false + schema: + default: 0 + minimum: 0 + type: integer + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedResponseEvent' + description: Paged list of events. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Bad request. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Internal server error. + default: + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Generic error response. + summary: Retrieve CAPIF events + x-openapi-router-controller: api.controllers.default_controller + /getInvokers: + get: + description: Returns invoker entries with pagination and optional filters. + operationId: helper_controller_get_invokers + parameters: + - description: Filter by invoker UUID. + explode: true + in: query + name: uuid + required: false + schema: + type: string + style: form + - description: Filter by CAPIF `apiInvokerId`. + explode: true + in: query + name: api_invoker_id + required: false + schema: + type: string + style: form + - description: Page size. + explode: true + in: query + name: page_size + required: false + schema: + default: 20 + minimum: 1 + type: integer + style: form + - description: Page index (0-based). + explode: true + in: query + name: page + required: false + schema: + default: 0 + minimum: 0 + type: integer + style: form + - description: Sort direction. + explode: true + in: query + name: sort_order + required: false + schema: + enum: + - asc + - desc + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedResponseInvoker' + description: Paged list of invokers. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Bad request. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Internal server error. + default: + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Generic error response. + summary: Retrieve API invokers + x-openapi-router-controller: api.controllers.default_controller + /getProviders: + get: + description: Returns provider domains (CAPIF provider domains / AEF providers) + with pagination. + operationId: helper_controller_get_providers + parameters: + - description: Filter by provider UUID. + explode: true + in: query + name: uuid + required: false + schema: + type: string + style: form + - description: Filter by provider domain ID. + explode: true + in: query + name: api_prov_dom_id + required: false + schema: + type: string + style: form + - description: Page size. + explode: true + in: query + name: page_size + required: false + schema: + default: 20 + minimum: 1 + type: integer + style: form + - description: Page index (0-based). + explode: true + in: query + name: page + required: false + schema: + default: 0 + minimum: 0 + type: integer + style: form + - description: Sort direction. + explode: true + in: query + name: sort_order + required: false + schema: + enum: + - asc + - desc + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedResponseProvider' + description: Paged list of providers. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Bad request. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Internal server error. + default: + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Generic error response. + summary: Retrieve providers + x-openapi-router-controller: api.controllers.default_controller + /getSecurity: + get: + description: Returns security credentials/bindings for a given invoker. + operationId: helper_controller_get_security + parameters: + - description: Filter by invoker identifier. + explode: true + in: query + name: invoker_id + required: false + schema: + type: string + style: form + - description: Page size. + explode: true + in: query + name: page_size + required: false + schema: + default: 20 + minimum: 1 + type: integer + style: form + - description: Page index (0-based). + explode: true + in: query + name: page + required: false + schema: + default: 0 + minimum: 0 + type: integer + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedResponseSecurity' + description: Paged list of security entries. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Bad request. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Internal server error. + default: + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Generic error response. + summary: Retrieve security associations + x-openapi-router-controller: api.controllers.default_controller + /getServices: + get: + description: Returns published APIs/services exposed by providers. + operationId: helper_controller_get_services + parameters: + - description: Filter by service identifier. + explode: true + in: query + name: service_id + required: false + schema: + type: string + style: form + - description: Filter by APF identifier. + explode: true + in: query + name: apf_id + required: false + schema: + type: string + style: form + - description: Filter by API name. + explode: true + in: query + name: api_name + required: false + schema: + type: string + style: form + - description: Page size. + explode: true + in: query + name: page_size + required: false + schema: + default: 20 + minimum: 1 + type: integer + style: form + - description: Page index (0-based). + explode: true + in: query + name: page + required: false + schema: + default: 0 + minimum: 0 + type: integer + style: form + - description: Sort direction. + explode: true + in: query + name: sort_order + required: false + schema: + enum: + - asc + - desc + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedResponseService' + description: Paged list of services. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Bad request. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Internal server error. + default: + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Generic error response. + summary: Retrieve services + x-openapi-router-controller: api.controllers.default_controller +components: + responses: + BadRequest: + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Bad request. + InternalError: + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Internal server error. + GenericError: + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Generic error response. + schemas: + ErrorResponse: + description: Generic error payload. + example: + details: details + message: message + properties: + message: + title: message + type: string + details: + title: details + type: string + title: ErrorResponse + type: object + PaginatedResponseBase: + description: Common pagination envelope. + properties: + total: + description: Total number of resources in CAPIF. + example: 42 + title: total + type: integer + long: + description: Total number of resources that match the given parameters + example: 0 + title: long + type: integer + totalPages: + description: Total number of pages given page size. + example: 20 + title: totalPages + type: integer + sort_order: + description: Sorting by creation date of the resources (ascending or descending). + enum: + - asc + - desc + example: asc + title: sort_order + type: string + title: PaginatedResponseBase + type: object + PaginatedResponseInvoker: + allOf: + - $ref: '#/components/schemas/PaginatedResponseBase' + - properties: + invokers: + description: CAPIF invokers list + items: + $ref: '#/components/schemas/APIInvokerEnrolmentDetails' + type: array + type: object + example: + total: 42 + totalPages: 20 + invokers: + - notificationDestination: notificationDestination + supportedFeatures: supportedFeatures + apiInvokerId: apiInvokerId + apiInvokerInformation: apiInvokerInformation + websockNotifConfig: + requestWebsocketUri: true + websocketUri: websocketUri + uuid: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + onboardingInformation: + apiInvokerPublicKey: apiInvokerPublicKey + onboardingSecret: onboardingSecret + apiInvokerCertificate: apiInvokerCertificate + onboarding_date: 2000-01-23T04:56:07.000+00:00 + requestTestNotification: true + username: username + apiList: + serviceAPIDescriptions: + - serviceAPICategory: serviceAPICategory + ccfId: ccfId + apiName: apiName + shareableInfo: + capifProvDoms: + - capifProvDoms + - capifProvDoms + isShareable: true + supportedFeatures: supportedFeatures + description: description + apiSuppFeats: apiSuppFeats + apiId: apiId + aefProfiles: + - protocol: HTTP_1_1 + securityMethods: + - PSK + - PSK + versions: + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + dataFormat: JSON + domainName: domainName + aefLocation: + dcId: dcId + geoArea: + shape: POINT + point: + lon: 36.988422590534526 + lat: -63.615366350946985 + civicAddr: + POBOX: POBOX + usageRules: usageRules + country: country + PRD: PRD + PLC: PLC + HNO: HNO + PRM: PRM + HNS: HNS + FLR: FLR + A1: A1 + A2: A2 + A3: A3 + A4: A4 + STS: STS + A5: A5 + A6: A6 + RDSEC: RDSEC + providedBy: providedBy + LOC: LOC + UNIT: UNIT + SEAT: SEAT + POD: POD + RDBR: RDBR + method: method + LMK: LMK + POM: POM + ADDCODE: ADDCODE + RD: RD + PC: PC + PCN: PCN + NAM: NAM + BLD: BLD + ROOM: ROOM + RDSUBBR: RDSUBBR + aefId: aefId + interfaceDescriptions: + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + - protocol: HTTP_1_1 + securityMethods: + - PSK + - PSK + versions: + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + dataFormat: JSON + domainName: domainName + aefLocation: + dcId: dcId + geoArea: + shape: POINT + point: + lon: 36.988422590534526 + lat: -63.615366350946985 + civicAddr: + POBOX: POBOX + usageRules: usageRules + country: country + PRD: PRD + PLC: PLC + HNO: HNO + PRM: PRM + HNS: HNS + FLR: FLR + A1: A1 + A2: A2 + A3: A3 + A4: A4 + STS: STS + A5: A5 + A6: A6 + RDSEC: RDSEC + providedBy: providedBy + LOC: LOC + UNIT: UNIT + SEAT: SEAT + POD: POD + RDBR: RDBR + method: method + LMK: LMK + POM: POM + ADDCODE: ADDCODE + RD: RD + PC: PC + PCN: PCN + NAM: NAM + BLD: BLD + ROOM: ROOM + RDSUBBR: RDSUBBR + aefId: aefId + interfaceDescriptions: + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + pubApiPath: + ccfIds: + - ccfIds + - ccfIds + - serviceAPICategory: serviceAPICategory + ccfId: ccfId + apiName: apiName + shareableInfo: + capifProvDoms: + - capifProvDoms + - capifProvDoms + isShareable: true + supportedFeatures: supportedFeatures + description: description + apiSuppFeats: apiSuppFeats + apiId: apiId + aefProfiles: + - protocol: HTTP_1_1 + securityMethods: + - PSK + - PSK + versions: + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + dataFormat: JSON + domainName: domainName + aefLocation: + dcId: dcId + geoArea: + shape: POINT + point: + lon: 36.988422590534526 + lat: -63.615366350946985 + civicAddr: + POBOX: POBOX + usageRules: usageRules + country: country + PRD: PRD + PLC: PLC + HNO: HNO + PRM: PRM + HNS: HNS + FLR: FLR + A1: A1 + A2: A2 + A3: A3 + A4: A4 + STS: STS + A5: A5 + A6: A6 + RDSEC: RDSEC + providedBy: providedBy + LOC: LOC + UNIT: UNIT + SEAT: SEAT + POD: POD + RDBR: RDBR + method: method + LMK: LMK + POM: POM + ADDCODE: ADDCODE + RD: RD + PC: PC + PCN: PCN + NAM: NAM + BLD: BLD + ROOM: ROOM + RDSUBBR: RDSUBBR + aefId: aefId + interfaceDescriptions: + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + - protocol: HTTP_1_1 + securityMethods: + - PSK + - PSK + versions: + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + dataFormat: JSON + domainName: domainName + aefLocation: + dcId: dcId + geoArea: + shape: POINT + point: + lon: 36.988422590534526 + lat: -63.615366350946985 + civicAddr: + POBOX: POBOX + usageRules: usageRules + country: country + PRD: PRD + PLC: PLC + HNO: HNO + PRM: PRM + HNS: HNS + FLR: FLR + A1: A1 + A2: A2 + A3: A3 + A4: A4 + STS: STS + A5: A5 + A6: A6 + RDSEC: RDSEC + providedBy: providedBy + LOC: LOC + UNIT: UNIT + SEAT: SEAT + POD: POD + RDBR: RDBR + method: method + LMK: LMK + POM: POM + ADDCODE: ADDCODE + RD: RD + PC: PC + PCN: PCN + NAM: NAM + BLD: BLD + ROOM: ROOM + RDSUBBR: RDSUBBR + aefId: aefId + interfaceDescriptions: + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + pubApiPath: + ccfIds: + - ccfIds + - ccfIds + - notificationDestination: notificationDestination + supportedFeatures: supportedFeatures + apiInvokerId: apiInvokerId + apiInvokerInformation: apiInvokerInformation + websockNotifConfig: + requestWebsocketUri: true + websocketUri: websocketUri + uuid: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + onboardingInformation: + apiInvokerPublicKey: apiInvokerPublicKey + onboardingSecret: onboardingSecret + apiInvokerCertificate: apiInvokerCertificate + onboarding_date: 2000-01-23T04:56:07.000+00:00 + requestTestNotification: true + username: username + apiList: + serviceAPIDescriptions: + - serviceAPICategory: serviceAPICategory + ccfId: ccfId + apiName: apiName + shareableInfo: + capifProvDoms: + - capifProvDoms + - capifProvDoms + isShareable: true + supportedFeatures: supportedFeatures + description: description + apiSuppFeats: apiSuppFeats + apiId: apiId + aefProfiles: + - protocol: HTTP_1_1 + securityMethods: + - PSK + - PSK + versions: + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + dataFormat: JSON + domainName: domainName + aefLocation: + dcId: dcId + geoArea: + shape: POINT + point: + lon: 36.988422590534526 + lat: -63.615366350946985 + civicAddr: + POBOX: POBOX + usageRules: usageRules + country: country + PRD: PRD + PLC: PLC + HNO: HNO + PRM: PRM + HNS: HNS + FLR: FLR + A1: A1 + A2: A2 + A3: A3 + A4: A4 + STS: STS + A5: A5 + A6: A6 + RDSEC: RDSEC + providedBy: providedBy + LOC: LOC + UNIT: UNIT + SEAT: SEAT + POD: POD + RDBR: RDBR + method: method + LMK: LMK + POM: POM + ADDCODE: ADDCODE + RD: RD + PC: PC + PCN: PCN + NAM: NAM + BLD: BLD + ROOM: ROOM + RDSUBBR: RDSUBBR + aefId: aefId + interfaceDescriptions: + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + - protocol: HTTP_1_1 + securityMethods: + - PSK + - PSK + versions: + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + dataFormat: JSON + domainName: domainName + aefLocation: + dcId: dcId + geoArea: + shape: POINT + point: + lon: 36.988422590534526 + lat: -63.615366350946985 + civicAddr: + POBOX: POBOX + usageRules: usageRules + country: country + PRD: PRD + PLC: PLC + HNO: HNO + PRM: PRM + HNS: HNS + FLR: FLR + A1: A1 + A2: A2 + A3: A3 + A4: A4 + STS: STS + A5: A5 + A6: A6 + RDSEC: RDSEC + providedBy: providedBy + LOC: LOC + UNIT: UNIT + SEAT: SEAT + POD: POD + RDBR: RDBR + method: method + LMK: LMK + POM: POM + ADDCODE: ADDCODE + RD: RD + PC: PC + PCN: PCN + NAM: NAM + BLD: BLD + ROOM: ROOM + RDSUBBR: RDSUBBR + aefId: aefId + interfaceDescriptions: + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + pubApiPath: + ccfIds: + - ccfIds + - ccfIds + - serviceAPICategory: serviceAPICategory + ccfId: ccfId + apiName: apiName + shareableInfo: + capifProvDoms: + - capifProvDoms + - capifProvDoms + isShareable: true + supportedFeatures: supportedFeatures + description: description + apiSuppFeats: apiSuppFeats + apiId: apiId + aefProfiles: + - protocol: HTTP_1_1 + securityMethods: + - PSK + - PSK + versions: + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + dataFormat: JSON + domainName: domainName + aefLocation: + dcId: dcId + geoArea: + shape: POINT + point: + lon: 36.988422590534526 + lat: -63.615366350946985 + civicAddr: + POBOX: POBOX + usageRules: usageRules + country: country + PRD: PRD + PLC: PLC + HNO: HNO + PRM: PRM + HNS: HNS + FLR: FLR + A1: A1 + A2: A2 + A3: A3 + A4: A4 + STS: STS + A5: A5 + A6: A6 + RDSEC: RDSEC + providedBy: providedBy + LOC: LOC + UNIT: UNIT + SEAT: SEAT + POD: POD + RDBR: RDBR + method: method + LMK: LMK + POM: POM + ADDCODE: ADDCODE + RD: RD + PC: PC + PCN: PCN + NAM: NAM + BLD: BLD + ROOM: ROOM + RDSUBBR: RDSUBBR + aefId: aefId + interfaceDescriptions: + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + - protocol: HTTP_1_1 + securityMethods: + - PSK + - PSK + versions: + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + dataFormat: JSON + domainName: domainName + aefLocation: + dcId: dcId + geoArea: + shape: POINT + point: + lon: 36.988422590534526 + lat: -63.615366350946985 + civicAddr: + POBOX: POBOX + usageRules: usageRules + country: country + PRD: PRD + PLC: PLC + HNO: HNO + PRM: PRM + HNS: HNS + FLR: FLR + A1: A1 + A2: A2 + A3: A3 + A4: A4 + STS: STS + A5: A5 + A6: A6 + RDSEC: RDSEC + providedBy: providedBy + LOC: LOC + UNIT: UNIT + SEAT: SEAT + POD: POD + RDBR: RDBR + method: method + LMK: LMK + POM: POM + ADDCODE: ADDCODE + RD: RD + PC: PC + PCN: PCN + NAM: NAM + BLD: BLD + ROOM: ROOM + RDSUBBR: RDSUBBR + aefId: aefId + interfaceDescriptions: + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + pubApiPath: + ccfIds: + - ccfIds + - ccfIds + sort_order: asc + long: 0 + title: PaginatedResponseInvoker + PaginatedResponseProvider: + allOf: + - $ref: '#/components/schemas/PaginatedResponseBase' + - properties: + providers: + description: CAPIF providers list + items: + $ref: '#/components/schemas/APIProviderEnrolmentDetails' + type: array + type: object + example: + total: 42 + totalPages: 20 + sort_order: asc + long: 0 + providers: + - regSec: regSec + apiProvFuncs: + - apiProvFuncId: apiProvFuncId + apiProvFuncInfo: apiProvFuncInfo + regInfo: + apiProvCert: apiProvCert + apiProvPubKey: apiProvPubKey + apiProvFuncRole: AEF + - apiProvFuncId: apiProvFuncId + apiProvFuncInfo: apiProvFuncInfo + regInfo: + apiProvCert: apiProvCert + apiProvPubKey: apiProvPubKey + apiProvFuncRole: AEF + failReason: failReason + uuid: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + apiProvDomId: apiProvDomId + apiProvDomInfo: apiProvDomInfo + onboarding_date: 2000-01-23T04:56:07.000+00:00 + suppFeat: suppFeat + username: username + - regSec: regSec + apiProvFuncs: + - apiProvFuncId: apiProvFuncId + apiProvFuncInfo: apiProvFuncInfo + regInfo: + apiProvCert: apiProvCert + apiProvPubKey: apiProvPubKey + apiProvFuncRole: AEF + - apiProvFuncId: apiProvFuncId + apiProvFuncInfo: apiProvFuncInfo + regInfo: + apiProvCert: apiProvCert + apiProvPubKey: apiProvPubKey + apiProvFuncRole: AEF + failReason: failReason + uuid: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + apiProvDomId: apiProvDomId + apiProvDomInfo: apiProvDomInfo + onboarding_date: 2000-01-23T04:56:07.000+00:00 + suppFeat: suppFeat + username: username + title: PaginatedResponseProvider + PaginatedResponseService: + allOf: + - $ref: '#/components/schemas/PaginatedResponseBase' + - properties: + services: + description: CAPIF services list. + items: + $ref: '#/components/schemas/ServiceAPIDescription' + type: array + type: object + example: + total: 42 + totalPages: 20 + services: + - serviceAPICategory: serviceAPICategory + ccfId: ccfId + apiName: apiName + shareableInfo: + capifProvDoms: + - capifProvDoms + - capifProvDoms + isShareable: true + supportedFeatures: supportedFeatures + description: description + apiSuppFeats: apiSuppFeats + apiId: apiId + aefProfiles: + - protocol: HTTP_1_1 + securityMethods: + - PSK + - PSK + versions: + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + dataFormat: JSON + domainName: domainName + aefLocation: + dcId: dcId + geoArea: + shape: POINT + point: + lon: 36.988422590534526 + lat: -63.615366350946985 + civicAddr: + POBOX: POBOX + usageRules: usageRules + country: country + PRD: PRD + PLC: PLC + HNO: HNO + PRM: PRM + HNS: HNS + FLR: FLR + A1: A1 + A2: A2 + A3: A3 + A4: A4 + STS: STS + A5: A5 + A6: A6 + RDSEC: RDSEC + providedBy: providedBy + LOC: LOC + UNIT: UNIT + SEAT: SEAT + POD: POD + RDBR: RDBR + method: method + LMK: LMK + POM: POM + ADDCODE: ADDCODE + RD: RD + PC: PC + PCN: PCN + NAM: NAM + BLD: BLD + ROOM: ROOM + RDSUBBR: RDSUBBR + aefId: aefId + interfaceDescriptions: + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + - protocol: HTTP_1_1 + securityMethods: + - PSK + - PSK + versions: + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + dataFormat: JSON + domainName: domainName + aefLocation: + dcId: dcId + geoArea: + shape: POINT + point: + lon: 36.988422590534526 + lat: -63.615366350946985 + civicAddr: + POBOX: POBOX + usageRules: usageRules + country: country + PRD: PRD + PLC: PLC + HNO: HNO + PRM: PRM + HNS: HNS + FLR: FLR + A1: A1 + A2: A2 + A3: A3 + A4: A4 + STS: STS + A5: A5 + A6: A6 + RDSEC: RDSEC + providedBy: providedBy + LOC: LOC + UNIT: UNIT + SEAT: SEAT + POD: POD + RDBR: RDBR + method: method + LMK: LMK + POM: POM + ADDCODE: ADDCODE + RD: RD + PC: PC + PCN: PCN + NAM: NAM + BLD: BLD + ROOM: ROOM + RDSUBBR: RDSUBBR + aefId: aefId + interfaceDescriptions: + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + pubApiPath: + ccfIds: + - ccfIds + - ccfIds + - serviceAPICategory: serviceAPICategory + ccfId: ccfId + apiName: apiName + shareableInfo: + capifProvDoms: + - capifProvDoms + - capifProvDoms + isShareable: true + supportedFeatures: supportedFeatures + description: description + apiSuppFeats: apiSuppFeats + apiId: apiId + aefProfiles: + - protocol: HTTP_1_1 + securityMethods: + - PSK + - PSK + versions: + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + dataFormat: JSON + domainName: domainName + aefLocation: + dcId: dcId + geoArea: + shape: POINT + point: + lon: 36.988422590534526 + lat: -63.615366350946985 + civicAddr: + POBOX: POBOX + usageRules: usageRules + country: country + PRD: PRD + PLC: PLC + HNO: HNO + PRM: PRM + HNS: HNS + FLR: FLR + A1: A1 + A2: A2 + A3: A3 + A4: A4 + STS: STS + A5: A5 + A6: A6 + RDSEC: RDSEC + providedBy: providedBy + LOC: LOC + UNIT: UNIT + SEAT: SEAT + POD: POD + RDBR: RDBR + method: method + LMK: LMK + POM: POM + ADDCODE: ADDCODE + RD: RD + PC: PC + PCN: PCN + NAM: NAM + BLD: BLD + ROOM: ROOM + RDSUBBR: RDSUBBR + aefId: aefId + interfaceDescriptions: + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + - protocol: HTTP_1_1 + securityMethods: + - PSK + - PSK + versions: + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + dataFormat: JSON + domainName: domainName + aefLocation: + dcId: dcId + geoArea: + shape: POINT + point: + lon: 36.988422590534526 + lat: -63.615366350946985 + civicAddr: + POBOX: POBOX + usageRules: usageRules + country: country + PRD: PRD + PLC: PLC + HNO: HNO + PRM: PRM + HNS: HNS + FLR: FLR + A1: A1 + A2: A2 + A3: A3 + A4: A4 + STS: STS + A5: A5 + A6: A6 + RDSEC: RDSEC + providedBy: providedBy + LOC: LOC + UNIT: UNIT + SEAT: SEAT + POD: POD + RDBR: RDBR + method: method + LMK: LMK + POM: POM + ADDCODE: ADDCODE + RD: RD + PC: PC + PCN: PCN + NAM: NAM + BLD: BLD + ROOM: ROOM + RDSUBBR: RDSUBBR + aefId: aefId + interfaceDescriptions: + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + pubApiPath: + ccfIds: + - ccfIds + - ccfIds + sort_order: asc + long: 0 + title: PaginatedResponseService + PaginatedResponseSecurity: + allOf: + - $ref: '#/components/schemas/PaginatedResponseBase' + - properties: + security: + description: CAPIF security context list. + items: + $ref: '#/components/schemas/ServiceSecurity' + type: array + type: object + example: + total: 42 + security: + - notificationDestination: notificationDestination + api_invoker_id: api_invoker_id + supportedFeatures: supportedFeatures + securityInfo: + - selSecurityMethod: null + authenticationInfo: authenticationInfo + authorizationInfo: authorizationInfo + interfaceDetails: + ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + prefSecurityMethods: + - PSK + - PSK + aefId: aefId + apiId: apiId + - selSecurityMethod: null + authenticationInfo: authenticationInfo + authorizationInfo: authorizationInfo + interfaceDetails: + ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + prefSecurityMethods: + - PSK + - PSK + aefId: aefId + apiId: apiId + websockNotifConfig: + requestWebsocketUri: true + websocketUri: websocketUri + requestTestNotification: true + - notificationDestination: notificationDestination + api_invoker_id: api_invoker_id + supportedFeatures: supportedFeatures + securityInfo: + - selSecurityMethod: null + authenticationInfo: authenticationInfo + authorizationInfo: authorizationInfo + interfaceDetails: + ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + prefSecurityMethods: + - PSK + - PSK + aefId: aefId + apiId: apiId + - selSecurityMethod: null + authenticationInfo: authenticationInfo + authorizationInfo: authorizationInfo + interfaceDetails: + ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + prefSecurityMethods: + - PSK + - PSK + aefId: aefId + apiId: apiId + websockNotifConfig: + requestWebsocketUri: true + websocketUri: websocketUri + requestTestNotification: true + totalPages: 20 + sort_order: asc + long: 0 + title: PaginatedResponseSecurity + PaginatedResponseEvent: + allOf: + - $ref: '#/components/schemas/PaginatedResponseBase' + - properties: + events: + description: CAPIF events list. + items: + $ref: '#/components/schemas/EventSubscription' + type: array + type: object + example: + total: 42 + totalPages: 20 + sort_order: asc + long: 0 + events: + - notificationDestination: notificationDestination + eventFilters: + - aefIds: + - aefIds + - aefIds + apiInvokerIds: + - apiInvokerIds + - apiInvokerIds + apiIds: + - apiIds + - apiIds + - aefIds: + - aefIds + - aefIds + apiInvokerIds: + - apiInvokerIds + - apiInvokerIds + apiIds: + - apiIds + - apiIds + supportedFeatures: supportedFeatures + eventReq: + notifMethod: PERIODIC + partitionCriteria: + - TAC + - TAC + grpRepTime: 5 + notifFlag: ACTIVATE + monDur: 2000-01-23T04:56:07.000+00:00 + immRep: true + maxReportNbr: 0 + repPeriod: 6 + sampRatio: 15 + websockNotifConfig: + requestWebsocketUri: true + websocketUri: websocketUri + events: + - SERVICE_API_AVAILABLE + - SERVICE_API_AVAILABLE + requestTestNotification: true + - notificationDestination: notificationDestination + eventFilters: + - aefIds: + - aefIds + - aefIds + apiInvokerIds: + - apiInvokerIds + - apiInvokerIds + apiIds: + - apiIds + - apiIds + - aefIds: + - aefIds + - aefIds + apiInvokerIds: + - apiInvokerIds + - apiInvokerIds + apiIds: + - apiIds + - apiIds + supportedFeatures: supportedFeatures + eventReq: + notifMethod: PERIODIC + partitionCriteria: + - TAC + - TAC + grpRepTime: 5 + notifFlag: ACTIVATE + monDur: 2000-01-23T04:56:07.000+00:00 + immRep: true + maxReportNbr: 0 + repPeriod: 6 + sampRatio: 15 + websockNotifConfig: + requestWebsocketUri: true + websocketUri: websocketUri + events: + - SERVICE_API_AVAILABLE + - SERVICE_API_AVAILABLE + requestTestNotification: true + title: PaginatedResponseEvent + APIInvokerEnrolmentDetails: + description: Information about the API Invoker that requested to onboard + example: + notificationDestination: notificationDestination + supportedFeatures: supportedFeatures + apiInvokerId: apiInvokerId + apiInvokerInformation: apiInvokerInformation + websockNotifConfig: + requestWebsocketUri: true + websocketUri: websocketUri + uuid: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + onboardingInformation: + apiInvokerPublicKey: apiInvokerPublicKey + onboardingSecret: onboardingSecret + apiInvokerCertificate: apiInvokerCertificate + onboarding_date: 2000-01-23T04:56:07.000+00:00 + requestTestNotification: true + username: username + apiList: + serviceAPIDescriptions: + - serviceAPICategory: serviceAPICategory + ccfId: ccfId + apiName: apiName + shareableInfo: + capifProvDoms: + - capifProvDoms + - capifProvDoms + isShareable: true + supportedFeatures: supportedFeatures + description: description + apiSuppFeats: apiSuppFeats + apiId: apiId + aefProfiles: + - protocol: HTTP_1_1 + securityMethods: + - PSK + - PSK + versions: + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + dataFormat: JSON + domainName: domainName + aefLocation: + dcId: dcId + geoArea: + shape: POINT + point: + lon: 36.988422590534526 + lat: -63.615366350946985 + civicAddr: + POBOX: POBOX + usageRules: usageRules + country: country + PRD: PRD + PLC: PLC + HNO: HNO + PRM: PRM + HNS: HNS + FLR: FLR + A1: A1 + A2: A2 + A3: A3 + A4: A4 + STS: STS + A5: A5 + A6: A6 + RDSEC: RDSEC + providedBy: providedBy + LOC: LOC + UNIT: UNIT + SEAT: SEAT + POD: POD + RDBR: RDBR + method: method + LMK: LMK + POM: POM + ADDCODE: ADDCODE + RD: RD + PC: PC + PCN: PCN + NAM: NAM + BLD: BLD + ROOM: ROOM + RDSUBBR: RDSUBBR + aefId: aefId + interfaceDescriptions: + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + - protocol: HTTP_1_1 + securityMethods: + - PSK + - PSK + versions: + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + dataFormat: JSON + domainName: domainName + aefLocation: + dcId: dcId + geoArea: + shape: POINT + point: + lon: 36.988422590534526 + lat: -63.615366350946985 + civicAddr: + POBOX: POBOX + usageRules: usageRules + country: country + PRD: PRD + PLC: PLC + HNO: HNO + PRM: PRM + HNS: HNS + FLR: FLR + A1: A1 + A2: A2 + A3: A3 + A4: A4 + STS: STS + A5: A5 + A6: A6 + RDSEC: RDSEC + providedBy: providedBy + LOC: LOC + UNIT: UNIT + SEAT: SEAT + POD: POD + RDBR: RDBR + method: method + LMK: LMK + POM: POM + ADDCODE: ADDCODE + RD: RD + PC: PC + PCN: PCN + NAM: NAM + BLD: BLD + ROOM: ROOM + RDSUBBR: RDSUBBR + aefId: aefId + interfaceDescriptions: + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + pubApiPath: + ccfIds: + - ccfIds + - ccfIds + - serviceAPICategory: serviceAPICategory + ccfId: ccfId + apiName: apiName + shareableInfo: + capifProvDoms: + - capifProvDoms + - capifProvDoms + isShareable: true + supportedFeatures: supportedFeatures + description: description + apiSuppFeats: apiSuppFeats + apiId: apiId + aefProfiles: + - protocol: HTTP_1_1 + securityMethods: + - PSK + - PSK + versions: + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + dataFormat: JSON + domainName: domainName + aefLocation: + dcId: dcId + geoArea: + shape: POINT + point: + lon: 36.988422590534526 + lat: -63.615366350946985 + civicAddr: + POBOX: POBOX + usageRules: usageRules + country: country + PRD: PRD + PLC: PLC + HNO: HNO + PRM: PRM + HNS: HNS + FLR: FLR + A1: A1 + A2: A2 + A3: A3 + A4: A4 + STS: STS + A5: A5 + A6: A6 + RDSEC: RDSEC + providedBy: providedBy + LOC: LOC + UNIT: UNIT + SEAT: SEAT + POD: POD + RDBR: RDBR + method: method + LMK: LMK + POM: POM + ADDCODE: ADDCODE + RD: RD + PC: PC + PCN: PCN + NAM: NAM + BLD: BLD + ROOM: ROOM + RDSUBBR: RDSUBBR + aefId: aefId + interfaceDescriptions: + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + - protocol: HTTP_1_1 + securityMethods: + - PSK + - PSK + versions: + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + dataFormat: JSON + domainName: domainName + aefLocation: + dcId: dcId + geoArea: + shape: POINT + point: + lon: 36.988422590534526 + lat: -63.615366350946985 + civicAddr: + POBOX: POBOX + usageRules: usageRules + country: country + PRD: PRD + PLC: PLC + HNO: HNO + PRM: PRM + HNS: HNS + FLR: FLR + A1: A1 + A2: A2 + A3: A3 + A4: A4 + STS: STS + A5: A5 + A6: A6 + RDSEC: RDSEC + providedBy: providedBy + LOC: LOC + UNIT: UNIT + SEAT: SEAT + POD: POD + RDBR: RDBR + method: method + LMK: LMK + POM: POM + ADDCODE: ADDCODE + RD: RD + PC: PC + PCN: PCN + NAM: NAM + BLD: BLD + ROOM: ROOM + RDSUBBR: RDSUBBR + aefId: aefId + interfaceDescriptions: + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + pubApiPath: + ccfIds: + - ccfIds + - ccfIds + properties: + onboarding_date: + description: Invoker onboarding date + format: date-time + title: onboarding_date + type: string + username: + description: User who registered the invoker + title: username + type: string + uuid: + description: uuid of the user who registered the invoker + format: uuid + title: uuid + type: string + apiInvokerId: + description: | + API invoker ID assigned by the CAPIF core function to the API invoker while on-boarding the API invoker. Shall not be present in the HTTP POST request from the API invoker to the CAPIF core function, to on-board itself. Shall be present in all other HTTP requests and responses. + readOnly: true + title: apiInvokerId + type: string + onboardingInformation: + $ref: '#/components/schemas/OnboardingInformation' + notificationDestination: + description: string providing an URI formatted according to IETF RFC 3986. + title: Uri + type: string + requestTestNotification: + description: | + Set to true by Subscriber to request the CAPIF core function to send a test notification as defined in in clause 7.6. Set to false or omitted otherwise. + title: requestTestNotification + type: boolean + websockNotifConfig: + $ref: '#/components/schemas/WebsockNotifConfig' + apiList: + $ref: '#/components/schemas/APIList' + apiInvokerInformation: + description: | + Generic information related to the API invoker such as details of the device or the application. + title: apiInvokerInformation + type: string + supportedFeatures: + description: | + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of "0" to "9", "a" to "f" or "A" to "F" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. + pattern: "^[A-Fa-f0-9]*$" + title: SupportedFeatures + type: string + required: + - notificationDestination + - onboardingInformation + title: APIInvokerEnrolmentDetails + type: object + APIProviderEnrolmentDetails: + description: Represents an API provider domain's enrolment details. + example: + regSec: regSec + apiProvFuncs: + - apiProvFuncId: apiProvFuncId + apiProvFuncInfo: apiProvFuncInfo + regInfo: + apiProvCert: apiProvCert + apiProvPubKey: apiProvPubKey + apiProvFuncRole: AEF + - apiProvFuncId: apiProvFuncId + apiProvFuncInfo: apiProvFuncInfo + regInfo: + apiProvCert: apiProvCert + apiProvPubKey: apiProvPubKey + apiProvFuncRole: AEF + failReason: failReason + uuid: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 + apiProvDomId: apiProvDomId + apiProvDomInfo: apiProvDomInfo + onboarding_date: 2000-01-23T04:56:07.000+00:00 + suppFeat: suppFeat + username: username + properties: + onboarding_date: + description: Provider onboarding date + format: date-time + title: onboarding_date + type: string + username: + description: User who registered the provider + title: username + type: string + uuid: + description: uuid of the user who registered the provider + format: uuid + title: uuid + type: string + apiProvDomId: + description: | + API provider domain ID assigned by the CAPIF core function to the API management function while registering the API provider domain. Shall not be present in the HTTP POST request from the API Management function to the CAPIF core function, to on-board itself. Shall be present in all other HTTP requests and responses. + readOnly: true + title: apiProvDomId + type: string + regSec: + description: | + Security information necessary for the CAPIF core function to validate the registration of the API provider domain. Shall be present in HTTP POST request from API management function to CAPIF core function for API provider domain registration. + title: regSec + type: string + apiProvFuncs: + description: | + A list of individual API provider domain functions details. When included by the API management function in the HTTP request message, it lists the API provider domain functions that the API management function intends to register/update in registration or update registration procedure. When included by the CAPIF core function in the HTTP response message, it lists the API domain functions details that are registered or updated successfully. + items: + $ref: '#/components/schemas/APIProviderFunctionDetails' + minItems: 1 + title: apiProvFuncs + type: array + apiProvDomInfo: + description: | + Generic information related to the API provider domain such as details of the API provider applications. + title: apiProvDomInfo + type: string + suppFeat: + description: | + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of "0" to "9", "a" to "f" or "A" to "F" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. + pattern: "^[A-Fa-f0-9]*$" + title: SupportedFeatures + type: string + failReason: + description: | + Registration or update specific failure information of failed API provider domain function registrations.Shall be present in the HTTP response body if atleast one of the API provider domain function registration or update registration fails. + title: failReason + type: string + required: + - regSec + title: APIProviderEnrolmentDetails + type: object + ServiceSecurity: + description: | + Represents the details of the security method for each service API interface. When included by the API invoker, it indicates the preferred method of security. When included by the CAPIF core function, it indicates the security method to be used for the service API interface. + example: + notificationDestination: notificationDestination + api_invoker_id: api_invoker_id + supportedFeatures: supportedFeatures + securityInfo: + - selSecurityMethod: null + authenticationInfo: authenticationInfo + authorizationInfo: authorizationInfo + interfaceDetails: + ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + prefSecurityMethods: + - PSK + - PSK + aefId: aefId + apiId: apiId + - selSecurityMethod: null + authenticationInfo: authenticationInfo + authorizationInfo: authorizationInfo + interfaceDetails: + ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + prefSecurityMethods: + - PSK + - PSK + aefId: aefId + apiId: apiId + websockNotifConfig: + requestWebsocketUri: true + websocketUri: websocketUri + requestTestNotification: true + properties: + api_invoker_id: + description: Id of the invoker of this security context. + title: api_invoker_id + type: string + securityInfo: + items: + $ref: '#/components/schemas/SecurityInformation' + minimum: 1 + title: securityInfo + type: array + notificationDestination: + description: string providing an URI formatted according to IETF RFC 3986. + title: Uri + type: string + requestTestNotification: + description: | + Set to true by API invoker to request the CAPIF core function to send a test notification as defined in in clause 7.6. Set to false or omitted otherwise. + title: requestTestNotification + type: boolean + websockNotifConfig: + $ref: '#/components/schemas/WebsockNotifConfig' + supportedFeatures: + description: | + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of "0" to "9", "a" to "f" or "A" to "F" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. + pattern: "^[A-Fa-f0-9]*$" + title: SupportedFeatures + type: string + required: + - notificationDestination + - securityInfo + title: ServiceSecurity + type: object + SecurityInformation: + description: Represents the interface details and the security method. + example: + selSecurityMethod: null + authenticationInfo: authenticationInfo + authorizationInfo: authorizationInfo + interfaceDetails: + ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + prefSecurityMethods: + - PSK + - PSK + aefId: aefId + apiId: apiId + nullable: true + oneOf: [] + properties: + interfaceDetails: + $ref: '#/components/schemas/InterfaceDescription' + aefId: + description: Identifier of the API exposing function + title: aefId + type: string + apiId: + description: API identifier + title: apiId + type: string + prefSecurityMethods: + description: Security methods preferred by the API invoker for the API interface. + items: + $ref: '#/components/schemas/SecurityMethod' + minItems: 1 + title: prefSecurityMethods + type: array + selSecurityMethod: + $ref: '#/components/schemas/SecurityMethod' + authenticationInfo: + description: Authentication related information + title: authenticationInfo + type: string + authorizationInfo: + description: Authorization related information + title: authorizationInfo + type: string + required: + - prefSecurityMethods + title: SecurityInformation + type: object + EventSubscription: + description: Represents an individual CAPIF Event Subscription resource. + example: + notificationDestination: notificationDestination + eventFilters: + - aefIds: + - aefIds + - aefIds + apiInvokerIds: + - apiInvokerIds + - apiInvokerIds + apiIds: + - apiIds + - apiIds + - aefIds: + - aefIds + - aefIds + apiInvokerIds: + - apiInvokerIds + - apiInvokerIds + apiIds: + - apiIds + - apiIds + supportedFeatures: supportedFeatures + eventReq: + notifMethod: PERIODIC + partitionCriteria: + - TAC + - TAC + grpRepTime: 5 + notifFlag: ACTIVATE + monDur: 2000-01-23T04:56:07.000+00:00 + immRep: true + maxReportNbr: 0 + repPeriod: 6 + sampRatio: 15 + websockNotifConfig: + requestWebsocketUri: true + websocketUri: websocketUri + events: + - SERVICE_API_AVAILABLE + - SERVICE_API_AVAILABLE + requestTestNotification: true + properties: + events: + description: Subscribed events + items: + $ref: '#/components/schemas/CAPIFEvent' + minItems: 1 + title: events + type: array + eventFilters: + description: Subscribed event filters + items: + $ref: '#/components/schemas/CAPIFEventFilter' + minItems: 1 + title: eventFilters + type: array + eventReq: + $ref: '#/components/schemas/ReportingInformation' + notificationDestination: + description: string providing an URI formatted according to IETF RFC 3986. + title: Uri + type: string + requestTestNotification: + description: | + Set to true by Subscriber to request the CAPIF core function to send a test notification as defined in in clause 7.6. Set to false or omitted otherwise. + title: requestTestNotification + type: boolean + websockNotifConfig: + $ref: '#/components/schemas/WebsockNotifConfig' + supportedFeatures: + description: | + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of "0" to "9", "a" to "f" or "A" to "F" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. + pattern: "^[A-Fa-f0-9]*$" + title: SupportedFeatures + type: string + required: + - events + - notificationDestination + title: EventSubscription + type: object + OnboardingInformation: + description: Represents on-boarding information of the API invoker. + example: + apiInvokerPublicKey: apiInvokerPublicKey + onboardingSecret: onboardingSecret + apiInvokerCertificate: apiInvokerCertificate + properties: + apiInvokerPublicKey: + description: The API Invoker's public key + title: apiInvokerPublicKey + type: string + apiInvokerCertificate: + description: | + The API Invoker's generic client certificate, provided by the CAPIF core function. + title: apiInvokerCertificate + type: string + onboardingSecret: + description: | + The API Invoker's onboarding secret, provided by the CAPIF core function. + title: onboardingSecret + type: string + required: + - apiInvokerPublicKey + title: OnboardingInformation + type: object + APIProviderFunctionDetails: + description: Represents API provider domain function's details. + example: + apiProvFuncId: apiProvFuncId + apiProvFuncInfo: apiProvFuncInfo + regInfo: + apiProvCert: apiProvCert + apiProvPubKey: apiProvPubKey + apiProvFuncRole: AEF + properties: + apiProvFuncId: + description: | + API provider domain functionID assigned by the CAPIF core function to the API provider domain function while registering/updating the API provider domain. Shall not be present in the HTTP POST request from the API management function to the CAPIF core function, to register itself. Shall be present in all other HTTP requests and responses. + title: apiProvFuncId + type: string + regInfo: + $ref: '#/components/schemas/RegistrationInformation' + apiProvFuncRole: + $ref: '#/components/schemas/ApiProviderFuncRole' + apiProvFuncInfo: + description: | + Generic information related to the API provider domain function such as details of the API provider applications. + title: apiProvFuncInfo + type: string + required: + - apiProvFuncRole + - regInfo + title: APIProviderFunctionDetails + type: object + ApiProviderFuncRole: + anyOf: + - enum: + - AEF + - APF + - AMF + type: string + - description: | + This string provides forward-compatiblity with future extensions to the enumeration but is not used to encode content defined in the present version of this API. + type: string + description: | + Possible values are: + - AEF: API provider function is API Exposing Function. + - APF: API provider function is API Publishing Function. + - AMF: API Provider function is API Management Function. + title: ApiProviderFuncRole + RegistrationInformation: + description: | + Represents registration information of an individual API provider domain function. + example: + apiProvCert: apiProvCert + apiProvPubKey: apiProvPubKey + properties: + apiProvPubKey: + description: Public Key of API Provider domain function. + title: apiProvPubKey + type: string + apiProvCert: + description: API provider domain function's client certificate + title: apiProvCert + type: string + required: + - apiProvPubKey + title: RegistrationInformation + type: object + APIList: + description: Represents a list of APIs. + example: + serviceAPIDescriptions: + - serviceAPICategory: serviceAPICategory + ccfId: ccfId + apiName: apiName + shareableInfo: + capifProvDoms: + - capifProvDoms + - capifProvDoms + isShareable: true + supportedFeatures: supportedFeatures + description: description + apiSuppFeats: apiSuppFeats + apiId: apiId + aefProfiles: + - protocol: HTTP_1_1 + securityMethods: + - PSK + - PSK + versions: + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + dataFormat: JSON + domainName: domainName + aefLocation: + dcId: dcId + geoArea: + shape: POINT + point: + lon: 36.988422590534526 + lat: -63.615366350946985 + civicAddr: + POBOX: POBOX + usageRules: usageRules + country: country + PRD: PRD + PLC: PLC + HNO: HNO + PRM: PRM + HNS: HNS + FLR: FLR + A1: A1 + A2: A2 + A3: A3 + A4: A4 + STS: STS + A5: A5 + A6: A6 + RDSEC: RDSEC + providedBy: providedBy + LOC: LOC + UNIT: UNIT + SEAT: SEAT + POD: POD + RDBR: RDBR + method: method + LMK: LMK + POM: POM + ADDCODE: ADDCODE + RD: RD + PC: PC + PCN: PCN + NAM: NAM + BLD: BLD + ROOM: ROOM + RDSUBBR: RDSUBBR + aefId: aefId + interfaceDescriptions: + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + - protocol: HTTP_1_1 + securityMethods: + - PSK + - PSK + versions: + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + dataFormat: JSON + domainName: domainName + aefLocation: + dcId: dcId + geoArea: + shape: POINT + point: + lon: 36.988422590534526 + lat: -63.615366350946985 + civicAddr: + POBOX: POBOX + usageRules: usageRules + country: country + PRD: PRD + PLC: PLC + HNO: HNO + PRM: PRM + HNS: HNS + FLR: FLR + A1: A1 + A2: A2 + A3: A3 + A4: A4 + STS: STS + A5: A5 + A6: A6 + RDSEC: RDSEC + providedBy: providedBy + LOC: LOC + UNIT: UNIT + SEAT: SEAT + POD: POD + RDBR: RDBR + method: method + LMK: LMK + POM: POM + ADDCODE: ADDCODE + RD: RD + PC: PC + PCN: PCN + NAM: NAM + BLD: BLD + ROOM: ROOM + RDSUBBR: RDSUBBR + aefId: aefId + interfaceDescriptions: + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + pubApiPath: + ccfIds: + - ccfIds + - ccfIds + - serviceAPICategory: serviceAPICategory + ccfId: ccfId + apiName: apiName + shareableInfo: + capifProvDoms: + - capifProvDoms + - capifProvDoms + isShareable: true + supportedFeatures: supportedFeatures + description: description + apiSuppFeats: apiSuppFeats + apiId: apiId + aefProfiles: + - protocol: HTTP_1_1 + securityMethods: + - PSK + - PSK + versions: + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + dataFormat: JSON + domainName: domainName + aefLocation: + dcId: dcId + geoArea: + shape: POINT + point: + lon: 36.988422590534526 + lat: -63.615366350946985 + civicAddr: + POBOX: POBOX + usageRules: usageRules + country: country + PRD: PRD + PLC: PLC + HNO: HNO + PRM: PRM + HNS: HNS + FLR: FLR + A1: A1 + A2: A2 + A3: A3 + A4: A4 + STS: STS + A5: A5 + A6: A6 + RDSEC: RDSEC + providedBy: providedBy + LOC: LOC + UNIT: UNIT + SEAT: SEAT + POD: POD + RDBR: RDBR + method: method + LMK: LMK + POM: POM + ADDCODE: ADDCODE + RD: RD + PC: PC + PCN: PCN + NAM: NAM + BLD: BLD + ROOM: ROOM + RDSUBBR: RDSUBBR + aefId: aefId + interfaceDescriptions: + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + - protocol: HTTP_1_1 + securityMethods: + - PSK + - PSK + versions: + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + dataFormat: JSON + domainName: domainName + aefLocation: + dcId: dcId + geoArea: + shape: POINT + point: + lon: 36.988422590534526 + lat: -63.615366350946985 + civicAddr: + POBOX: POBOX + usageRules: usageRules + country: country + PRD: PRD + PLC: PLC + HNO: HNO + PRM: PRM + HNS: HNS + FLR: FLR + A1: A1 + A2: A2 + A3: A3 + A4: A4 + STS: STS + A5: A5 + A6: A6 + RDSEC: RDSEC + providedBy: providedBy + LOC: LOC + UNIT: UNIT + SEAT: SEAT + POD: POD + RDBR: RDBR + method: method + LMK: LMK + POM: POM + ADDCODE: ADDCODE + RD: RD + PC: PC + PCN: PCN + NAM: NAM + BLD: BLD + ROOM: ROOM + RDSUBBR: RDSUBBR + aefId: aefId + interfaceDescriptions: + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + pubApiPath: + ccfIds: + - ccfIds + - ccfIds + properties: + serviceAPIDescriptions: + description: The list of service APIs that the API Invoker is allowed to + invoke. + items: + $ref: '#/components/schemas/ServiceAPIDescription' + minItems: 1 + title: serviceAPIDescriptions + type: array + title: APIList + type: object + Uri: + description: string providing an URI formatted according to IETF RFC 3986. + title: Uri + type: string + WebsockNotifConfig: + description: Represents the configuration information for the delivery of notifications + over Websockets. + example: + requestWebsocketUri: true + websocketUri: websocketUri + properties: + websocketUri: + description: string formatted according to IETF RFC 3986 identifying a referenced + resource. + title: Link + type: string + requestWebsocketUri: + description: Set by the SCS/AS to indicate that the Websocket delivery is + requested. + title: requestWebsocketUri + type: boolean + title: WebsockNotifConfig + type: object + Link: + description: string formatted according to IETF RFC 3986 identifying a referenced + resource. + title: Link + type: string + SupportedFeatures: + description: | + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of "0" to "9", "a" to "f" or "A" to "F" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. + pattern: "^[A-Fa-f0-9]*$" + title: SupportedFeatures + type: string + ServiceAPIDescription: + description: Represents the description of a service API as published by the + APF. + example: + serviceAPICategory: serviceAPICategory + ccfId: ccfId + apiName: apiName + shareableInfo: + capifProvDoms: + - capifProvDoms + - capifProvDoms + isShareable: true + supportedFeatures: supportedFeatures + description: description + apiSuppFeats: apiSuppFeats + apiId: apiId + aefProfiles: + - protocol: HTTP_1_1 + securityMethods: + - PSK + - PSK + versions: + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + dataFormat: JSON + domainName: domainName + aefLocation: + dcId: dcId + geoArea: + shape: POINT + point: + lon: 36.988422590534526 + lat: -63.615366350946985 + civicAddr: + POBOX: POBOX + usageRules: usageRules + country: country + PRD: PRD + PLC: PLC + HNO: HNO + PRM: PRM + HNS: HNS + FLR: FLR + A1: A1 + A2: A2 + A3: A3 + A4: A4 + STS: STS + A5: A5 + A6: A6 + RDSEC: RDSEC + providedBy: providedBy + LOC: LOC + UNIT: UNIT + SEAT: SEAT + POD: POD + RDBR: RDBR + method: method + LMK: LMK + POM: POM + ADDCODE: ADDCODE + RD: RD + PC: PC + PCN: PCN + NAM: NAM + BLD: BLD + ROOM: ROOM + RDSUBBR: RDSUBBR + aefId: aefId + interfaceDescriptions: + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + - protocol: HTTP_1_1 + securityMethods: + - PSK + - PSK + versions: + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + dataFormat: JSON + domainName: domainName + aefLocation: + dcId: dcId + geoArea: + shape: POINT + point: + lon: 36.988422590534526 + lat: -63.615366350946985 + civicAddr: + POBOX: POBOX + usageRules: usageRules + country: country + PRD: PRD + PLC: PLC + HNO: HNO + PRM: PRM + HNS: HNS + FLR: FLR + A1: A1 + A2: A2 + A3: A3 + A4: A4 + STS: STS + A5: A5 + A6: A6 + RDSEC: RDSEC + providedBy: providedBy + LOC: LOC + UNIT: UNIT + SEAT: SEAT + POD: POD + RDBR: RDBR + method: method + LMK: LMK + POM: POM + ADDCODE: ADDCODE + RD: RD + PC: PC + PCN: PCN + NAM: NAM + BLD: BLD + ROOM: ROOM + RDSUBBR: RDSUBBR + aefId: aefId + interfaceDescriptions: + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + pubApiPath: + ccfIds: + - ccfIds + - ccfIds + properties: + apiName: + description: "API name, it is set as {apiName} part of the URI structure\ + \ as defined in clause 5.2.4 of 3GPP TS 29.122." + title: apiName + type: string + apiId: + description: | + API identifier assigned by the CAPIF core function to the published service API. Shall not be present in the HTTP POST request from the API publishing function to the CAPIF core function. Shall be present in the HTTP POST response from the CAPIF core function to the API publishing function and in the HTTP GET response from the CAPIF core function to the API invoker (discovery API). + title: apiId + type: string + aefProfiles: + description: | + AEF profile information, which includes the exposed API details (e.g. protocol). + items: + $ref: '#/components/schemas/AefProfile' + minItems: 1 + title: aefProfiles + type: array + description: + description: Text description of the API + title: description + type: string + supportedFeatures: + description: | + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of "0" to "9", "a" to "f" or "A" to "F" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. + pattern: "^[A-Fa-f0-9]*$" + title: SupportedFeatures + type: string + shareableInfo: + $ref: '#/components/schemas/ShareableInformation' + serviceAPICategory: + title: serviceAPICategory + type: string + apiSuppFeats: + description: | + A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of "0" to "9", "a" to "f" or "A" to "F" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. + pattern: "^[A-Fa-f0-9]*$" + title: SupportedFeatures + type: string + pubApiPath: + $ref: '#/components/schemas/PublishedApiPath' + ccfId: + description: CAPIF core function identifier. + title: ccfId + type: string + required: + - apiName + title: ServiceAPIDescription + type: object + AefProfile: + description: Represents the AEF profile data. + example: + protocol: HTTP_1_1 + securityMethods: + - PSK + - PSK + versions: + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + dataFormat: JSON + domainName: domainName + aefLocation: + dcId: dcId + geoArea: + shape: POINT + point: + lon: 36.988422590534526 + lat: -63.615366350946985 + civicAddr: + POBOX: POBOX + usageRules: usageRules + country: country + PRD: PRD + PLC: PLC + HNO: HNO + PRM: PRM + HNS: HNS + FLR: FLR + A1: A1 + A2: A2 + A3: A3 + A4: A4 + STS: STS + A5: A5 + A6: A6 + RDSEC: RDSEC + providedBy: providedBy + LOC: LOC + UNIT: UNIT + SEAT: SEAT + POD: POD + RDBR: RDBR + method: method + LMK: LMK + POM: POM + ADDCODE: ADDCODE + RD: RD + PC: PC + PCN: PCN + NAM: NAM + BLD: BLD + ROOM: ROOM + RDSUBBR: RDSUBBR + aefId: aefId + interfaceDescriptions: + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + - ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + nullable: true + oneOf: [] + properties: + aefId: + description: Identifier of the API exposing function + title: aefId + type: string + versions: + description: API version + items: + $ref: '#/components/schemas/Version' + minItems: 1 + title: versions + type: array + protocol: + $ref: '#/components/schemas/Protocol' + dataFormat: + $ref: '#/components/schemas/DataFormat' + securityMethods: + description: Security methods supported by the AEF + items: + $ref: '#/components/schemas/SecurityMethod' + minItems: 1 + title: securityMethods + type: array + domainName: + description: Domain to which API belongs to + title: domainName + type: string + interfaceDescriptions: + description: Interface details + items: + $ref: '#/components/schemas/InterfaceDescription' + minItems: 1 + title: interfaceDescriptions + type: array + aefLocation: + $ref: '#/components/schemas/AefLocation' + required: + - aefId + - versions + title: AefProfile + type: object + ShareableInformation: + description: | + Indicates whether the service API and/or the service API category can be shared to the list of CAPIF provider domains. + example: + capifProvDoms: + - capifProvDoms + - capifProvDoms + isShareable: true + properties: + isShareable: + description: | + Set to "true" indicates that the service API and/or the service API category can be shared to the list of CAPIF provider domain information. Otherwise set to "false". + title: isShareable + type: boolean + capifProvDoms: + description: | + List of CAPIF provider domains to which the service API information to be shared. + items: + type: string + minItems: 1 + title: capifProvDoms + type: array + required: + - isShareable + title: ShareableInformation + type: object + PublishedApiPath: + description: Represents the published API path within the same CAPIF provider + domain. + example: + ccfIds: + - ccfIds + - ccfIds + properties: + ccfIds: + description: A list of CCF identifiers where the service API is already + published. + items: + type: string + minItems: 1 + title: ccfIds + type: array + title: PublishedApiPath + type: object + Version: + description: Represents the API version information. + example: + apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + properties: + apiVersion: + description: API major version in URI (e.g. v1) + title: apiVersion + type: string + expiry: + description: string with format "date-time" as defined in OpenAPI. + format: date-time + title: DateTime + type: string + resources: + description: Resources supported by the API. + items: + $ref: '#/components/schemas/Resource' + minItems: 1 + title: resources + type: array + custOperations: + description: Custom operations without resource association. + items: + $ref: '#/components/schemas/CustomOperation' + minItems: 1 + title: custOperations + type: array + required: + - apiVersion + title: Version + type: object + Protocol: + anyOf: + - enum: + - HTTP_1_1 + - HTTP_2 + type: string + - description: | + This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. + type: string + description: | + Possible values are: + - HTTP_1_1: HTTP version 1.1 + - HTTP_2: HTTP version 2 + title: Protocol + DataFormat: + anyOf: + - enum: + - JSON + type: string + - description: | + This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. + type: string + description: | + Possible values are: + - JSON: JavaScript Object Notation + title: DataFormat + SecurityMethod: + anyOf: + - enum: + - PSK + - PKI + - OAUTH + type: string + - description: | + This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. + type: string + description: | + Possible values are: + - PSK: Security method 1 (Using TLS-PSK) as described in 3GPP TS 33.122 + - PKI: Security method 2 (Using PKI) as described in 3GPP TS 33.122 + - OAUTH: Security method 3 (TLS with OAuth token) as described in 3GPP TS 33.122 + title: SecurityMethod + Resource: + description: Represents the API resource data. + example: + operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + properties: + resourceName: + description: Resource name + title: resourceName + type: string + commType: + $ref: '#/components/schemas/CommunicationType' + uri: + description: | + Relative URI of the API resource, it is set as {apiSpecificSuffixes} part of the URI structure as defined in clause 5.2.4 of 3GPP TS 29.122. + title: uri + type: string + custOpName: + description: | + it is set as {custOpName} part of the URI structure for a custom operation associated with a resource as defined in clause 5.2.4 of 3GPP TS 29.122. + title: custOpName + type: string + operations: + description: | + Supported HTTP methods for the API resource. Only applicable when the protocol in AefProfile indicates HTTP. + items: + $ref: '#/components/schemas/Operation' + minItems: 1 + title: operations + type: array + description: + description: Text description of the API resource + title: description + type: string + required: + - commType + - resourceName + - uri + title: Resource + type: object + CustomOperation: + description: Represents the description of a custom operation. + example: + operations: + - null + - null + commType: null + description: description + custOpName: custOpName + properties: + commType: + $ref: '#/components/schemas/CommunicationType' + custOpName: + description: | + it is set as {custOpName} part of the URI structure for a custom operation without resource association as defined in clause 5.2.4 of 3GPP TS 29.122. + title: custOpName + type: string + operations: + description: | + Supported HTTP methods for the API resource. Only applicable when the protocol in AefProfile indicates HTTP. + items: + $ref: '#/components/schemas/Operation' + minItems: 1 + title: operations + type: array + description: + description: Text description of the custom operation + title: description + type: string + required: + - commType + - custOpName + title: CustomOperation + type: object + CommunicationType: + anyOf: + - enum: + - REQUEST_RESPONSE + - SUBSCRIBE_NOTIFY + type: string + - description: | + This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. + type: string + description: | + Possible values are: + - REQUEST_RESPONSE: The communication is of the type request-response + - SUBSCRIBE_NOTIFY: The communication is of the type subscribe-notify + title: CommunicationType + Operation: + anyOf: + - enum: + - GET + - POST + - PUT + - PATCH + - DELETE + type: string + - description: | + This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. + type: string + description: | + Possible values are: + - GET: HTTP GET method + - POST: HTTP POST method + - PUT: HTTP PUT method + - PATCH: HTTP PATCH method + - DELETE: HTTP DELETE method + title: Operation + InterfaceDescription: + description: Represents the description of an API's interface. + example: + ipv6Addr: ipv6Addr + securityMethods: + - null + - null + port: 5248 + ipv4Addr: ipv4Addr + nullable: true + oneOf: [] + properties: + ipv4Addr: + description: string identifying a Ipv4 address formatted in the "dotted + decimal" notation as defined in IETF RFC 1166. + title: Ipv4Addr + type: string + ipv6Addr: + description: string identifying a Ipv6 address formatted according to clause + 4 in IETF RFC 5952. The mixed Ipv4 Ipv6 notation according to clause 5 + of IETF RFC 5952 shall not be used. + title: Ipv6Addr + type: string + port: + description: Unsigned integer with valid values between 0 and 65535. + maximum: 65535 + minimum: 0 + title: Port + type: integer + securityMethods: + description: | + Security methods supported by the interface, it take precedence over the security methods provided in AefProfile, for this specific interface. + items: + $ref: '#/components/schemas/SecurityMethod' + minItems: 1 + title: securityMethods + type: array + title: InterfaceDescription + type: object + Ipv4Addr: + description: string identifying a Ipv4 address formatted in the "dotted decimal" + notation as defined in IETF RFC 1166. + title: Ipv4Addr + type: string + Ipv6Addr: + description: string identifying a Ipv6 address formatted according to clause + 4 in IETF RFC 5952. The mixed Ipv4 Ipv6 notation according to clause 5 of + IETF RFC 5952 shall not be used. + title: Ipv6Addr + type: string + Port: + description: Unsigned integer with valid values between 0 and 65535. + maximum: 65535 + minimum: 0 + title: Port + type: integer + AefLocation: + description: | + The location information (e.g. civic address, GPS coordinates, data center ID) where the AEF providing the service API is located. + example: + dcId: dcId + geoArea: + shape: POINT + point: + lon: 36.988422590534526 + lat: -63.615366350946985 + civicAddr: + POBOX: POBOX + usageRules: usageRules + country: country + PRD: PRD + PLC: PLC + HNO: HNO + PRM: PRM + HNS: HNS + FLR: FLR + A1: A1 + A2: A2 + A3: A3 + A4: A4 + STS: STS + A5: A5 + A6: A6 + RDSEC: RDSEC + providedBy: providedBy + LOC: LOC + UNIT: UNIT + SEAT: SEAT + POD: POD + RDBR: RDBR + method: method + LMK: LMK + POM: POM + ADDCODE: ADDCODE + RD: RD + PC: PC + PCN: PCN + NAM: NAM + BLD: BLD + ROOM: ROOM + RDSUBBR: RDSUBBR + properties: + civicAddr: + $ref: '#/components/schemas/CivicAddress' + geoArea: + $ref: '#/components/schemas/GeographicArea' + dcId: + description: | + Identifies the data center where the AEF providing the service API is located. + title: dcId + type: string + title: AefLocation + type: object + DateTime: + description: string with format "date-time" as defined in OpenAPI. + format: date-time + title: DateTime + type: string + CivicAddress: + description: Indicates a Civic address. + example: + POBOX: POBOX + usageRules: usageRules + country: country + PRD: PRD + PLC: PLC + HNO: HNO + PRM: PRM + HNS: HNS + FLR: FLR + A1: A1 + A2: A2 + A3: A3 + A4: A4 + STS: STS + A5: A5 + A6: A6 + RDSEC: RDSEC + providedBy: providedBy + LOC: LOC + UNIT: UNIT + SEAT: SEAT + POD: POD + RDBR: RDBR + method: method + LMK: LMK + POM: POM + ADDCODE: ADDCODE + RD: RD + PC: PC + PCN: PCN + NAM: NAM + BLD: BLD + ROOM: ROOM + RDSUBBR: RDSUBBR + properties: + country: + title: country + type: string + A1: + title: A1 + type: string + A2: + title: A2 + type: string + A3: + title: A3 + type: string + A4: + title: A4 + type: string + A5: + title: A5 + type: string + A6: + title: A6 + type: string + PRD: + title: PRD + type: string + POD: + title: POD + type: string + STS: + title: STS + type: string + HNO: + title: HNO + type: string + HNS: + title: HNS + type: string + LMK: + title: LMK + type: string + LOC: + title: LOC + type: string + NAM: + title: NAM + type: string + PC: + title: PC + type: string + BLD: + title: BLD + type: string + UNIT: + title: UNIT + type: string + FLR: + title: FLR + type: string + ROOM: + title: ROOM + type: string + PLC: + title: PLC + type: string + PCN: + title: PCN + type: string + POBOX: + title: POBOX + type: string + ADDCODE: + title: ADDCODE + type: string + SEAT: + title: SEAT + type: string + RD: + title: RD + type: string + RDSEC: + title: RDSEC + type: string + RDBR: + title: RDBR + type: string + RDSUBBR: + title: RDSUBBR + type: string + PRM: + title: PRM + type: string + POM: + title: POM + type: string + usageRules: + title: usageRules + type: string + method: + title: method + type: string + providedBy: + title: providedBy + type: string + title: CivicAddress + type: object + GeographicArea: + anyOf: + - $ref: '#/components/schemas/Point' + - $ref: '#/components/schemas/PointUncertaintyCircle' + - $ref: '#/components/schemas/PointUncertaintyEllipse' + - $ref: '#/components/schemas/Polygon' + - $ref: '#/components/schemas/PointAltitude' + - $ref: '#/components/schemas/PointAltitudeUncertainty' + - $ref: '#/components/schemas/EllipsoidArc' + description: Geographic area specified by different shape. + title: GeographicArea + Point: + allOf: + - $ref: '#/components/schemas/GADShape' + - properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + required: + - point + type: object + description: Ellipsoid Point. + example: + shape: POINT + point: + lon: 36.988422590534526 + lat: -63.615366350946985 + title: Point + GADShape: + description: Common base type for GAD shapes. + discriminator: + mapping: + POINT: '#/components/schemas/Point' + POINT_UNCERTAINTY_CIRCLE: '#/components/schemas/PointUncertaintyCircle' + POINT_UNCERTAINTY_ELLIPSE: '#/components/schemas/PointUncertaintyEllipse' + POLYGON: '#/components/schemas/Polygon' + POINT_ALTITUDE: '#/components/schemas/PointAltitude' + POINT_ALTITUDE_UNCERTAINTY: '#/components/schemas/PointAltitudeUncertainty' + ELLIPSOID_ARC: '#/components/schemas/EllipsoidArc' + LOCAL_2D_POINT_UNCERTAINTY_ELLIPSE: '#/components/schemas/Local2dPointUncertaintyEllipse' + LOCAL_3D_POINT_UNCERTAINTY_ELLIPSOID: '#/components/schemas/Local3dPointUncertaintyEllipsoid' + propertyName: shape + properties: + shape: + $ref: '#/components/schemas/SupportedGADShapes' + required: + - shape + title: GADShape + type: object + GeographicalCoordinates: + description: Geographical coordinates. + example: + lon: 36.988422590534526 + lat: -63.615366350946985 + properties: + lon: + format: double + maximum: 180 + minimum: -180 + title: lon + type: number + lat: + format: double + maximum: 90 + minimum: -90 + title: lat + type: number + required: + - lat + - lon + title: GeographicalCoordinates + type: object + SupportedGADShapes: + anyOf: + - enum: + - POINT + - POINT_UNCERTAINTY_CIRCLE + - POINT_UNCERTAINTY_ELLIPSE + - POLYGON + - POINT_ALTITUDE + - POINT_ALTITUDE_UNCERTAINTY + - ELLIPSOID_ARC + - LOCAL_2D_POINT_UNCERTAINTY_ELLIPSE + - LOCAL_3D_POINT_UNCERTAINTY_ELLIPSOID + type: string + - type: string + description: Indicates supported GAD shapes. + title: SupportedGADShapes + PointUncertaintyCircle: + allOf: + - $ref: '#/components/schemas/GADShape' + - properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + uncertainty: + $ref: '#/components/schemas/Uncertainty' + required: + - point + - uncertainty + type: object + description: Ellipsoid point with uncertainty circle. + title: PointUncertaintyCircle + Uncertainty: + description: Indicates value of uncertainty. + format: float + minimum: 0 + title: Uncertainty + type: number + PointUncertaintyEllipse: + allOf: + - $ref: '#/components/schemas/GADShape' + - properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + uncertaintyEllipse: + $ref: '#/components/schemas/UncertaintyEllipse' + confidence: + $ref: '#/components/schemas/Confidence' + required: + - confidence + - point + - uncertaintyEllipse + type: object + description: Ellipsoid point with uncertainty ellipse. + title: PointUncertaintyEllipse + UncertaintyEllipse: + description: Ellipse with uncertainty. + properties: + semiMajor: + description: Indicates value of uncertainty. + format: float + minimum: 0 + title: Uncertainty + type: number + semiMinor: + description: Indicates value of uncertainty. + format: float + minimum: 0 + title: Uncertainty + type: number + orientationMajor: + description: Indicates value of orientation angle. + maximum: 180 + minimum: 0 + title: Orientation + type: integer + required: + - orientationMajor + - semiMajor + - semiMinor + title: UncertaintyEllipse + type: object + Confidence: + description: Indicates value of confidence. + maximum: 100 + minimum: 0 + type: integer + Orientation: + description: Indicates value of orientation angle. + maximum: 180 + minimum: 0 + title: Orientation + type: integer + Polygon: + allOf: + - $ref: '#/components/schemas/GADShape' + - properties: + pointList: + $ref: '#/components/schemas/PointList' + required: + - pointList + type: object + description: Polygon. + title: Polygon + PointList: + description: List of points. + items: + $ref: '#/components/schemas/GeographicalCoordinates' + maxItems: 15 + minItems: 3 + type: array + PointAltitude: + allOf: + - $ref: '#/components/schemas/GADShape' + - properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + altitude: + $ref: '#/components/schemas/Altitude' + required: + - altitude + - point + type: object + description: Ellipsoid point with altitude. + title: PointAltitude + Altitude: + description: Indicates value of altitude. + format: double + maximum: 32767 + minimum: -32767 + type: number + PointAltitudeUncertainty: + allOf: + - $ref: '#/components/schemas/GADShape' + - properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + altitude: + $ref: '#/components/schemas/Altitude' + uncertaintyEllipse: + $ref: '#/components/schemas/UncertaintyEllipse' + uncertaintyAltitude: + $ref: '#/components/schemas/Uncertainty' + confidence: + $ref: '#/components/schemas/Confidence' + required: + - altitude + - confidence + - point + - uncertaintyAltitude + - uncertaintyEllipse + type: object + description: Ellipsoid point with altitude and uncertainty ellipsoid. + title: PointAltitudeUncertainty + EllipsoidArc: + allOf: + - $ref: '#/components/schemas/GADShape' + - properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + innerRadius: + $ref: '#/components/schemas/InnerRadius' + uncertaintyRadius: + $ref: '#/components/schemas/Uncertainty' + offsetAngle: + $ref: '#/components/schemas/Angle' + includedAngle: + $ref: '#/components/schemas/Angle' + confidence: + $ref: '#/components/schemas/Confidence' + required: + - confidence + - includedAngle + - innerRadius + - offsetAngle + - point + - uncertaintyRadius + type: object + description: Ellipsoid Arc. + title: EllipsoidArc + InnerRadius: + description: Indicates value of the inner radius. + format: int32 + maximum: 327675 + minimum: 0 + type: integer + Angle: + description: Indicates value of angle. + maximum: 360 + minimum: 0 + type: integer + CAPIFEvent: + anyOf: + - enum: + - SERVICE_API_AVAILABLE + - SERVICE_API_UNAVAILABLE + - SERVICE_API_UPDATE + - API_INVOKER_ONBOARDED + - API_INVOKER_OFFBOARDED + - SERVICE_API_INVOCATION_SUCCESS + - SERVICE_API_INVOCATION_FAILURE + - ACCESS_CONTROL_POLICY_UPDATE + - ACCESS_CONTROL_POLICY_UNAVAILABLE + - API_INVOKER_AUTHORIZATION_REVOKED + - API_INVOKER_UPDATED + - API_TOPOLOGY_HIDING_CREATED + - API_TOPOLOGY_HIDING_REVOKED + type: string + - description: | + This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. + type: string + description: | + Possible values are: + - SERVICE_API_AVAILABLE: Events related to the availability of service APIs after the service APIs are published. + - SERVICE_API_UNAVAILABLE: Events related to the unavailability of service APIs after the service APIs are unpublished. + - SERVICE_API_UPDATE: Events related to change in service API information. + - API_INVOKER_ONBOARDED: Events related to API invoker onboarded to CAPIF. + - API_INVOKER_OFFBOARDED: Events related to API invoker offboarded from CAPIF. + - SERVICE_API_INVOCATION_SUCCESS: Events related to the successful invocation of service APIs. + - SERVICE_API_INVOCATION_FAILURE: Events related to the failed invocation of service APIs. + - ACCESS_CONTROL_POLICY_UPDATE: Events related to the update for the access control policy related to the service APIs. + - ACCESS_CONTROL_POLICY_UNAVAILABLE: Events related to the unavailability of the access control policy related to the service APIs. + - API_INVOKER_AUTHORIZATION_REVOKED: Events related to the revocation of the authorization of API invokers to access the service APIs. + - API_INVOKER_UPDATED: Events related to API invoker profile updated to CAPIF. + - API_TOPOLOGY_HIDING_CREATED: Events related to the creation or update of the API topology hiding information of the service APIs after the service APIs are published. + - API_TOPOLOGY_HIDING_REVOKED: Events related to the revocation of the API topology hiding information of the service APIs after the service APIs are unpublished. + title: CAPIFEvent + CAPIFEventFilter: + description: Represents a CAPIF event filter. + example: + aefIds: + - aefIds + - aefIds + apiInvokerIds: + - apiInvokerIds + - apiInvokerIds + apiIds: + - apiIds + - apiIds + properties: + apiIds: + description: Identifier of the service API + items: + type: string + minItems: 1 + title: apiIds + type: array + apiInvokerIds: + description: Identity of the API invoker + items: + type: string + minItems: 1 + title: apiInvokerIds + type: array + aefIds: + description: Identifier of the API exposing function + items: + type: string + minItems: 1 + title: aefIds + type: array + title: CAPIFEventFilter + type: object + ReportingInformation: + description: Represents the type of reporting that the subscription requires. + example: + notifMethod: PERIODIC + partitionCriteria: + - TAC + - TAC + grpRepTime: 5 + notifFlag: ACTIVATE + monDur: 2000-01-23T04:56:07.000+00:00 + immRep: true + maxReportNbr: 0 + repPeriod: 6 + sampRatio: 15 + properties: + immRep: + title: immRep + type: boolean + notifMethod: + $ref: '#/components/schemas/NotificationMethod' + maxReportNbr: + description: "Unsigned Integer, i.e. only value 0 and integers above 0 are\ + \ permissible." + minimum: 0 + title: Uinteger + type: integer + monDur: + description: string with format "date-time" as defined in OpenAPI. + format: date-time + title: DateTime + type: string + repPeriod: + description: indicating a time in seconds. + title: DurationSec + type: integer + sampRatio: + description: "Unsigned integer indicating Sampling Ratio (see clauses 4.15.1\ + \ of 3GPP TS 23.502), expressed in percent. \n" + maximum: 100 + minimum: 1 + title: SamplingRatio + type: integer + partitionCriteria: + description: Criteria for partitioning the UEs before applying the sampling + ratio. + items: + $ref: '#/components/schemas/PartitioningCriteria' + minItems: 1 + title: partitionCriteria + type: array + grpRepTime: + description: indicating a time in seconds. + title: DurationSec + type: integer + notifFlag: + $ref: '#/components/schemas/NotificationFlag' + title: ReportingInformation + type: object + NotificationMethod: + anyOf: + - enum: + - PERIODIC + - ONE_TIME + - ON_EVENT_DETECTION + type: string + - description: | + This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. + type: string + description: | + Possible values are: + - PERIODIC + - ONE_TIME + - ON_EVENT_DETECTION + title: NotificationMethod + Uinteger: + description: "Unsigned Integer, i.e. only value 0 and integers above 0 are permissible." + minimum: 0 + title: Uinteger + type: integer + DurationSec: + description: indicating a time in seconds. + title: DurationSec + type: integer + SamplingRatio: + description: "Unsigned integer indicating Sampling Ratio (see clauses 4.15.1\ + \ of 3GPP TS 23.502), expressed in percent. \n" + maximum: 100 + minimum: 1 + title: SamplingRatio + type: integer + PartitioningCriteria: + anyOf: + - enum: + - TAC + - SUBPLMN + - GEOAREA + - SNSSAI + - DNN + type: string + - description: | + This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. + type: string + description: | + Possible values are: + - "TAC": Type Allocation Code + - "SUBPLMN": Subscriber PLMN ID + - "GEOAREA": Geographical area, i.e. list(s) of TAI(s) + - "SNSSAI": S-NSSAI + - "DNN": DNN + title: PartitioningCriteria + NotificationFlag: + anyOf: + - enum: + - ACTIVATE + - DEACTIVATE + - RETRIEVAL + type: string + - description: "This string provides forward-compatibility with future extensions\ + \ to the enumeration but is not used to encode content defined in the present\ + \ version of this API. \n" + type: string + description: |- + Possible values are: + - ACTIVATE: The event notification is activated. + - DEACTIVATE: The event notification is deactivated and shall be muted. The available + event(s) shall be stored. + - RETRIEVAL: The event notification shall be sent to the NF service consumer(s), + after that, is muted again. + title: NotificationFlag diff --git a/services/helper/helper_service/services/api/typing_utils.py b/services/helper/helper_service/services/api/typing_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..74e3c913a7db6246bc765f147ca872996112c6bb --- /dev/null +++ b/services/helper/helper_service/services/api/typing_utils.py @@ -0,0 +1,30 @@ +import sys + +if sys.version_info < (3, 7): + import typing + + def is_generic(klass): + """ Determine whether klass is a generic class """ + return type(klass) == typing.GenericMeta + + def is_dict(klass): + """ Determine whether klass is a Dict """ + return klass.__extra__ == dict + + def is_list(klass): + """ Determine whether klass is a List """ + return klass.__extra__ == list + +else: + + def is_generic(klass): + """ Determine whether klass is a generic class """ + return hasattr(klass, '__origin__') + + def is_dict(klass): + """ Determine whether klass is a Dict """ + return klass.__origin__ == dict + + def is_list(klass): + """ Determine whether klass is a List """ + return klass.__origin__ == list diff --git a/services/helper/helper_service/services/api/util.py b/services/helper/helper_service/services/api/util.py new file mode 100644 index 0000000000000000000000000000000000000000..ec39619020812995ded07409fdfdcb38b3d1186b --- /dev/null +++ b/services/helper/helper_service/services/api/util.py @@ -0,0 +1,146 @@ +import datetime + +from api import typing_utils + + +def _deserialize(data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if klass in (int, float, str, bool, bytearray): + return _deserialize_primitive(data, klass) + elif klass == object: + return _deserialize_object(data) + elif klass == datetime.date: + return deserialize_date(data) + elif klass == datetime.datetime: + return deserialize_datetime(data) + elif typing_utils.is_generic(klass): + if typing_utils.is_list(klass): + return _deserialize_list(data, klass.__args__[0]) + if typing_utils.is_dict(klass): + return _deserialize_dict(data, klass.__args__[1]) + else: + return deserialize_model(data, klass) + + +def _deserialize_primitive(data, klass): + """Deserializes to primitive type. + + :param data: data to deserialize. + :param klass: class literal. + + :return: int, long, float, str, bool. + :rtype: int | long | float | str | bool + """ + try: + value = klass(data) + except UnicodeEncodeError: + value = data + except TypeError: + value = data + return value + + +def _deserialize_object(value): + """Return an original value. + + :return: object. + """ + return value + + +def deserialize_date(string): + """Deserializes string to date. + + :param string: str. + :type string: str + :return: date. + :rtype: date + """ + if string is None: + return None + + try: + from dateutil.parser import parse + return parse(string).date() + except ImportError: + return string + + +def deserialize_datetime(string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :type string: str + :return: datetime. + :rtype: datetime + """ + if string is None: + return None + + try: + from dateutil.parser import parse + return parse(string) + except ImportError: + return string + + +def deserialize_model(data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :type data: dict | list + :param klass: class literal. + :return: model object. + """ + instance = klass() + + if not instance.openapi_types: + return data + + for attr, attr_type in instance.openapi_types.items(): + if data is not None \ + and instance.attribute_map[attr] in data \ + and isinstance(data, (list, dict)): + value = data[instance.attribute_map[attr]] + setattr(instance, attr, _deserialize(value, attr_type)) + + return instance + + +def _deserialize_list(data, boxed_type): + """Deserializes a list and its elements. + + :param data: list to deserialize. + :type data: list + :param boxed_type: class literal. + + :return: deserialized list. + :rtype: list + """ + return [_deserialize(sub_data, boxed_type) + for sub_data in data] + + +def _deserialize_dict(data, boxed_type): + """Deserializes a dict and its elements. + + :param data: dict to deserialize. + :type data: dict + :param boxed_type: class literal. + + :return: deserialized dict. + :rtype: dict + """ + return {k: _deserialize(v, boxed_type) + for k, v in data.items() } diff --git a/services/helper/helper_service/services/configuration/__init__.py b/services/helper/helper_service/services/configuration/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/services/helper/helper_service/services/configuration/__main__.py b/services/helper/helper_service/services/configuration/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..90c35785b0b67383d29f54a3fae52b4ff022f530 --- /dev/null +++ b/services/helper/helper_service/services/configuration/__main__.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 + +import connexion +from configuration import encoder + + +def main(): + app = connexion.App(__name__, specification_dir='./openapi/') + app.app.json_encoder = encoder.JSONEncoder + app.add_api('openapi.yaml', + arguments={'title': 'Helper Configuration API'}, + pythonic_params=True) + + app.run(port=8080) + + +if __name__ == '__main__': + main() diff --git a/services/helper/helper_service/services/configuration/controllers/__init__.py b/services/helper/helper_service/services/configuration/controllers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/services/helper/helper_service/services/configuration/controllers/default_controller.py b/services/helper/helper_service/services/configuration/controllers/default_controller.py new file mode 100644 index 0000000000000000000000000000000000000000..3621c5845046b23c12c9ecf06b982625ca55d46c --- /dev/null +++ b/services/helper/helper_service/services/configuration/controllers/default_controller.py @@ -0,0 +1,122 @@ + +import connexion +from configuration.models.capif_configuration import \ + CapifConfiguration # noqa: E501 +from configuration.models.config_category_create_request import \ + ConfigCategoryCreateRequest # noqa: E501 +from configuration.models.config_param_update_request import \ + ConfigParamUpdateRequest # noqa: E501 +from configuration.models.generic_error import GenericError # noqa: E501 + +from ..core.configuration_operations import ConfigurationOperations + +config_operations = ConfigurationOperations() + +def configuration_controller_get_configuration(): # noqa: E501 + """Read full configuration + + Returns the entire CAPIF configuration document. # noqa: E501 + + + :rtype: Union[CapifConfiguration, Tuple[CapifConfiguration, int], Tuple[CapifConfiguration, int, Dict[str, str]] + """ + return config_operations.get_configuration() + + +def dynamic_config_controller_add_new_config_setting(body): # noqa: E501 + """Add new config setting at path + + Adds a new key/value inside an existing category using \"param_path\" and \"new_value\". # noqa: E501 + + :param config_param_update_request: + :type config_param_update_request: dict | bytes + + :rtype: Union[CapifConfiguration, Tuple[CapifConfiguration, int], Tuple[CapifConfiguration, int, Dict[str, str]] + """ + config_param_update_request = body + if connexion.request.is_json: + config_param_update_request = ConfigParamUpdateRequest.from_dict(connexion.request.get_json()) # noqa: E501 + return config_operations.add_new_config_setting( + config_param_update_request.param_path, + config_param_update_request.new_value + ) + + +def dynamic_config_controller_add_new_configuration(body): # noqa: E501 + """Add new configuration category + + Adds a brand new top-level category. # noqa: E501 + + :param config_category_create_request: + :type config_category_create_request: dict | bytes + + :rtype: Union[CapifConfiguration, Tuple[CapifConfiguration, int], Tuple[CapifConfiguration, int, Dict[str, str]] + """ + config_category_create_request = body + if connexion.request.is_json: + config_category_create_request = ConfigCategoryCreateRequest.from_dict(connexion.request.get_json()) # noqa: E501 + return config_operations.add_new_configuration( + config_category_create_request.category_name, + config_category_create_request.category_values + ) + + +def dynamic_config_controller_remove_config_category(config_path): # noqa: E501 + """Remove configuration category + + Deletes an entire top-level category by name. # noqa: E501 + + :param config_path: Configuration path to remove + :type config_path: str + + :rtype: Union[CapifConfiguration, Tuple[CapifConfiguration, int], Tuple[CapifConfiguration, int, Dict[str, str]] + """ + return config_operations.remove_config_category(config_path) + + +def dynamic_config_controller_remove_config_param(param_path): # noqa: E501 + """Remove config parameter + + Deletes a leaf parameter by dotted path. # noqa: E501 + + :param param_path: Parameter path to remove + :type param_path: str + + :rtype: Union[CapifConfiguration, Tuple[CapifConfiguration, int], Tuple[CapifConfiguration, int, Dict[str, str]] + """ + return config_operations.remove_config_param(param_path) + + +def dynamic_config_controller_replace_configuration(body): # noqa: E501 + """Replace entire configuration + + Replaces the configuration document with a new one. # noqa: E501 + + :param capif_configuration: + :type capif_configuration: dict | bytes + + :rtype: Union[CapifConfiguration, Tuple[CapifConfiguration, int], Tuple[CapifConfiguration, int, Dict[str, str]] + """ + capif_configuration = body + if connexion.request.is_json: + capif_configuration = CapifConfiguration.from_dict(connexion.request.get_json()) # noqa: E501 + return config_operations.replace_configuration(capif_configuration.to_dict()) + + +def dynamic_config_controller_update_config_param(body): # noqa: E501 + """Update single config parameter + + Updates a single setting inside the configuration using a dotted path selector. # noqa: E501 + + :param config_param_update_request: + :type config_param_update_request: dict | bytes + + :rtype: Union[CapifConfiguration, Tuple[CapifConfiguration, int], Tuple[CapifConfiguration, int, Dict[str, str]] + """ + config_param_update_request = body + if connexion.request.is_json: + config_param_update_request = ConfigParamUpdateRequest.from_dict(connexion.request.get_json()) # noqa: E501 + return config_operations.update_config_param( + config_param_update_request.param_path, + config_param_update_request.new_value + ) diff --git a/services/helper/helper_service/services/configuration/controllers/security_controller.py b/services/helper/helper_service/services/configuration/controllers/security_controller.py new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/services/helper/helper_service/services/configuration/controllers/security_controller.py @@ -0,0 +1 @@ + diff --git a/services/helper/helper_service/services/configuration/core/configuration_operations.py b/services/helper/helper_service/services/configuration/core/configuration_operations.py new file mode 100644 index 0000000000000000000000000000000000000000..da415e45234887b59d0a9efff180378eb979bdfa --- /dev/null +++ b/services/helper/helper_service/services/configuration/core/configuration_operations.py @@ -0,0 +1,175 @@ + +from config import Config +from db.db import get_mongo +from flask import current_app, jsonify +from utils.utils import (convert_dict_keys_to_snake_case, + convert_nested_values, convert_value_to_original_type, + get_nested_value, to_snake_case, + validate_snake_case_keys) + + +class ConfigurationOperations: + + PROTECTED_FIELDS = ["ccf_id"] + + def __init__(self): + self.db = get_mongo() + self.mimetype = 'application/json' + self.config = Config().get_config() + + def get_configuration(self): + """Get all current settings.""" + current_app.logger.debug("Retrieving current CAPIF configuration") + config_col = self.db.get_col_by_name(self.db.capif_configuration) + config = config_col.find_one({}, {"_id": 0}) + + if not config: + return jsonify(message="No CAPIF configuration found"), 404 + + return jsonify(config), 200 + + def update_config_param(self, param_path, new_value): + """ + Updates a single parameter in the configuration. + param_path: Path of the parameter (e.g., settings.acl_policy_settings.allowed_total_invocations) + """ + current_app.logger.debug(f"Updating configuration parameter: {param_path} with value: {new_value}") + + # Protect immutable fields + if any(param_path.startswith(field) for field in self.PROTECTED_FIELDS): + return jsonify(message=f"The parameter '{param_path}' is immutable and cannot be modified"), 403 + + config_col = self.db.get_col_by_name(self.db.capif_configuration) + + existing_config = config_col.find_one({}, {"_id": 0}) + current_value = get_nested_value(existing_config, param_path) + + if current_value is None: + return jsonify(message=f"The parameter '{param_path}' does not exist in the configuration"), 404 + + converted_value = convert_value_to_original_type(new_value, current_value) + + if isinstance(converted_value, tuple): + return converted_value + + update_query = {"$set": {param_path: converted_value}} + result = config_col.update_one({}, update_query) + + if result.modified_count == 0: + return jsonify(message=f"No configuration found or parameter '{param_path}' not updated"), 404 + + return jsonify(message=f"Parameter '{param_path}' updated successfully"), 200 + + + def replace_configuration(self, new_config): + current_app.logger.debug("Replacing entire CAPIF configuration") + + error_response = validate_snake_case_keys(new_config) + if error_response: + return error_response + + config_col = self.db.get_col_by_name(self.db.capif_configuration) + existing_config = config_col.find_one({}, {"_id": 0}) + + if not existing_config: + return jsonify(message="No existing configuration found"), 404 + + # Preserve protected fields + for field in self.PROTECTED_FIELDS: + if field in existing_config: + new_config[field] = existing_config[field] + + new_config = convert_nested_values(new_config, existing_config) + result = config_col.replace_one({}, new_config, upsert=True) + + return jsonify(message="Configuration replaced successfully (protected fields preserved)"), 200 + + + def add_new_configuration(self, category_name, category_values): + """ + Add a new category of parameters in 'settings'. + """ + current_app.logger.debug(f"Adding new category: {category_name} with values: {category_values}") + + # Block protected field creation + if category_name in self.PROTECTED_FIELDS: + return jsonify(message=f"The category '{category_name}' is immutable and cannot be modified"), 403 + + config_col = self.db.get_col_by_name(self.db.capif_configuration) + + category_name_snake = to_snake_case(category_name) + category_values_snake = convert_dict_keys_to_snake_case(category_values) + + update_query = {"$set": {f"settings.{category_name_snake}": category_values_snake}} + + result = config_col.update_one({}, update_query) + + if result.modified_count == 0: + return jsonify(message=f"No configuration found or category '{category_name_snake}' not added"), 404 + + return jsonify(message=f"Category '{category_name_snake}' added successfully"), 200 + + + def add_new_config_setting(self, param_path, new_value): + """Add a new parameter in 'settings'.""" + current_app.logger.debug(f"Adding new configuration setting: {param_path} with value: {new_value}") + + # Block protected field creation + if any(param_path.startswith(field) for field in self.PROTECTED_FIELDS): + return jsonify(message=f"The parameter '{param_path}' is immutable and cannot be added or modified"), 403 + + config_col = self.db.get_col_by_name(self.db.capif_configuration) + + param_path_snake = ".".join(to_snake_case(part) for part in param_path.split(".")) + + update_query = {"$set": {f"settings.{param_path_snake}": new_value}} + result = config_col.update_one({}, update_query) + + if result.modified_count == 0: + return jsonify(message=f"No configuration found or parameter '{param_path_snake}' not updated"), 404 + + return jsonify(message=f"Parameter '{param_path_snake}' added successfully"), 200 + + + def remove_config_param(self, param_path): + """Removes a specific parameter inside 'settings'.""" + current_app.logger.debug(f"Removing configuration parameter: {param_path}") + + # Prevent deletion of protected fields + if any(param_path.startswith(field) for field in self.PROTECTED_FIELDS): + return jsonify(message=f"The parameter '{param_path}' is immutable and cannot be removed"), 403 + + config_col = self.db.get_col_by_name(self.db.capif_configuration) + + param_path_snake = ".".join(to_snake_case(part) for part in param_path.split(".")) + + update_query = {"$unset": {f"settings.{param_path_snake}": ""}} + + result = config_col.update_one({}, update_query) + + if result.modified_count == 0: + return jsonify(message=f"No configuration found or parameter '{param_path_snake}' not removed"), 404 + + return jsonify(message=f"Parameter '{param_path_snake}' removed successfully"), 200 + + + def remove_config_category(self, category_name): + """Removes an entire category inside 'settings'.""" + current_app.logger.debug(f"Removing configuration category: {category_name}") + + # Prevent deletion of protected fields + if category_name in self.PROTECTED_FIELDS: + return jsonify(message=f"The category '{category_name}' is immutable and cannot be removed"), 403 + + config_col = self.db.get_col_by_name(self.db.capif_configuration) + + category_name_snake = to_snake_case(category_name) + + update_query = {"$unset": {f"settings.{category_name_snake}": ""}} + + result = config_col.update_one({}, update_query) + + if result.modified_count == 0: + return jsonify(message=f"No configuration found or category '{category_name_snake}' not removed"), 404 + + return jsonify(message=f"Category '{category_name_snake}' removed successfully"), 200 \ No newline at end of file diff --git a/services/helper/helper_service/services/configuration/encoder.py b/services/helper/helper_service/services/configuration/encoder.py new file mode 100644 index 0000000000000000000000000000000000000000..7b5d6ac2d20d06ca0f0b13ef5a2f8b983150dcb1 --- /dev/null +++ b/services/helper/helper_service/services/configuration/encoder.py @@ -0,0 +1,18 @@ +from configuration.models.base_model import Model +from connexion.apps.flask_app import FlaskJSONEncoder + + +class JSONEncoder(FlaskJSONEncoder): + include_nulls = False + + def default(self, o): + if isinstance(o, Model): + dikt = {} + for attr in o.openapi_types: + value = getattr(o, attr) + if value is None and not self.include_nulls: + continue + attr = o.attribute_map[attr] + dikt[attr] = value + return dikt + return FlaskJSONEncoder.default(self, o) diff --git a/services/helper/helper_service/services/configuration/models/__init__.py b/services/helper/helper_service/services/configuration/models/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d036df693ea41dfaa3debffffad0462c1fcd8e4a --- /dev/null +++ b/services/helper/helper_service/services/configuration/models/__init__.py @@ -0,0 +1,2 @@ +# flake8: noqa +# import models into model package diff --git a/services/helper/helper_service/services/configuration/models/base_model.py b/services/helper/helper_service/services/configuration/models/base_model.py new file mode 100644 index 0000000000000000000000000000000000000000..286ac1e6295da974ce3e543af0153ab9db4fec8e --- /dev/null +++ b/services/helper/helper_service/services/configuration/models/base_model.py @@ -0,0 +1,67 @@ +import pprint +import typing + +from configuration import util + +T = typing.TypeVar('T') + + +class Model: + # openapiTypes: The key is attribute name and the + # value is attribute type. + openapi_types: typing.Dict[str, type] = {} + + # attributeMap: The key is attribute name and the + # value is json key in definition. + attribute_map: typing.Dict[str, str] = {} + + @classmethod + def from_dict(cls: typing.Type[T], dikt) -> T: + """Returns the dict as a model""" + return util.deserialize_model(dikt, cls) + + def to_dict(self): + """Returns the model properties as a dict + + :rtype: dict + """ + result = {} + + for attr in self.openapi_types: + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model + + :rtype: str + """ + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/services/helper/helper_service/services/configuration/models/capif_configuration.py b/services/helper/helper_service/services/configuration/models/capif_configuration.py new file mode 100644 index 0000000000000000000000000000000000000000..f71c2c28859486487fa79117da0550d6fe45975b --- /dev/null +++ b/services/helper/helper_service/services/configuration/models/capif_configuration.py @@ -0,0 +1,117 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from configuration import util +from configuration.models.base_model import Model +from configuration.models.settings import Settings # noqa: E501 + + +class CapifConfiguration(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, config_name=None, version=None, settings=None): # noqa: E501 + """CapifConfiguration - a model defined in OpenAPI + + :param config_name: The config_name of this CapifConfiguration. # noqa: E501 + :type config_name: str + :param version: The version of this CapifConfiguration. # noqa: E501 + :type version: str + :param settings: The settings of this CapifConfiguration. # noqa: E501 + :type settings: List[Settings] + """ + self.openapi_types = { + 'config_name': str, + 'version': str, + 'settings': List[Settings] + } + + self.attribute_map = { + 'config_name': 'config_name', + 'version': 'version', + 'settings': 'settings' + } + + self._config_name = config_name + self._version = version + self._settings = settings + + @classmethod + def from_dict(cls, dikt) -> 'CapifConfiguration': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The CapifConfiguration of this CapifConfiguration. # noqa: E501 + :rtype: CapifConfiguration + """ + return util.deserialize_model(dikt, cls) + + @property + def config_name(self) -> str: + """Gets the config_name of this CapifConfiguration. + + Configuration name # noqa: E501 + + :return: The config_name of this CapifConfiguration. + :rtype: str + """ + return self._config_name + + @config_name.setter + def config_name(self, config_name: str): + """Sets the config_name of this CapifConfiguration. + + Configuration name # noqa: E501 + + :param config_name: The config_name of this CapifConfiguration. + :type config_name: str + """ + + self._config_name = config_name + + @property + def version(self) -> str: + """Gets the version of this CapifConfiguration. + + configuration version # noqa: E501 + + :return: The version of this CapifConfiguration. + :rtype: str + """ + return self._version + + @version.setter + def version(self, version: str): + """Sets the version of this CapifConfiguration. + + configuration version # noqa: E501 + + :param version: The version of this CapifConfiguration. + :type version: str + """ + + self._version = version + + @property + def settings(self) -> List[Settings]: + """Gets the settings of this CapifConfiguration. + + + :return: The settings of this CapifConfiguration. + :rtype: List[Settings] + """ + return self._settings + + @settings.setter + def settings(self, settings: List[Settings]): + """Sets the settings of this CapifConfiguration. + + + :param settings: The settings of this CapifConfiguration. + :type settings: List[Settings] + """ + + self._settings = settings diff --git a/services/helper/helper_service/services/configuration/models/config_category_create_request.py b/services/helper/helper_service/services/configuration/models/config_category_create_request.py new file mode 100644 index 0000000000000000000000000000000000000000..f197c5f6579e97cfba3cf831982cb2e538a93297 --- /dev/null +++ b/services/helper/helper_service/services/configuration/models/config_category_create_request.py @@ -0,0 +1,94 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from configuration import util +from configuration.models.base_model import Model + + +class ConfigCategoryCreateRequest(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, category_name=None, category_values=None): # noqa: E501 + """ConfigCategoryCreateRequest - a model defined in OpenAPI + + :param category_name: The category_name of this ConfigCategoryCreateRequest. # noqa: E501 + :type category_name: str + :param category_values: The category_values of this ConfigCategoryCreateRequest. # noqa: E501 + :type category_values: Dict[str, object] + """ + self.openapi_types = { + 'category_name': str, + 'category_values': Dict[str, object] + } + + self.attribute_map = { + 'category_name': 'category_name', + 'category_values': 'category_values' + } + + self._category_name = category_name + self._category_values = category_values + + @classmethod + def from_dict(cls, dikt) -> 'ConfigCategoryCreateRequest': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The ConfigCategoryCreateRequest of this ConfigCategoryCreateRequest. # noqa: E501 + :rtype: ConfigCategoryCreateRequest + """ + return util.deserialize_model(dikt, cls) + + @property + def category_name(self) -> str: + """Gets the category_name of this ConfigCategoryCreateRequest. + + Name of the new configuration category. # noqa: E501 + + :return: The category_name of this ConfigCategoryCreateRequest. + :rtype: str + """ + return self._category_name + + @category_name.setter + def category_name(self, category_name: str): + """Sets the category_name of this ConfigCategoryCreateRequest. + + Name of the new configuration category. # noqa: E501 + + :param category_name: The category_name of this ConfigCategoryCreateRequest. + :type category_name: str + """ + if category_name is None: + raise ValueError("Invalid value for `category_name`, must not be `None`") # noqa: E501 + + self._category_name = category_name + + @property + def category_values(self) -> Dict[str, object]: + """Gets the category_values of this ConfigCategoryCreateRequest. + + Key/value pairs that compose the new category. # noqa: E501 + + :return: The category_values of this ConfigCategoryCreateRequest. + :rtype: Dict[str, object] + """ + return self._category_values + + @category_values.setter + def category_values(self, category_values: Dict[str, object]): + """Sets the category_values of this ConfigCategoryCreateRequest. + + Key/value pairs that compose the new category. # noqa: E501 + + :param category_values: The category_values of this ConfigCategoryCreateRequest. + :type category_values: Dict[str, object] + """ + if category_values is None: + raise ValueError("Invalid value for `category_values`, must not be `None`") # noqa: E501 + + self._category_values = category_values diff --git a/services/helper/helper_service/services/configuration/models/config_param_update_request.py b/services/helper/helper_service/services/configuration/models/config_param_update_request.py new file mode 100644 index 0000000000000000000000000000000000000000..b313075198a56163531200cb0c67bbb1a2988a8d --- /dev/null +++ b/services/helper/helper_service/services/configuration/models/config_param_update_request.py @@ -0,0 +1,94 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from configuration import util +from configuration.models.base_model import Model + + +class ConfigParamUpdateRequest(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, param_path=None, new_value=None): # noqa: E501 + """ConfigParamUpdateRequest - a model defined in OpenAPI + + :param param_path: The param_path of this ConfigParamUpdateRequest. # noqa: E501 + :type param_path: str + :param new_value: The new_value of this ConfigParamUpdateRequest. # noqa: E501 + :type new_value: object + """ + self.openapi_types = { + 'param_path': str, + 'new_value': object + } + + self.attribute_map = { + 'param_path': 'param_path', + 'new_value': 'new_value' + } + + self._param_path = param_path + self._new_value = new_value + + @classmethod + def from_dict(cls, dikt) -> 'ConfigParamUpdateRequest': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The ConfigParamUpdateRequest of this ConfigParamUpdateRequest. # noqa: E501 + :rtype: ConfigParamUpdateRequest + """ + return util.deserialize_model(dikt, cls) + + @property + def param_path(self) -> str: + """Gets the param_path of this ConfigParamUpdateRequest. + + Dotted path to the configuration value to update. # noqa: E501 + + :return: The param_path of this ConfigParamUpdateRequest. + :rtype: str + """ + return self._param_path + + @param_path.setter + def param_path(self, param_path: str): + """Sets the param_path of this ConfigParamUpdateRequest. + + Dotted path to the configuration value to update. # noqa: E501 + + :param param_path: The param_path of this ConfigParamUpdateRequest. + :type param_path: str + """ + if param_path is None: + raise ValueError("Invalid value for `param_path`, must not be `None`") # noqa: E501 + + self._param_path = param_path + + @property + def new_value(self) -> object: + """Gets the new_value of this ConfigParamUpdateRequest. + + New value for the configuration parameter. # noqa: E501 + + :return: The new_value of this ConfigParamUpdateRequest. + :rtype: object + """ + return self._new_value + + @new_value.setter + def new_value(self, new_value: object): + """Sets the new_value of this ConfigParamUpdateRequest. + + New value for the configuration parameter. # noqa: E501 + + :param new_value: The new_value of this ConfigParamUpdateRequest. + :type new_value: object + """ + if new_value is None: + raise ValueError("Invalid value for `new_value`, must not be `None`") # noqa: E501 + + self._new_value = new_value diff --git a/services/helper/helper_service/services/configuration/models/generic_error.py b/services/helper/helper_service/services/configuration/models/generic_error.py new file mode 100644 index 0000000000000000000000000000000000000000..30a857494134bd5d6b0b77f6da928f4f53fd633c --- /dev/null +++ b/services/helper/helper_service/services/configuration/models/generic_error.py @@ -0,0 +1,90 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from configuration import util +from configuration.models.base_model import Model + + +class GenericError(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, code=None, message=None): # noqa: E501 + """GenericError - a model defined in OpenAPI + + :param code: The code of this GenericError. # noqa: E501 + :type code: str + :param message: The message of this GenericError. # noqa: E501 + :type message: str + """ + self.openapi_types = { + 'code': str, + 'message': str + } + + self.attribute_map = { + 'code': 'code', + 'message': 'message' + } + + self._code = code + self._message = message + + @classmethod + def from_dict(cls, dikt) -> 'GenericError': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The GenericError of this GenericError. # noqa: E501 + :rtype: GenericError + """ + return util.deserialize_model(dikt, cls) + + @property + def code(self) -> str: + """Gets the code of this GenericError. + + + :return: The code of this GenericError. + :rtype: str + """ + return self._code + + @code.setter + def code(self, code: str): + """Sets the code of this GenericError. + + + :param code: The code of this GenericError. + :type code: str + """ + if code is None: + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def message(self) -> str: + """Gets the message of this GenericError. + + + :return: The message of this GenericError. + :rtype: str + """ + return self._message + + @message.setter + def message(self, message: str): + """Sets the message of this GenericError. + + + :param message: The message of this GenericError. + :type message: str + """ + if message is None: + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message diff --git a/services/helper/helper_service/services/configuration/models/settings.py b/services/helper/helper_service/services/configuration/models/settings.py new file mode 100644 index 0000000000000000000000000000000000000000..20d3ab0f708a0dba585895c846bb441e4acfe616 --- /dev/null +++ b/services/helper/helper_service/services/configuration/models/settings.py @@ -0,0 +1,118 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from configuration import util +from configuration.models.base_model import Model +from configuration.models.settings_acl_policy_settings import \ + SettingsAclPolicySettings # noqa: E501 +from configuration.models.settings_certificates_expiry import \ + SettingsCertificatesExpiry # noqa: E501 +from configuration.models.settings_security_method_priority import \ + SettingsSecurityMethodPriority # noqa: E501 + + +class Settings(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, certificates_expiry=None, security_method_priority=None, acl_policy_settings=None): # noqa: E501 + """Settings - a model defined in OpenAPI + + :param certificates_expiry: The certificates_expiry of this Settings. # noqa: E501 + :type certificates_expiry: SettingsCertificatesExpiry + :param security_method_priority: The security_method_priority of this Settings. # noqa: E501 + :type security_method_priority: SettingsSecurityMethodPriority + :param acl_policy_settings: The acl_policy_settings of this Settings. # noqa: E501 + :type acl_policy_settings: SettingsAclPolicySettings + """ + self.openapi_types = { + 'certificates_expiry': SettingsCertificatesExpiry, + 'security_method_priority': SettingsSecurityMethodPriority, + 'acl_policy_settings': SettingsAclPolicySettings + } + + self.attribute_map = { + 'certificates_expiry': 'certificates_expiry', + 'security_method_priority': 'security_method_priority', + 'acl_policy_settings': 'acl_policy_settings' + } + + self._certificates_expiry = certificates_expiry + self._security_method_priority = security_method_priority + self._acl_policy_settings = acl_policy_settings + + @classmethod + def from_dict(cls, dikt) -> 'Settings': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The Settings of this Settings. # noqa: E501 + :rtype: Settings + """ + return util.deserialize_model(dikt, cls) + + @property + def certificates_expiry(self) -> SettingsCertificatesExpiry: + """Gets the certificates_expiry of this Settings. + + + :return: The certificates_expiry of this Settings. + :rtype: SettingsCertificatesExpiry + """ + return self._certificates_expiry + + @certificates_expiry.setter + def certificates_expiry(self, certificates_expiry: SettingsCertificatesExpiry): + """Sets the certificates_expiry of this Settings. + + + :param certificates_expiry: The certificates_expiry of this Settings. + :type certificates_expiry: SettingsCertificatesExpiry + """ + + self._certificates_expiry = certificates_expiry + + @property + def security_method_priority(self) -> SettingsSecurityMethodPriority: + """Gets the security_method_priority of this Settings. + + + :return: The security_method_priority of this Settings. + :rtype: SettingsSecurityMethodPriority + """ + return self._security_method_priority + + @security_method_priority.setter + def security_method_priority(self, security_method_priority: SettingsSecurityMethodPriority): + """Sets the security_method_priority of this Settings. + + + :param security_method_priority: The security_method_priority of this Settings. + :type security_method_priority: SettingsSecurityMethodPriority + """ + + self._security_method_priority = security_method_priority + + @property + def acl_policy_settings(self) -> SettingsAclPolicySettings: + """Gets the acl_policy_settings of this Settings. + + + :return: The acl_policy_settings of this Settings. + :rtype: SettingsAclPolicySettings + """ + return self._acl_policy_settings + + @acl_policy_settings.setter + def acl_policy_settings(self, acl_policy_settings: SettingsAclPolicySettings): + """Sets the acl_policy_settings of this Settings. + + + :param acl_policy_settings: The acl_policy_settings of this Settings. + :type acl_policy_settings: SettingsAclPolicySettings + """ + + self._acl_policy_settings = acl_policy_settings diff --git a/services/helper/helper_service/services/configuration/models/settings_acl_policy_settings.py b/services/helper/helper_service/services/configuration/models/settings_acl_policy_settings.py new file mode 100644 index 0000000000000000000000000000000000000000..3e0fbdf06c0a86582c8cb7bcdd443bcfb3556cd5 --- /dev/null +++ b/services/helper/helper_service/services/configuration/models/settings_acl_policy_settings.py @@ -0,0 +1,118 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from configuration import util +from configuration.models.base_model import Model + + +class SettingsAclPolicySettings(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, allowed_total_invocations=None, allowed_invocations_per_second=None, allowed_invocations_time_range_days=None): # noqa: E501 + """SettingsAclPolicySettings - a model defined in OpenAPI + + :param allowed_total_invocations: The allowed_total_invocations of this SettingsAclPolicySettings. # noqa: E501 + :type allowed_total_invocations: str + :param allowed_invocations_per_second: The allowed_invocations_per_second of this SettingsAclPolicySettings. # noqa: E501 + :type allowed_invocations_per_second: str + :param allowed_invocations_time_range_days: The allowed_invocations_time_range_days of this SettingsAclPolicySettings. # noqa: E501 + :type allowed_invocations_time_range_days: int + """ + self.openapi_types = { + 'allowed_total_invocations': str, + 'allowed_invocations_per_second': str, + 'allowed_invocations_time_range_days': int + } + + self.attribute_map = { + 'allowed_total_invocations': 'allowed_total_invocations', + 'allowed_invocations_per_second': 'allowed_invocations_per_second', + 'allowed_invocations_time_range_days': 'allowed_invocations_time_range_days' + } + + self._allowed_total_invocations = allowed_total_invocations + self._allowed_invocations_per_second = allowed_invocations_per_second + self._allowed_invocations_time_range_days = allowed_invocations_time_range_days + + @classmethod + def from_dict(cls, dikt) -> 'SettingsAclPolicySettings': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The Settings_acl_policy_settings of this SettingsAclPolicySettings. # noqa: E501 + :rtype: SettingsAclPolicySettings + """ + return util.deserialize_model(dikt, cls) + + @property + def allowed_total_invocations(self) -> str: + """Gets the allowed_total_invocations of this SettingsAclPolicySettings. + + total number of requests the invoker can make # noqa: E501 + + :return: The allowed_total_invocations of this SettingsAclPolicySettings. + :rtype: str + """ + return self._allowed_total_invocations + + @allowed_total_invocations.setter + def allowed_total_invocations(self, allowed_total_invocations: str): + """Sets the allowed_total_invocations of this SettingsAclPolicySettings. + + total number of requests the invoker can make # noqa: E501 + + :param allowed_total_invocations: The allowed_total_invocations of this SettingsAclPolicySettings. + :type allowed_total_invocations: str + """ + + self._allowed_total_invocations = allowed_total_invocations + + @property + def allowed_invocations_per_second(self) -> str: + """Gets the allowed_invocations_per_second of this SettingsAclPolicySettings. + + total number of requests the invoker can make per second # noqa: E501 + + :return: The allowed_invocations_per_second of this SettingsAclPolicySettings. + :rtype: str + """ + return self._allowed_invocations_per_second + + @allowed_invocations_per_second.setter + def allowed_invocations_per_second(self, allowed_invocations_per_second: str): + """Sets the allowed_invocations_per_second of this SettingsAclPolicySettings. + + total number of requests the invoker can make per second # noqa: E501 + + :param allowed_invocations_per_second: The allowed_invocations_per_second of this SettingsAclPolicySettings. + :type allowed_invocations_per_second: str + """ + + self._allowed_invocations_per_second = allowed_invocations_per_second + + @property + def allowed_invocations_time_range_days(self) -> int: + """Gets the allowed_invocations_time_range_days of this SettingsAclPolicySettings. + + time range when an invoker can make requests # noqa: E501 + + :return: The allowed_invocations_time_range_days of this SettingsAclPolicySettings. + :rtype: int + """ + return self._allowed_invocations_time_range_days + + @allowed_invocations_time_range_days.setter + def allowed_invocations_time_range_days(self, allowed_invocations_time_range_days: int): + """Sets the allowed_invocations_time_range_days of this SettingsAclPolicySettings. + + time range when an invoker can make requests # noqa: E501 + + :param allowed_invocations_time_range_days: The allowed_invocations_time_range_days of this SettingsAclPolicySettings. + :type allowed_invocations_time_range_days: int + """ + + self._allowed_invocations_time_range_days = allowed_invocations_time_range_days diff --git a/services/helper/helper_service/services/configuration/models/settings_certificates_expiry.py b/services/helper/helper_service/services/configuration/models/settings_certificates_expiry.py new file mode 100644 index 0000000000000000000000000000000000000000..366f740452bccefb817514b37af93faef661c796 --- /dev/null +++ b/services/helper/helper_service/services/configuration/models/settings_certificates_expiry.py @@ -0,0 +1,118 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from configuration import util +from configuration.models.base_model import Model + + +class SettingsCertificatesExpiry(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, ttl_superadmin_cert=None, ttl_invoker_cert=None, ttl_provider_cert=None): # noqa: E501 + """SettingsCertificatesExpiry - a model defined in OpenAPI + + :param ttl_superadmin_cert: The ttl_superadmin_cert of this SettingsCertificatesExpiry. # noqa: E501 + :type ttl_superadmin_cert: str + :param ttl_invoker_cert: The ttl_invoker_cert of this SettingsCertificatesExpiry. # noqa: E501 + :type ttl_invoker_cert: str + :param ttl_provider_cert: The ttl_provider_cert of this SettingsCertificatesExpiry. # noqa: E501 + :type ttl_provider_cert: str + """ + self.openapi_types = { + 'ttl_superadmin_cert': str, + 'ttl_invoker_cert': str, + 'ttl_provider_cert': str + } + + self.attribute_map = { + 'ttl_superadmin_cert': 'ttl_superadmin_cert', + 'ttl_invoker_cert': 'ttl_invoker_cert', + 'ttl_provider_cert': 'ttl_provider_cert' + } + + self._ttl_superadmin_cert = ttl_superadmin_cert + self._ttl_invoker_cert = ttl_invoker_cert + self._ttl_provider_cert = ttl_provider_cert + + @classmethod + def from_dict(cls, dikt) -> 'SettingsCertificatesExpiry': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The Settings_certificates_expiry of this SettingsCertificatesExpiry. # noqa: E501 + :rtype: SettingsCertificatesExpiry + """ + return util.deserialize_model(dikt, cls) + + @property + def ttl_superadmin_cert(self) -> str: + """Gets the ttl_superadmin_cert of this SettingsCertificatesExpiry. + + ttl for superadmin certificates # noqa: E501 + + :return: The ttl_superadmin_cert of this SettingsCertificatesExpiry. + :rtype: str + """ + return self._ttl_superadmin_cert + + @ttl_superadmin_cert.setter + def ttl_superadmin_cert(self, ttl_superadmin_cert: str): + """Sets the ttl_superadmin_cert of this SettingsCertificatesExpiry. + + ttl for superadmin certificates # noqa: E501 + + :param ttl_superadmin_cert: The ttl_superadmin_cert of this SettingsCertificatesExpiry. + :type ttl_superadmin_cert: str + """ + + self._ttl_superadmin_cert = ttl_superadmin_cert + + @property + def ttl_invoker_cert(self) -> str: + """Gets the ttl_invoker_cert of this SettingsCertificatesExpiry. + + ttl for invoker certificates # noqa: E501 + + :return: The ttl_invoker_cert of this SettingsCertificatesExpiry. + :rtype: str + """ + return self._ttl_invoker_cert + + @ttl_invoker_cert.setter + def ttl_invoker_cert(self, ttl_invoker_cert: str): + """Sets the ttl_invoker_cert of this SettingsCertificatesExpiry. + + ttl for invoker certificates # noqa: E501 + + :param ttl_invoker_cert: The ttl_invoker_cert of this SettingsCertificatesExpiry. + :type ttl_invoker_cert: str + """ + + self._ttl_invoker_cert = ttl_invoker_cert + + @property + def ttl_provider_cert(self) -> str: + """Gets the ttl_provider_cert of this SettingsCertificatesExpiry. + + ttl for provider certificates # noqa: E501 + + :return: The ttl_provider_cert of this SettingsCertificatesExpiry. + :rtype: str + """ + return self._ttl_provider_cert + + @ttl_provider_cert.setter + def ttl_provider_cert(self, ttl_provider_cert: str): + """Sets the ttl_provider_cert of this SettingsCertificatesExpiry. + + ttl for provider certificates # noqa: E501 + + :param ttl_provider_cert: The ttl_provider_cert of this SettingsCertificatesExpiry. + :type ttl_provider_cert: str + """ + + self._ttl_provider_cert = ttl_provider_cert diff --git a/services/helper/helper_service/services/configuration/models/settings_security_method_priority.py b/services/helper/helper_service/services/configuration/models/settings_security_method_priority.py new file mode 100644 index 0000000000000000000000000000000000000000..342e5f2e72e5b24c748c474b36824c6ea7dec037 --- /dev/null +++ b/services/helper/helper_service/services/configuration/models/settings_security_method_priority.py @@ -0,0 +1,112 @@ +from datetime import date, datetime # noqa: F401 +from typing import Dict, List # noqa: F401 + +from configuration import util +from configuration.models.base_model import Model + + +class SettingsSecurityMethodPriority(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, oauth=None, pki=None, psk=None): # noqa: E501 + """SettingsSecurityMethodPriority - a model defined in OpenAPI + + :param oauth: The oauth of this SettingsSecurityMethodPriority. # noqa: E501 + :type oauth: int + :param pki: The pki of this SettingsSecurityMethodPriority. # noqa: E501 + :type pki: int + :param psk: The psk of this SettingsSecurityMethodPriority. # noqa: E501 + :type psk: int + """ + self.openapi_types = { + 'oauth': int, + 'pki': int, + 'psk': int + } + + self.attribute_map = { + 'oauth': 'oauth', + 'pki': 'pki', + 'psk': 'psk' + } + + self._oauth = oauth + self._pki = pki + self._psk = psk + + @classmethod + def from_dict(cls, dikt) -> 'SettingsSecurityMethodPriority': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The Settings_security_method_priority of this SettingsSecurityMethodPriority. # noqa: E501 + :rtype: SettingsSecurityMethodPriority + """ + return util.deserialize_model(dikt, cls) + + @property + def oauth(self) -> int: + """Gets the oauth of this SettingsSecurityMethodPriority. + + + :return: The oauth of this SettingsSecurityMethodPriority. + :rtype: int + """ + return self._oauth + + @oauth.setter + def oauth(self, oauth: int): + """Sets the oauth of this SettingsSecurityMethodPriority. + + + :param oauth: The oauth of this SettingsSecurityMethodPriority. + :type oauth: int + """ + + self._oauth = oauth + + @property + def pki(self) -> int: + """Gets the pki of this SettingsSecurityMethodPriority. + + + :return: The pki of this SettingsSecurityMethodPriority. + :rtype: int + """ + return self._pki + + @pki.setter + def pki(self, pki: int): + """Sets the pki of this SettingsSecurityMethodPriority. + + + :param pki: The pki of this SettingsSecurityMethodPriority. + :type pki: int + """ + + self._pki = pki + + @property + def psk(self) -> int: + """Gets the psk of this SettingsSecurityMethodPriority. + + + :return: The psk of this SettingsSecurityMethodPriority. + :rtype: int + """ + return self._psk + + @psk.setter + def psk(self, psk: int): + """Sets the psk of this SettingsSecurityMethodPriority. + + + :param psk: The psk of this SettingsSecurityMethodPriority. + :type psk: int + """ + + self._psk = psk diff --git a/services/helper/helper_service/services/configuration/openapi/openapi.yaml b/services/helper/helper_service/services/configuration/openapi/openapi.yaml new file mode 100644 index 0000000000000000000000000000000000000000..2e23c81ea3905787331986388b514230843a88a6 --- /dev/null +++ b/services/helper/helper_service/services/configuration/openapi/openapi.yaml @@ -0,0 +1,482 @@ +openapi: 3.0.1 +info: + description: | + CAPIF Helper Configuration API. Allows reading and modifying the runtime configuration + stored in MongoDB (ACL policy, certificate expiration, security priorities, etc). + title: Helper Configuration API + version: 1.0.0 +servers: +- url: "{apiRoot}/configuration" + variables: + apiRoot: + default: http://localhost:8080 + description: Base URL of the Helper service. +paths: + /addNewConfigSetting: + patch: + description: Adds a brand new top-level category. + operationId: dynamic_config_controller_add_new_configuration + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigCategoryCreateRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/CapifConfiguration' + description: Category added + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Bad request + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Internal server error + default: + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Generic error response + summary: Add new configuration category + x-openapi-router-controller: configuration.controllers.default_controller + /addNewConfiguration: + post: + description: Adds a new key/value inside an existing category using "param_path" + and "new_value". + operationId: dynamic_config_controller_add_new_config_setting + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigParamUpdateRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/CapifConfiguration' + description: Setting added + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Bad request + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Internal server error + default: + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Generic error response + summary: Add new config setting at path + x-openapi-router-controller: configuration.controllers.default_controller + /getConfiguration: + get: + description: Returns the entire CAPIF configuration document. + operationId: configuration_controller_get_configuration + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/CapifConfiguration' + description: Current configuration + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Internal server error + default: + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Generic error response + summary: Read full configuration + x-openapi-router-controller: configuration.controllers.default_controller + /removeConfigCategory: + delete: + description: Deletes an entire top-level category by name. + operationId: dynamic_config_controller_remove_config_category + parameters: + - description: Configuration path to remove + explode: true + in: query + name: config_path + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/CapifConfiguration' + description: Category removed + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Bad request + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Internal server error + default: + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Generic error response + summary: Remove configuration category + x-openapi-router-controller: configuration.controllers.default_controller + /removeConfigParam: + delete: + description: Deletes a leaf parameter by dotted path. + operationId: dynamic_config_controller_remove_config_param + parameters: + - description: Parameter path to remove + explode: true + in: query + name: param_path + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/CapifConfiguration' + description: Parameter removed + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Bad request + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Internal server error + default: + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Generic error response + summary: Remove config parameter + x-openapi-router-controller: configuration.controllers.default_controller + /replaceConfiguration: + put: + description: Replaces the configuration document with a new one. + operationId: dynamic_config_controller_replace_configuration + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CapifConfiguration' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/CapifConfiguration' + description: Updated configuration + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Bad request + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Internal server error + default: + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Generic error response + summary: Replace entire configuration + x-openapi-router-controller: configuration.controllers.default_controller + /updateConfigParam: + patch: + description: Updates a single setting inside the configuration using a dotted + path selector. + operationId: dynamic_config_controller_update_config_param + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigParamUpdateRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/CapifConfiguration' + description: Parameter updated + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Bad request + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Internal server error + default: + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Generic error response + summary: Update single config parameter + x-openapi-router-controller: configuration.controllers.default_controller +components: + responses: + BadRequest: + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Bad request + InternalError: + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Internal server error + GenericError: + content: + application/json: + schema: + $ref: '#/components/schemas/GenericError' + description: Generic error response + schemas: + CapifConfiguration: + additionalProperties: true + description: CAPIF runtime configuration document. + example: + config_name: default + settings: + - security_method_priority: + psk: 3 + oauth: 1 + pki: 2 + acl_policy_settings: + allowed_invocations_time_range_days: 365 + allowed_invocations_per_second: "5" + allowed_total_invocations: "5" + certificates_expiry: + ttl_superadmin_cert: 4300h + ttl_invoker_cert: 4300h + ttl_provider_cert: 4300h + - security_method_priority: + psk: 3 + oauth: 1 + pki: 2 + acl_policy_settings: + allowed_invocations_time_range_days: 365 + allowed_invocations_per_second: "5" + allowed_total_invocations: "5" + certificates_expiry: + ttl_superadmin_cert: 4300h + ttl_invoker_cert: 4300h + ttl_provider_cert: 4300h + version: "1.0" + properties: + config_name: + description: Configuration name + example: default + type: string + version: + description: configuration version + example: "1.0" + type: string + settings: + items: + $ref: '#/components/schemas/Settings' + type: object + title: CapifConfiguration + type: object + ConfigParamUpdateRequest: + example: + param_path: param_path + new_value: "" + properties: + param_path: + description: Dotted path to the configuration value to update. + title: param_path + type: string + new_value: + description: New value for the configuration parameter. + title: new_value + required: + - new_value + - param_path + title: ConfigParamUpdateRequest + type: object + ConfigCategoryCreateRequest: + example: + category_values: + key: "" + category_name: category_name + properties: + category_name: + description: Name of the new configuration category. + title: category_name + type: string + category_values: + additionalProperties: true + description: Key/value pairs that compose the new category. + title: category_values + type: object + required: + - category_name + - category_values + title: ConfigCategoryCreateRequest + type: object + GenericError: + example: + code: code + message: message + properties: + code: + title: code + type: string + message: + title: message + type: string + required: + - code + - message + title: GenericError + type: object + Settings: + description: Configuration Settings + example: + security_method_priority: + psk: 3 + oauth: 1 + pki: 2 + acl_policy_settings: + allowed_invocations_time_range_days: 365 + allowed_invocations_per_second: "5" + allowed_total_invocations: "5" + certificates_expiry: + ttl_superadmin_cert: 4300h + ttl_invoker_cert: 4300h + ttl_provider_cert: 4300h + properties: + certificates_expiry: + $ref: '#/components/schemas/Settings_certificates_expiry' + security_method_priority: + $ref: '#/components/schemas/Settings_security_method_priority' + acl_policy_settings: + $ref: '#/components/schemas/Settings_acl_policy_settings' + title: Settings + type: object + Settings_certificates_expiry: + description: Expiry configuration for certificates + example: + ttl_superadmin_cert: 4300h + ttl_invoker_cert: 4300h + ttl_provider_cert: 4300h + properties: + ttl_superadmin_cert: + description: ttl for superadmin certificates + example: 4300h + title: ttl_superadmin_cert + type: string + ttl_invoker_cert: + description: ttl for invoker certificates + example: 4300h + title: ttl_invoker_cert + type: string + ttl_provider_cert: + description: ttl for provider certificates + example: 4300h + title: ttl_provider_cert + type: string + title: Settings_certificates_expiry + type: object + Settings_security_method_priority: + description: priority to follow in granting the security method + example: + psk: 3 + oauth: 1 + pki: 2 + properties: + oauth: + example: 1 + title: oauth + type: integer + pki: + example: 2 + title: pki + type: integer + psk: + example: 3 + title: psk + type: integer + title: Settings_security_method_priority + type: object + Settings_acl_policy_settings: + description: default access policies + example: + allowed_invocations_time_range_days: 365 + allowed_invocations_per_second: "5" + allowed_total_invocations: "5" + properties: + allowed_total_invocations: + description: total number of requests the invoker can make + example: "5" + title: allowed_total_invocations + type: string + allowed_invocations_per_second: + description: total number of requests the invoker can make per second + example: "5" + title: allowed_invocations_per_second + type: string + allowed_invocations_time_range_days: + description: time range when an invoker can make requests + example: 365 + title: allowed_invocations_time_range_days + type: integer + title: Settings_acl_policy_settings + type: object diff --git a/services/helper/helper_service/services/configuration/typing_utils.py b/services/helper/helper_service/services/configuration/typing_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..74e3c913a7db6246bc765f147ca872996112c6bb --- /dev/null +++ b/services/helper/helper_service/services/configuration/typing_utils.py @@ -0,0 +1,30 @@ +import sys + +if sys.version_info < (3, 7): + import typing + + def is_generic(klass): + """ Determine whether klass is a generic class """ + return type(klass) == typing.GenericMeta + + def is_dict(klass): + """ Determine whether klass is a Dict """ + return klass.__extra__ == dict + + def is_list(klass): + """ Determine whether klass is a List """ + return klass.__extra__ == list + +else: + + def is_generic(klass): + """ Determine whether klass is a generic class """ + return hasattr(klass, '__origin__') + + def is_dict(klass): + """ Determine whether klass is a Dict """ + return klass.__origin__ == dict + + def is_list(klass): + """ Determine whether klass is a List """ + return klass.__origin__ == list diff --git a/services/helper/helper_service/services/configuration/util.py b/services/helper/helper_service/services/configuration/util.py new file mode 100644 index 0000000000000000000000000000000000000000..8e6b2c7eb4db666ea14e0c3072f907544af41f57 --- /dev/null +++ b/services/helper/helper_service/services/configuration/util.py @@ -0,0 +1,146 @@ +import datetime + +from configuration import typing_utils + + +def _deserialize(data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if klass in (int, float, str, bool, bytearray): + return _deserialize_primitive(data, klass) + elif klass == object: + return _deserialize_object(data) + elif klass == datetime.date: + return deserialize_date(data) + elif klass == datetime.datetime: + return deserialize_datetime(data) + elif typing_utils.is_generic(klass): + if typing_utils.is_list(klass): + return _deserialize_list(data, klass.__args__[0]) + if typing_utils.is_dict(klass): + return _deserialize_dict(data, klass.__args__[1]) + else: + return deserialize_model(data, klass) + + +def _deserialize_primitive(data, klass): + """Deserializes to primitive type. + + :param data: data to deserialize. + :param klass: class literal. + + :return: int, long, float, str, bool. + :rtype: int | long | float | str | bool + """ + try: + value = klass(data) + except UnicodeEncodeError: + value = data + except TypeError: + value = data + return value + + +def _deserialize_object(value): + """Return an original value. + + :return: object. + """ + return value + + +def deserialize_date(string): + """Deserializes string to date. + + :param string: str. + :type string: str + :return: date. + :rtype: date + """ + if string is None: + return None + + try: + from dateutil.parser import parse + return parse(string).date() + except ImportError: + return string + + +def deserialize_datetime(string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :type string: str + :return: datetime. + :rtype: datetime + """ + if string is None: + return None + + try: + from dateutil.parser import parse + return parse(string) + except ImportError: + return string + + +def deserialize_model(data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :type data: dict | list + :param klass: class literal. + :return: model object. + """ + instance = klass() + + if not instance.openapi_types: + return data + + for attr, attr_type in instance.openapi_types.items(): + if data is not None \ + and instance.attribute_map[attr] in data \ + and isinstance(data, (list, dict)): + value = data[instance.attribute_map[attr]] + setattr(instance, attr, _deserialize(value, attr_type)) + + return instance + + +def _deserialize_list(data, boxed_type): + """Deserializes a list and its elements. + + :param data: list to deserialize. + :type data: list + :param boxed_type: class literal. + + :return: deserialized list. + :rtype: list + """ + return [_deserialize(sub_data, boxed_type) + for sub_data in data] + + +def _deserialize_dict(data, boxed_type): + """Deserializes a dict and its elements. + + :param data: dict to deserialize. + :type data: dict + :param boxed_type: class literal. + + :return: deserialized dict. + :rtype: dict + """ + return {k: _deserialize(v, boxed_type) + for k, v in data.items() } diff --git a/services/helper/helper_service/services/visibility_control/__init__.py b/services/helper/helper_service/services/visibility_control/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/services/helper/helper_service/services/visibility_control/__main__.py b/services/helper/helper_service/services/visibility_control/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..346127a6c4fb2d658746b8e1486bf44f60b038d2 --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/__main__.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python3 + +import connexion + +from visibility_control import encoder + + +def main(): + app = connexion.App(__name__, specification_dir='./openapi/') + app.app.json_encoder = encoder.JSONEncoder + app.add_api('openapi.yaml', + arguments={'title': 'OpenCAPIF Access Control'}, + pythonic_params=True) + + app.run(port=8080) + + +if __name__ == '__main__': + main() diff --git a/services/helper/helper_service/services/visibility_control/auth.py b/services/helper/helper_service/services/visibility_control/auth.py new file mode 100644 index 0000000000000000000000000000000000000000..d3abf6e74ae960efdeb7454cf80e6c4dff8a1ad0 --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/auth.py @@ -0,0 +1,38 @@ +from functools import wraps +from cryptography import x509 +from cryptography.hazmat.backends import default_backend +from flask import request +import connexion +#from ..core.validate_user import ControlAccess + +from visibility_control.core.validate_user import ControlAccess +valid_user = ControlAccess() + +def cert_validation(): + def _cert_validation(f): + @wraps(f) + def __cert_validation(*args, **kwargs): + # 1. Get certificate header safely + # cert_tmp = request.headers.get('X-Ssl-Client-Cert') + cert_tmp = request.headers.get('X-Ssl-Client-Cert') or request.headers.get('X-SSL-Client-Cert') or request.headers.get('x-ssl-client-cert') + + if not cert_tmp: + return {"title": "Unauthorized", "detail": "Certificate header missing"}, 401 + + try: + # 2. Process certificate + # cert_raw = cert_tmp.replace('\\t', '') + cert_raw = cert_tmp.replace('\\t', '').replace('\\n', '\n').replace('\\\\n', '\n').replace('\"', '') + cert = x509.load_pem_x509_certificate(str.encode(cert_raw), default_backend()) + cn = cert.subject.get_attributes_for_oid(x509.OID_COMMON_NAME)[0].value.strip() + + # 3. Store identity for the Core logic + request.user_cn = cn + request.cert_signature = cert.signature.hex() + + return f(**kwargs) + except Exception: + return {"title": "Unauthorized", "detail": "Invalid certificate format"}, 401 + return __cert_validation + return _cert_validation + diff --git a/services/helper/helper_service/services/visibility_control/controllers/__init__.py b/services/helper/helper_service/services/visibility_control/controllers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/services/helper/helper_service/services/visibility_control/controllers/decision_controller.py b/services/helper/helper_service/services/visibility_control/controllers/decision_controller.py new file mode 100644 index 0000000000000000000000000000000000000000..4bfdeaff5274e20158f3dbcc47cd761c8fe94f53 --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/controllers/decision_controller.py @@ -0,0 +1,21 @@ +import connexion +from typing import Dict +from typing import Tuple +from typing import Union + +from visibility_control.models.discovered_apis import DiscoveredAPIs # noqa: E501 +from visibility_control.models.error import Error # noqa: E501 +from visibility_control import util + + +def decision_invokers_api_invoker_id_discoverable_apis_get(api_invoker_id): # noqa: E501 + """Get discoverable APIs filter for an invoker (global scope) + + Returns a filtered list of APIs for the API Invoker. # noqa: E501 + + :param api_invoker_id: CAPIF API Invoker identifier + :type api_invoker_id: str + + :rtype: Union[DiscoveredAPIs, Tuple[DiscoveredAPIs, int], Tuple[DiscoveredAPIs, int, Dict[str, str]] + """ + return 'do some magic!' diff --git a/services/helper/helper_service/services/visibility_control/controllers/rules_controller.py b/services/helper/helper_service/services/visibility_control/controllers/rules_controller.py new file mode 100644 index 0000000000000000000000000000000000000000..cb54ac76cdd6f377586150770d9d613a163c21f1 --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/controllers/rules_controller.py @@ -0,0 +1,58 @@ +import connexion +from typing import Dict, Tuple, Union + +#from ..auth import cert_validation + +from visibility_control.auth import cert_validation + +# Importamos la lógica del CORE +from ..core.visibility_control_core import ( + get_all_rules, + create_new_rule, + get_rule_by_id, + delete_rule_by_id, + update_rule_patch +) + +from visibility_control.models.error import Error +from visibility_control.models.rule import Rule +from visibility_control.models.rule_create_request import RuleCreateRequest +from visibility_control.models.rule_patch_request import RulePatchRequest +from visibility_control.models.rules_get200_response import RulesGet200Response +from visibility_control import util + +@cert_validation() +def rules_get(): + """List rules""" + return get_all_rules() + +@cert_validation() +def rules_post(body): + """ + Create a rule + """ + if body is not None: + return create_new_rule(body) + if connexion.request.is_json: + body = connexion.request.get_json() + return create_new_rule(body) + + return Error(title="Bad Request", detail="JSON body required", status=400), 400 + +@cert_validation() +def rules_rule_id_delete(rule_id): + """Delete a rule""" + return delete_rule_by_id(rule_id) + +@cert_validation() +def rules_rule_id_get(rule_id): + """Get a rule""" + return get_rule_by_id(rule_id) + +@cert_validation() +def rules_rule_id_patch(rule_id, body): + """Update a rule (partial)""" + if connexion.request.is_json: + body = connexion.request.get_json() + return update_rule_patch(rule_id, body) + return Error(title="Bad Request", detail="JSON body required", status=400), 400 \ No newline at end of file diff --git a/services/helper/helper_service/services/visibility_control/controllers/security_controller.py b/services/helper/helper_service/services/visibility_control/controllers/security_controller.py new file mode 100644 index 0000000000000000000000000000000000000000..6d294ffd6df1a26a469dbb4e72533b01503468dd --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/controllers/security_controller.py @@ -0,0 +1,2 @@ +from typing import List + diff --git a/services/helper/helper_service/services/visibility_control/core/__init__.py b/services/helper/helper_service/services/visibility_control/core/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/services/helper/helper_service/services/visibility_control/core/validate_user.py b/services/helper/helper_service/services/visibility_control/core/validate_user.py new file mode 100644 index 0000000000000000000000000000000000000000..750bb9d5e46d4dc18eb150ccdc44f98822abe4bc --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/core/validate_user.py @@ -0,0 +1,31 @@ +import json +from flask import Response, current_app + +class Resource: + def __init__(self): + # We use the existing mongo helper from your service + from db.db import get_mongo + self.db = get_mongo() + +class ControlAccess(Resource): + def validate_user_cert(self, api_provider_id, cert_signature): + # Access the certificates collection in CAPIF database + cert_col = self.db.get_col_by_name("certs") + try: + # Check if provider_id matches the certificate signature + my_query = {'provider_id': api_provider_id} + cert_entry = cert_col.find_one(my_query) + + if cert_entry is not None: + if cert_entry["cert_signature"] != cert_signature: + # Return 401 if signatures don't match + prob = { + "title": "Unauthorized", + "detail": "User not authorized", + "cause": "You are not the owner of this resource" + } + return Response(json.dumps(prob), status=401, mimetype="application/json") + return None + except Exception as e: + current_app.logger.error("Error in validate_user_cert: " + str(e)) + return Response(json.dumps({"title": "Internal Server Error", "detail": str(e)}), status=500, mimetype="application/json") \ No newline at end of file diff --git a/services/helper/helper_service/services/visibility_control/core/visibility_control_core.py b/services/helper/helper_service/services/visibility_control/core/visibility_control_core.py new file mode 100644 index 0000000000000000000000000000000000000000..7a19f618057eecbc812aa887017664b5021f141b --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/core/visibility_control_core.py @@ -0,0 +1,270 @@ +import uuid +from datetime import datetime, timezone +from db.db import get_mongo +from config import Config + +from flask import request +from visibility_control.core.validate_user import ControlAccess + +valid_user = ControlAccess() + + +def get_all_rules(): + db = get_mongo() + col = db.get_col_by_name("visibility_rules") + + # The ID from the certificate (e.g., AMFe9d24...) + cn = getattr(request, 'user_cn', None) + + # 1. Superadmin: No filters, returns everything + if cn != "superadmin": + # We look into CAPIF's provider registration to find the friendly name + # assigned to this specific Certificate ID (CN) + prov_col = db.get_col_by_name("provider_details") + provider = prov_col.find_one({"apiProvFuncs.apiProvFuncId": cn}) + + friendly_name = provider.get('userName') if provider else None + + # The query uses an $or operator to ensure visibility: + # - Rules where I am the owner (friendly_name) + # - Rules I created or updated myself (cn) + query_conditions = [{"updatedBy": cn}] + if friendly_name: + query_conditions.append({"providerSelector.userName": friendly_name}) + + rules = list(col.find({"$or": query_conditions}, {"_id": 0})) + return {"rules": rules}, 200 + + rules = list(col.find({}, {"_id": 0})) + return {"rules": rules}, 200 + + +def create_new_rule(body): + db = get_mongo() + col = db.get_col_by_name("visibility_rules") + + # Get identity extracted by the decorator + cn = request.user_cn + cert_sig = request.cert_signature + + # Security check: If not superadmin, validate the mandatory identity + if cn != "superadmin": + ps = body.get('providerSelector', {}) + + # We check apiProviderId if it exists, but we focus on the mandatory identity + api_id = ps.get('apiProviderId', [None])[0] + user_name = ps.get('userName') + + # Use the available ID to validate ownership via certificate signature + # We prioritize apiProviderId, then userName as fallback for validation + user_to_validate = api_id if api_id else user_name + + if user_to_validate: + result = valid_user.validate_user_cert(user_to_validate, cert_sig) + if result is not None: + return result + else: + # If even userName is missing (despite being mandatory in your logic), + # we block it or handle it as a Bad Request + return {"title": "Bad Request", "detail": "userName is mandatory"}, 400 + + # 1. Generate a unique ruleId + body['ruleId'] = str(uuid.uuid4()) + + # 2. Generate current timestamp in UTC ISO 8601 format with 'Z' + now = datetime.now(timezone.utc).isoformat().replace('+00:00', 'Z') + + # 3. Handle and validate 'startsAt' + if 'startsAt' not in body or not body['startsAt']: + # If not provided, default to current time + body['startsAt'] = now + else: + # If provided, validate ISO 8601 format + try: + datetime.fromisoformat(body['startsAt'].replace('Z', '+00:00')) + except ValueError: + return { + "title": "Bad Request", + "detail": "Invalid startsAt format. Please use ISO 8601 (e.g., 2026-01-23T10:00:00Z)" + }, 400 + + # 4. 'updatedAt' is always set to current time during creation + body['updatedAt'] = now + + # 5. Logic validation: endsAt must be greater than startsAt + if 'endsAt' in body and body['endsAt']: + try: + # Convert strings to datetime objects for comparison + start_dt = datetime.fromisoformat(body['startsAt'].replace('Z', '+00:00')) + end_dt = datetime.fromisoformat(body['endsAt'].replace('Z', '+00:00')) + + if end_dt <= start_dt: + return { + "title": "Bad Request", + "detail": "Validation Error: endsAt must be later than startsAt" + }, 400 + except ValueError: + return { + "title": "Bad Request", + "detail": "Invalid endsAt format." + }, 400 + + body['createdBy'] = cn + body['updatedBy'] = cn + + # Save to MongoDB + col.insert_one(body) + + # Remove Mongo internal ID before returning the response + body.pop('_id', None) + + return body, 201 + +def get_rule_by_id(rule_id): + """ + Retrieve a specific visibility rule by its ID. + - Superadmin: Can view any rule. + - Providers: Can view rules they own (userName) or created (updatedBy). + """ + db = get_mongo() + col = db.get_col_by_name("visibility_rules") + cn = request.user_cn + + # 1. Fetch the rule from the database + # We exclude the MongoDB internal _id field immediately + rule = col.find_one({"ruleId": rule_id}, {"_id": 0}) + + if not rule: + return {"title": "Not Found", "detail": "Rule not found"}, 404 + + # 2. Authorization Check: Superadmin bypass + if cn == "superadmin": + return rule, 200 + + # 3. Identity Translation for Providers + # Link the certificate CN to the registered Friendly Username + prov_col = db.get_col_by_name("provider_details") + provider = prov_col.find_one({"apiProvFuncs.apiProvFuncId": cn}) + friendly_name = provider.get('userName') if provider else None + + # 4. Permission Validation + # is_owner: Checks the logical owner in the rule (userName) + # is_creator: Checks the cryptographic signer (updatedBy) + is_owner = rule.get('providerSelector', {}).get('userName') == friendly_name + is_creator = rule.get('updatedBy') == cn + + if is_owner or is_creator: + return rule, 200 + + # 5. Deny access if the requester is neither the owner nor the creator + return { + "title": "Unauthorized", + "detail": "You do not have permission to view this rule" + }, 401 + +def delete_rule_by_id(rule_id): + """ + Delete a specific visibility rule after verifying ownership. + - Superadmin: Can delete any rule. + - Providers: Can only delete rules assigned to them or created by them. + """ + db = get_mongo() + col = db.get_col_by_name("visibility_rules") + cn = request.user_cn + + # 1. Retrieve the rule to check metadata + rule = col.find_one({"ruleId": rule_id}) + if not rule: + return {"title": "Not Found", "detail": "Rule not found"}, 404 + + # 2. Authorization Check: Superadmin bypass + if cn == "superadmin": + col.delete_one({"ruleId": rule_id}) + return None, 204 + + # 3. Identity Translation for Providers + # Resolve the certificate ID to the registered friendly username + prov_col = db.get_col_by_name("provider_details") + provider = prov_col.find_one({"apiProvFuncs.apiProvFuncId": cn}) + friendly_name = provider.get('userName') if provider else None + + # 4. Permissions Validation + # is_owner: Checks if the rule's userName matches the provider's registered name. + # is_creator: Checks if the rule was signed by the current certificate ID. + is_owner = rule.get('providerSelector', {}).get('userName') == friendly_name + is_creator = rule.get('updatedBy') == cn + + if is_owner or is_creator: + res = col.delete_one({"ruleId": rule_id}) + if res.deleted_count > 0: + return None, 204 + + # 5. Deny access if no ownership is proven + return { + "title": "Unauthorized", + "detail": "You do not have permission to delete this rule" + }, 401 + +def update_rule_patch(rule_id, body): + """ + Update a specific visibility rule using PATCH logic. + - Superadmin: Can modify any rule. + - Providers: Can only modify rules they own or created. + """ + db = get_mongo() + col = db.get_col_by_name("visibility_rules") + cn = request.user_cn + + # 1. Fetch existing rule to verify existence and check ownership + existing_rule = col.find_one({"ruleId": rule_id}) + if not existing_rule: + return {"title": "Not Found", "detail": "Rule not found"}, 404 + + # 2. Authorization Check: Superadmin bypass + if cn != "superadmin": + # Resolve Certificate CN to the registered Friendly Username + prov_col = db.get_col_by_name("provider_details") + provider = prov_col.find_one({"apiProvFuncs.apiProvFuncId": cn}) + friendly_name = provider.get('userName') if provider else None + + # Ownership Validation: + # - Check if the rule's userName matches the provider's registered name + # - OR check if the rule was last updated/created by this specific certificate + is_owner = existing_rule.get('providerSelector', {}).get('userName') == friendly_name + is_creator = existing_rule.get('updatedBy') == cn + + if not (is_owner or is_creator): + return { + "title": "Unauthorized", + "detail": "You do not have permission to modify this rule" + }, 401 + + # 3. Metadata Updates + now = datetime.now(timezone.utc).isoformat().replace('+00:00', 'Z') + body['updatedAt'] = now + body['updatedBy'] = cn # Track who performed the update + + # 4. Date Logic Validation + # Ensure startsAt is earlier than endsAt, even if only one is being updated + new_start = body.get('startsAt', existing_rule.get('startsAt')) + new_end = body.get('endsAt', existing_rule.get('endsAt')) + + if new_start and new_end: + try: + s = datetime.fromisoformat(new_start.replace('Z', '+00:00')) + e = datetime.fromisoformat(new_end.replace('Z', '+00:00')) + if e <= s: + return { + "title": "Bad Request", + "detail": "Validation Error: endsAt must be later than startsAt" + }, 400 + except ValueError: + return {"title": "Bad Request", "detail": "Invalid date format."}, 400 + + # 5. Apply changes to Database + # We use $set to only modify the fields provided in the PATCH body + col.update_one({"ruleId": rule_id}, {"$set": body}) + + # Return the fully updated object (excluding Mongo's internal _id) + updated_rule = col.find_one({"ruleId": rule_id}, {"_id": 0}) + return updated_rule, 200 \ No newline at end of file diff --git a/services/helper/helper_service/services/visibility_control/encoder.py b/services/helper/helper_service/services/visibility_control/encoder.py new file mode 100644 index 0000000000000000000000000000000000000000..740bbe7dd9f24c059595a1db20114a6b93c4c9e1 --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/encoder.py @@ -0,0 +1,19 @@ +from connexion.apps.flask_app import FlaskJSONEncoder + +from visibility_control.models.base_model import Model + + +class JSONEncoder(FlaskJSONEncoder): + include_nulls = False + + def default(self, o): + if isinstance(o, Model): + dikt = {} + for attr in o.openapi_types: + value = getattr(o, attr) + if value is None and not self.include_nulls: + continue + attr = o.attribute_map[attr] + dikt[attr] = value + return dikt + return FlaskJSONEncoder.default(self, o) diff --git a/services/helper/helper_service/services/visibility_control/models/__init__.py b/services/helper/helper_service/services/visibility_control/models/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8ba41842fe3a825057bf247896ed118a467da2a1 --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/models/__init__.py @@ -0,0 +1,30 @@ +# flake8: noqa +# import models into model package +from visibility_control.models.aef_location import AefLocation +from visibility_control.models.aef_profile import AefProfile +from visibility_control.models.api_status import ApiStatus +from visibility_control.models.communication_type import CommunicationType +from visibility_control.models.custom_operation import CustomOperation +from visibility_control.models.data_format import DataFormat +from visibility_control.models.discovered_apis import DiscoveredAPIs +from visibility_control.models.error import Error +from visibility_control.models.interface_description import InterfaceDescription +from visibility_control.models.invoker_selector import InvokerSelector +from visibility_control.models.ip_addr_range import IpAddrRange +from visibility_control.models.ip_addr_range_ue_ipv4_addr_ranges_inner import IpAddrRangeUeIpv4AddrRangesInner +from visibility_control.models.o_auth_grant_type import OAuthGrantType +from visibility_control.models.operation import Operation +from visibility_control.models.patch_provider_selector import PatchProviderSelector +from visibility_control.models.protocol import Protocol +from visibility_control.models.provider_selector import ProviderSelector +from visibility_control.models.published_api_path import PublishedApiPath +from visibility_control.models.resource import Resource +from visibility_control.models.rule import Rule +from visibility_control.models.rule_create_request import RuleCreateRequest +from visibility_control.models.rule_patch_request import RulePatchRequest +from visibility_control.models.rules_get200_response import RulesGet200Response +from visibility_control.models.security_method import SecurityMethod +from visibility_control.models.service_api_description import ServiceAPIDescription +from visibility_control.models.service_kpis import ServiceKpis +from visibility_control.models.shareable_information import ShareableInformation +from visibility_control.models.version import Version diff --git a/services/helper/helper_service/services/visibility_control/models/aef_location.py b/services/helper/helper_service/services/visibility_control/models/aef_location.py new file mode 100644 index 0000000000000000000000000000000000000000..fa0d427530e72e8cc9d1d7700ee6703a1fcac125 --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/models/aef_location.py @@ -0,0 +1,61 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from visibility_control.models.base_model import Model +from visibility_control import util + + +class AefLocation(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, dc_id=None): # noqa: E501 + """AefLocation - a model defined in OpenAPI + + :param dc_id: The dc_id of this AefLocation. # noqa: E501 + :type dc_id: str + """ + self.openapi_types = { + 'dc_id': str + } + + self.attribute_map = { + 'dc_id': 'dcId' + } + + self._dc_id = dc_id + + @classmethod + def from_dict(cls, dikt) -> 'AefLocation': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The AefLocation of this AefLocation. # noqa: E501 + :rtype: AefLocation + """ + return util.deserialize_model(dikt, cls) + + @property + def dc_id(self) -> str: + """Gets the dc_id of this AefLocation. + + + :return: The dc_id of this AefLocation. + :rtype: str + """ + return self._dc_id + + @dc_id.setter + def dc_id(self, dc_id: str): + """Sets the dc_id of this AefLocation. + + + :param dc_id: The dc_id of this AefLocation. + :type dc_id: str + """ + + self._dc_id = dc_id diff --git a/services/helper/helper_service/services/visibility_control/models/aef_profile.py b/services/helper/helper_service/services/visibility_control/models/aef_profile.py new file mode 100644 index 0000000000000000000000000000000000000000..8d9535c2f385468dba6a43e3fad52e8ba0676d6f --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/models/aef_profile.py @@ -0,0 +1,345 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from visibility_control.models.base_model import Model +from visibility_control.models.aef_location import AefLocation +from visibility_control.models.data_format import DataFormat +from visibility_control.models.interface_description import InterfaceDescription +from visibility_control.models.ip_addr_range import IpAddrRange +from visibility_control.models.o_auth_grant_type import OAuthGrantType +from visibility_control.models.protocol import Protocol +from visibility_control.models.security_method import SecurityMethod +from visibility_control.models.service_kpis import ServiceKpis +from visibility_control.models.version import Version +from visibility_control import util + +from visibility_control.models.aef_location import AefLocation # noqa: E501 +from visibility_control.models.data_format import DataFormat # noqa: E501 +from visibility_control.models.interface_description import InterfaceDescription # noqa: E501 +from visibility_control.models.ip_addr_range import IpAddrRange # noqa: E501 +from visibility_control.models.o_auth_grant_type import OAuthGrantType # noqa: E501 +from visibility_control.models.protocol import Protocol # noqa: E501 +from visibility_control.models.security_method import SecurityMethod # noqa: E501 +from visibility_control.models.service_kpis import ServiceKpis # noqa: E501 +from visibility_control.models.version import Version # noqa: E501 + +class AefProfile(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, aef_id=None, versions=None, protocol=None, data_format=None, security_methods=None, grant_types=None, domain_name=None, interface_descriptions=None, aef_location=None, service_kpis=None, ue_ip_range=None): # noqa: E501 + """AefProfile - a model defined in OpenAPI + + :param aef_id: The aef_id of this AefProfile. # noqa: E501 + :type aef_id: str + :param versions: The versions of this AefProfile. # noqa: E501 + :type versions: List[Version] + :param protocol: The protocol of this AefProfile. # noqa: E501 + :type protocol: Protocol + :param data_format: The data_format of this AefProfile. # noqa: E501 + :type data_format: DataFormat + :param security_methods: The security_methods of this AefProfile. # noqa: E501 + :type security_methods: List[SecurityMethod] + :param grant_types: The grant_types of this AefProfile. # noqa: E501 + :type grant_types: List[OAuthGrantType] + :param domain_name: The domain_name of this AefProfile. # noqa: E501 + :type domain_name: str + :param interface_descriptions: The interface_descriptions of this AefProfile. # noqa: E501 + :type interface_descriptions: List[InterfaceDescription] + :param aef_location: The aef_location of this AefProfile. # noqa: E501 + :type aef_location: AefLocation + :param service_kpis: The service_kpis of this AefProfile. # noqa: E501 + :type service_kpis: ServiceKpis + :param ue_ip_range: The ue_ip_range of this AefProfile. # noqa: E501 + :type ue_ip_range: IpAddrRange + """ + self.openapi_types = { + 'aef_id': str, + 'versions': List[Version], + 'protocol': Protocol, + 'data_format': DataFormat, + 'security_methods': List[SecurityMethod], + 'grant_types': List[OAuthGrantType], + 'domain_name': str, + 'interface_descriptions': List[InterfaceDescription], + 'aef_location': AefLocation, + 'service_kpis': ServiceKpis, + 'ue_ip_range': IpAddrRange + } + + self.attribute_map = { + 'aef_id': 'aefId', + 'versions': 'versions', + 'protocol': 'protocol', + 'data_format': 'dataFormat', + 'security_methods': 'securityMethods', + 'grant_types': 'grantTypes', + 'domain_name': 'domainName', + 'interface_descriptions': 'interfaceDescriptions', + 'aef_location': 'aefLocation', + 'service_kpis': 'serviceKpis', + 'ue_ip_range': 'ueIpRange' + } + + self._aef_id = aef_id + self._versions = versions + self._protocol = protocol + self._data_format = data_format + self._security_methods = security_methods + self._grant_types = grant_types + self._domain_name = domain_name + self._interface_descriptions = interface_descriptions + self._aef_location = aef_location + self._service_kpis = service_kpis + self._ue_ip_range = ue_ip_range + + @classmethod + def from_dict(cls, dikt) -> 'AefProfile': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The AefProfile of this AefProfile. # noqa: E501 + :rtype: AefProfile + """ + return util.deserialize_model(dikt, cls) + + @property + def aef_id(self) -> str: + """Gets the aef_id of this AefProfile. + + + :return: The aef_id of this AefProfile. + :rtype: str + """ + return self._aef_id + + @aef_id.setter + def aef_id(self, aef_id: str): + """Sets the aef_id of this AefProfile. + + + :param aef_id: The aef_id of this AefProfile. + :type aef_id: str + """ + if aef_id is None: + raise ValueError("Invalid value for `aef_id`, must not be `None`") # noqa: E501 + + self._aef_id = aef_id + + @property + def versions(self) -> List[Version]: + """Gets the versions of this AefProfile. + + + :return: The versions of this AefProfile. + :rtype: List[Version] + """ + return self._versions + + @versions.setter + def versions(self, versions: List[Version]): + """Sets the versions of this AefProfile. + + + :param versions: The versions of this AefProfile. + :type versions: List[Version] + """ + if versions is None: + raise ValueError("Invalid value for `versions`, must not be `None`") # noqa: E501 + if versions is not None and len(versions) < 1: + raise ValueError("Invalid value for `versions`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._versions = versions + + @property + def protocol(self) -> Protocol: + """Gets the protocol of this AefProfile. + + + :return: The protocol of this AefProfile. + :rtype: Protocol + """ + return self._protocol + + @protocol.setter + def protocol(self, protocol: Protocol): + """Sets the protocol of this AefProfile. + + + :param protocol: The protocol of this AefProfile. + :type protocol: Protocol + """ + + self._protocol = protocol + + @property + def data_format(self) -> DataFormat: + """Gets the data_format of this AefProfile. + + + :return: The data_format of this AefProfile. + :rtype: DataFormat + """ + return self._data_format + + @data_format.setter + def data_format(self, data_format: DataFormat): + """Sets the data_format of this AefProfile. + + + :param data_format: The data_format of this AefProfile. + :type data_format: DataFormat + """ + + self._data_format = data_format + + @property + def security_methods(self) -> List[SecurityMethod]: + """Gets the security_methods of this AefProfile. + + + :return: The security_methods of this AefProfile. + :rtype: List[SecurityMethod] + """ + return self._security_methods + + @security_methods.setter + def security_methods(self, security_methods: List[SecurityMethod]): + """Sets the security_methods of this AefProfile. + + + :param security_methods: The security_methods of this AefProfile. + :type security_methods: List[SecurityMethod] + """ + + self._security_methods = security_methods + + @property + def grant_types(self) -> List[OAuthGrantType]: + """Gets the grant_types of this AefProfile. + + + :return: The grant_types of this AefProfile. + :rtype: List[OAuthGrantType] + """ + return self._grant_types + + @grant_types.setter + def grant_types(self, grant_types: List[OAuthGrantType]): + """Sets the grant_types of this AefProfile. + + + :param grant_types: The grant_types of this AefProfile. + :type grant_types: List[OAuthGrantType] + """ + + self._grant_types = grant_types + + @property + def domain_name(self) -> str: + """Gets the domain_name of this AefProfile. + + + :return: The domain_name of this AefProfile. + :rtype: str + """ + return self._domain_name + + @domain_name.setter + def domain_name(self, domain_name: str): + """Sets the domain_name of this AefProfile. + + + :param domain_name: The domain_name of this AefProfile. + :type domain_name: str + """ + + self._domain_name = domain_name + + @property + def interface_descriptions(self) -> List[InterfaceDescription]: + """Gets the interface_descriptions of this AefProfile. + + + :return: The interface_descriptions of this AefProfile. + :rtype: List[InterfaceDescription] + """ + return self._interface_descriptions + + @interface_descriptions.setter + def interface_descriptions(self, interface_descriptions: List[InterfaceDescription]): + """Sets the interface_descriptions of this AefProfile. + + + :param interface_descriptions: The interface_descriptions of this AefProfile. + :type interface_descriptions: List[InterfaceDescription] + """ + + self._interface_descriptions = interface_descriptions + + @property + def aef_location(self) -> AefLocation: + """Gets the aef_location of this AefProfile. + + + :return: The aef_location of this AefProfile. + :rtype: AefLocation + """ + return self._aef_location + + @aef_location.setter + def aef_location(self, aef_location: AefLocation): + """Sets the aef_location of this AefProfile. + + + :param aef_location: The aef_location of this AefProfile. + :type aef_location: AefLocation + """ + + self._aef_location = aef_location + + @property + def service_kpis(self) -> ServiceKpis: + """Gets the service_kpis of this AefProfile. + + + :return: The service_kpis of this AefProfile. + :rtype: ServiceKpis + """ + return self._service_kpis + + @service_kpis.setter + def service_kpis(self, service_kpis: ServiceKpis): + """Sets the service_kpis of this AefProfile. + + + :param service_kpis: The service_kpis of this AefProfile. + :type service_kpis: ServiceKpis + """ + + self._service_kpis = service_kpis + + @property + def ue_ip_range(self) -> IpAddrRange: + """Gets the ue_ip_range of this AefProfile. + + + :return: The ue_ip_range of this AefProfile. + :rtype: IpAddrRange + """ + return self._ue_ip_range + + @ue_ip_range.setter + def ue_ip_range(self, ue_ip_range: IpAddrRange): + """Sets the ue_ip_range of this AefProfile. + + + :param ue_ip_range: The ue_ip_range of this AefProfile. + :type ue_ip_range: IpAddrRange + """ + + self._ue_ip_range = ue_ip_range diff --git a/services/helper/helper_service/services/visibility_control/models/api_status.py b/services/helper/helper_service/services/visibility_control/models/api_status.py new file mode 100644 index 0000000000000000000000000000000000000000..9c00fa2dd4eb06189e1375e51d02abc76783d7f9 --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/models/api_status.py @@ -0,0 +1,63 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from visibility_control.models.base_model import Model +from visibility_control import util + + +class ApiStatus(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, aef_ids=None): # noqa: E501 + """ApiStatus - a model defined in OpenAPI + + :param aef_ids: The aef_ids of this ApiStatus. # noqa: E501 + :type aef_ids: List[str] + """ + self.openapi_types = { + 'aef_ids': List[str] + } + + self.attribute_map = { + 'aef_ids': 'aefIds' + } + + self._aef_ids = aef_ids + + @classmethod + def from_dict(cls, dikt) -> 'ApiStatus': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The ApiStatus of this ApiStatus. # noqa: E501 + :rtype: ApiStatus + """ + return util.deserialize_model(dikt, cls) + + @property + def aef_ids(self) -> List[str]: + """Gets the aef_ids of this ApiStatus. + + + :return: The aef_ids of this ApiStatus. + :rtype: List[str] + """ + return self._aef_ids + + @aef_ids.setter + def aef_ids(self, aef_ids: List[str]): + """Sets the aef_ids of this ApiStatus. + + + :param aef_ids: The aef_ids of this ApiStatus. + :type aef_ids: List[str] + """ + if aef_ids is None: + raise ValueError("Invalid value for `aef_ids`, must not be `None`") # noqa: E501 + + self._aef_ids = aef_ids diff --git a/services/helper/helper_service/services/visibility_control/models/base_model.py b/services/helper/helper_service/services/visibility_control/models/base_model.py new file mode 100644 index 0000000000000000000000000000000000000000..ad4a3fb58507e2dc34bc5fd84568ba4b55013fe2 --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/models/base_model.py @@ -0,0 +1,68 @@ +import pprint + +import typing + +from visibility_control import util + +T = typing.TypeVar('T') + + +class Model: + # openapiTypes: The key is attribute name and the + # value is attribute type. + openapi_types: typing.Dict[str, type] = {} + + # attributeMap: The key is attribute name and the + # value is json key in definition. + attribute_map: typing.Dict[str, str] = {} + + @classmethod + def from_dict(cls: typing.Type[T], dikt) -> T: + """Returns the dict as a model""" + return util.deserialize_model(dikt, cls) + + def to_dict(self): + """Returns the model properties as a dict + + :rtype: dict + """ + result = {} + + for attr in self.openapi_types: + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model + + :rtype: str + """ + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/services/helper/helper_service/services/visibility_control/models/communication_type.py b/services/helper/helper_service/services/visibility_control/models/communication_type.py new file mode 100644 index 0000000000000000000000000000000000000000..5ef1f973d35b34ee8381c08c99d8efb71ce9ea88 --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/models/communication_type.py @@ -0,0 +1,39 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from visibility_control.models.base_model import Model +from visibility_control import util + + +class CommunicationType(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + REQUEST_RESPONSE = 'REQUEST_RESPONSE' + SUBSCRIBE_NOTIFY = 'SUBSCRIBE_NOTIFY' + def __init__(self): # noqa: E501 + """CommunicationType - a model defined in OpenAPI + + """ + self.openapi_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'CommunicationType': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The CommunicationType of this CommunicationType. # noqa: E501 + :rtype: CommunicationType + """ + return util.deserialize_model(dikt, cls) diff --git a/services/helper/helper_service/services/visibility_control/models/custom_operation.py b/services/helper/helper_service/services/visibility_control/models/custom_operation.py new file mode 100644 index 0000000000000000000000000000000000000000..9699385d50f348a5d6953d3856923812fd0ccff5 --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/models/custom_operation.py @@ -0,0 +1,147 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from visibility_control.models.base_model import Model +from visibility_control.models.communication_type import CommunicationType +from visibility_control.models.operation import Operation +from visibility_control import util + +from visibility_control.models.communication_type import CommunicationType # noqa: E501 +from visibility_control.models.operation import Operation # noqa: E501 + +class CustomOperation(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, comm_type=None, cust_op_name=None, operations=None, description=None): # noqa: E501 + """CustomOperation - a model defined in OpenAPI + + :param comm_type: The comm_type of this CustomOperation. # noqa: E501 + :type comm_type: CommunicationType + :param cust_op_name: The cust_op_name of this CustomOperation. # noqa: E501 + :type cust_op_name: str + :param operations: The operations of this CustomOperation. # noqa: E501 + :type operations: List[Operation] + :param description: The description of this CustomOperation. # noqa: E501 + :type description: str + """ + self.openapi_types = { + 'comm_type': CommunicationType, + 'cust_op_name': str, + 'operations': List[Operation], + 'description': str + } + + self.attribute_map = { + 'comm_type': 'commType', + 'cust_op_name': 'custOpName', + 'operations': 'operations', + 'description': 'description' + } + + self._comm_type = comm_type + self._cust_op_name = cust_op_name + self._operations = operations + self._description = description + + @classmethod + def from_dict(cls, dikt) -> 'CustomOperation': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The CustomOperation of this CustomOperation. # noqa: E501 + :rtype: CustomOperation + """ + return util.deserialize_model(dikt, cls) + + @property + def comm_type(self) -> CommunicationType: + """Gets the comm_type of this CustomOperation. + + + :return: The comm_type of this CustomOperation. + :rtype: CommunicationType + """ + return self._comm_type + + @comm_type.setter + def comm_type(self, comm_type: CommunicationType): + """Sets the comm_type of this CustomOperation. + + + :param comm_type: The comm_type of this CustomOperation. + :type comm_type: CommunicationType + """ + if comm_type is None: + raise ValueError("Invalid value for `comm_type`, must not be `None`") # noqa: E501 + + self._comm_type = comm_type + + @property + def cust_op_name(self) -> str: + """Gets the cust_op_name of this CustomOperation. + + + :return: The cust_op_name of this CustomOperation. + :rtype: str + """ + return self._cust_op_name + + @cust_op_name.setter + def cust_op_name(self, cust_op_name: str): + """Sets the cust_op_name of this CustomOperation. + + + :param cust_op_name: The cust_op_name of this CustomOperation. + :type cust_op_name: str + """ + if cust_op_name is None: + raise ValueError("Invalid value for `cust_op_name`, must not be `None`") # noqa: E501 + + self._cust_op_name = cust_op_name + + @property + def operations(self) -> List[Operation]: + """Gets the operations of this CustomOperation. + + + :return: The operations of this CustomOperation. + :rtype: List[Operation] + """ + return self._operations + + @operations.setter + def operations(self, operations: List[Operation]): + """Sets the operations of this CustomOperation. + + + :param operations: The operations of this CustomOperation. + :type operations: List[Operation] + """ + + self._operations = operations + + @property + def description(self) -> str: + """Gets the description of this CustomOperation. + + + :return: The description of this CustomOperation. + :rtype: str + """ + return self._description + + @description.setter + def description(self, description: str): + """Sets the description of this CustomOperation. + + + :param description: The description of this CustomOperation. + :type description: str + """ + + self._description = description diff --git a/services/helper/helper_service/services/visibility_control/models/data_format.py b/services/helper/helper_service/services/visibility_control/models/data_format.py new file mode 100644 index 0000000000000000000000000000000000000000..1e4c3549a313bc636afc1e0d7e1be805227f048e --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/models/data_format.py @@ -0,0 +1,40 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from visibility_control.models.base_model import Model +from visibility_control import util + + +class DataFormat(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + JSON = 'JSON' + XML = 'XML' + PROTOBUF3 = 'PROTOBUF3' + def __init__(self): # noqa: E501 + """DataFormat - a model defined in OpenAPI + + """ + self.openapi_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'DataFormat': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The DataFormat of this DataFormat. # noqa: E501 + :rtype: DataFormat + """ + return util.deserialize_model(dikt, cls) diff --git a/services/helper/helper_service/services/visibility_control/models/discovered_apis.py b/services/helper/helper_service/services/visibility_control/models/discovered_apis.py new file mode 100644 index 0000000000000000000000000000000000000000..37b336f6a297893f6af989441994f3f2110c4d46 --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/models/discovered_apis.py @@ -0,0 +1,95 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from visibility_control.models.base_model import Model +from visibility_control.models.service_api_description import ServiceAPIDescription +import re +from visibility_control import util + +from visibility_control.models.service_api_description import ServiceAPIDescription # noqa: E501 +import re # noqa: E501 + +class DiscoveredAPIs(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, service_api_descriptions=None, supp_feat=None): # noqa: E501 + """DiscoveredAPIs - a model defined in OpenAPI + + :param service_api_descriptions: The service_api_descriptions of this DiscoveredAPIs. # noqa: E501 + :type service_api_descriptions: List[ServiceAPIDescription] + :param supp_feat: The supp_feat of this DiscoveredAPIs. # noqa: E501 + :type supp_feat: str + """ + self.openapi_types = { + 'service_api_descriptions': List[ServiceAPIDescription], + 'supp_feat': str + } + + self.attribute_map = { + 'service_api_descriptions': 'serviceAPIDescriptions', + 'supp_feat': 'suppFeat' + } + + self._service_api_descriptions = service_api_descriptions + self._supp_feat = supp_feat + + @classmethod + def from_dict(cls, dikt) -> 'DiscoveredAPIs': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The DiscoveredAPIs of this DiscoveredAPIs. # noqa: E501 + :rtype: DiscoveredAPIs + """ + return util.deserialize_model(dikt, cls) + + @property + def service_api_descriptions(self) -> List[ServiceAPIDescription]: + """Gets the service_api_descriptions of this DiscoveredAPIs. + + + :return: The service_api_descriptions of this DiscoveredAPIs. + :rtype: List[ServiceAPIDescription] + """ + return self._service_api_descriptions + + @service_api_descriptions.setter + def service_api_descriptions(self, service_api_descriptions: List[ServiceAPIDescription]): + """Sets the service_api_descriptions of this DiscoveredAPIs. + + + :param service_api_descriptions: The service_api_descriptions of this DiscoveredAPIs. + :type service_api_descriptions: List[ServiceAPIDescription] + """ + if service_api_descriptions is not None and len(service_api_descriptions) < 1: + raise ValueError("Invalid value for `service_api_descriptions`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._service_api_descriptions = service_api_descriptions + + @property + def supp_feat(self) -> str: + """Gets the supp_feat of this DiscoveredAPIs. + + + :return: The supp_feat of this DiscoveredAPIs. + :rtype: str + """ + return self._supp_feat + + @supp_feat.setter + def supp_feat(self, supp_feat: str): + """Sets the supp_feat of this DiscoveredAPIs. + + + :param supp_feat: The supp_feat of this DiscoveredAPIs. + :type supp_feat: str + """ + if supp_feat is not None and not re.search(r'^[A-Fa-f0-9]*$', supp_feat): # noqa: E501 + raise ValueError(r"Invalid value for `supp_feat`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + + self._supp_feat = supp_feat diff --git a/services/helper/helper_service/services/visibility_control/models/error.py b/services/helper/helper_service/services/visibility_control/models/error.py new file mode 100644 index 0000000000000000000000000000000000000000..de24c3233457e8a5db13910d298d90790acd043a --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/models/error.py @@ -0,0 +1,117 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from visibility_control.models.base_model import Model +from visibility_control import util + + +class Error(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, code=None, message=None, details=None): # noqa: E501 + """Error - a model defined in OpenAPI + + :param code: The code of this Error. # noqa: E501 + :type code: str + :param message: The message of this Error. # noqa: E501 + :type message: str + :param details: The details of this Error. # noqa: E501 + :type details: Dict[str, object] + """ + self.openapi_types = { + 'code': str, + 'message': str, + 'details': Dict[str, object] + } + + self.attribute_map = { + 'code': 'code', + 'message': 'message', + 'details': 'details' + } + + self._code = code + self._message = message + self._details = details + + @classmethod + def from_dict(cls, dikt) -> 'Error': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The Error of this Error. # noqa: E501 + :rtype: Error + """ + return util.deserialize_model(dikt, cls) + + @property + def code(self) -> str: + """Gets the code of this Error. + + + :return: The code of this Error. + :rtype: str + """ + return self._code + + @code.setter + def code(self, code: str): + """Sets the code of this Error. + + + :param code: The code of this Error. + :type code: str + """ + if code is None: + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def message(self) -> str: + """Gets the message of this Error. + + + :return: The message of this Error. + :rtype: str + """ + return self._message + + @message.setter + def message(self, message: str): + """Sets the message of this Error. + + + :param message: The message of this Error. + :type message: str + """ + if message is None: + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def details(self) -> Dict[str, object]: + """Gets the details of this Error. + + + :return: The details of this Error. + :rtype: Dict[str, object] + """ + return self._details + + @details.setter + def details(self, details: Dict[str, object]): + """Sets the details of this Error. + + + :param details: The details of this Error. + :type details: Dict[str, object] + """ + + self._details = details diff --git a/services/helper/helper_service/services/visibility_control/models/interface_description.py b/services/helper/helper_service/services/visibility_control/models/interface_description.py new file mode 100644 index 0000000000000000000000000000000000000000..477ebd8255e5f6da5d7da06071edcfe7fa144aa4 --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/models/interface_description.py @@ -0,0 +1,221 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from visibility_control.models.base_model import Model +from visibility_control.models.o_auth_grant_type import OAuthGrantType +from visibility_control.models.security_method import SecurityMethod +from visibility_control import util + +from visibility_control.models.o_auth_grant_type import OAuthGrantType # noqa: E501 +from visibility_control.models.security_method import SecurityMethod # noqa: E501 + +class InterfaceDescription(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, ipv4_addr=None, ipv6_addr=None, fqdn=None, port=None, api_prefix=None, security_methods=None, grant_types=None): # noqa: E501 + """InterfaceDescription - a model defined in OpenAPI + + :param ipv4_addr: The ipv4_addr of this InterfaceDescription. # noqa: E501 + :type ipv4_addr: str + :param ipv6_addr: The ipv6_addr of this InterfaceDescription. # noqa: E501 + :type ipv6_addr: str + :param fqdn: The fqdn of this InterfaceDescription. # noqa: E501 + :type fqdn: str + :param port: The port of this InterfaceDescription. # noqa: E501 + :type port: int + :param api_prefix: The api_prefix of this InterfaceDescription. # noqa: E501 + :type api_prefix: str + :param security_methods: The security_methods of this InterfaceDescription. # noqa: E501 + :type security_methods: List[SecurityMethod] + :param grant_types: The grant_types of this InterfaceDescription. # noqa: E501 + :type grant_types: List[OAuthGrantType] + """ + self.openapi_types = { + 'ipv4_addr': str, + 'ipv6_addr': str, + 'fqdn': str, + 'port': int, + 'api_prefix': str, + 'security_methods': List[SecurityMethod], + 'grant_types': List[OAuthGrantType] + } + + self.attribute_map = { + 'ipv4_addr': 'ipv4Addr', + 'ipv6_addr': 'ipv6Addr', + 'fqdn': 'fqdn', + 'port': 'port', + 'api_prefix': 'apiPrefix', + 'security_methods': 'securityMethods', + 'grant_types': 'grantTypes' + } + + self._ipv4_addr = ipv4_addr + self._ipv6_addr = ipv6_addr + self._fqdn = fqdn + self._port = port + self._api_prefix = api_prefix + self._security_methods = security_methods + self._grant_types = grant_types + + @classmethod + def from_dict(cls, dikt) -> 'InterfaceDescription': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The InterfaceDescription of this InterfaceDescription. # noqa: E501 + :rtype: InterfaceDescription + """ + return util.deserialize_model(dikt, cls) + + @property + def ipv4_addr(self) -> str: + """Gets the ipv4_addr of this InterfaceDescription. + + + :return: The ipv4_addr of this InterfaceDescription. + :rtype: str + """ + return self._ipv4_addr + + @ipv4_addr.setter + def ipv4_addr(self, ipv4_addr: str): + """Sets the ipv4_addr of this InterfaceDescription. + + + :param ipv4_addr: The ipv4_addr of this InterfaceDescription. + :type ipv4_addr: str + """ + + self._ipv4_addr = ipv4_addr + + @property + def ipv6_addr(self) -> str: + """Gets the ipv6_addr of this InterfaceDescription. + + + :return: The ipv6_addr of this InterfaceDescription. + :rtype: str + """ + return self._ipv6_addr + + @ipv6_addr.setter + def ipv6_addr(self, ipv6_addr: str): + """Sets the ipv6_addr of this InterfaceDescription. + + + :param ipv6_addr: The ipv6_addr of this InterfaceDescription. + :type ipv6_addr: str + """ + + self._ipv6_addr = ipv6_addr + + @property + def fqdn(self) -> str: + """Gets the fqdn of this InterfaceDescription. + + + :return: The fqdn of this InterfaceDescription. + :rtype: str + """ + return self._fqdn + + @fqdn.setter + def fqdn(self, fqdn: str): + """Sets the fqdn of this InterfaceDescription. + + + :param fqdn: The fqdn of this InterfaceDescription. + :type fqdn: str + """ + + self._fqdn = fqdn + + @property + def port(self) -> int: + """Gets the port of this InterfaceDescription. + + + :return: The port of this InterfaceDescription. + :rtype: int + """ + return self._port + + @port.setter + def port(self, port: int): + """Sets the port of this InterfaceDescription. + + + :param port: The port of this InterfaceDescription. + :type port: int + """ + + self._port = port + + @property + def api_prefix(self) -> str: + """Gets the api_prefix of this InterfaceDescription. + + + :return: The api_prefix of this InterfaceDescription. + :rtype: str + """ + return self._api_prefix + + @api_prefix.setter + def api_prefix(self, api_prefix: str): + """Sets the api_prefix of this InterfaceDescription. + + + :param api_prefix: The api_prefix of this InterfaceDescription. + :type api_prefix: str + """ + + self._api_prefix = api_prefix + + @property + def security_methods(self) -> List[SecurityMethod]: + """Gets the security_methods of this InterfaceDescription. + + + :return: The security_methods of this InterfaceDescription. + :rtype: List[SecurityMethod] + """ + return self._security_methods + + @security_methods.setter + def security_methods(self, security_methods: List[SecurityMethod]): + """Sets the security_methods of this InterfaceDescription. + + + :param security_methods: The security_methods of this InterfaceDescription. + :type security_methods: List[SecurityMethod] + """ + + self._security_methods = security_methods + + @property + def grant_types(self) -> List[OAuthGrantType]: + """Gets the grant_types of this InterfaceDescription. + + + :return: The grant_types of this InterfaceDescription. + :rtype: List[OAuthGrantType] + """ + return self._grant_types + + @grant_types.setter + def grant_types(self, grant_types: List[OAuthGrantType]): + """Sets the grant_types of this InterfaceDescription. + + + :param grant_types: The grant_types of this InterfaceDescription. + :type grant_types: List[OAuthGrantType] + """ + + self._grant_types = grant_types diff --git a/services/helper/helper_service/services/visibility_control/models/invoker_selector.py b/services/helper/helper_service/services/visibility_control/models/invoker_selector.py new file mode 100644 index 0000000000000000000000000000000000000000..b2dbae7fd567b0846d4ef870a972d6de196fdb53 --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/models/invoker_selector.py @@ -0,0 +1,91 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from visibility_control.models.base_model import Model +from visibility_control import util + + +class InvokerSelector(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, invoker_onboarded_by_user=None, api_invoker_id=None): # noqa: E501 + """InvokerSelector - a model defined in OpenAPI + + :param invoker_onboarded_by_user: The invoker_onboarded_by_user of this InvokerSelector. # noqa: E501 + :type invoker_onboarded_by_user: list[str] + :param api_invoker_id: The api_invoker_id of this InvokerSelector. # noqa: E501 + :type api_invoker_id: list[str] + """ + self.openapi_types = { + 'invoker_onboarded_by_user': list[str], + 'api_invoker_id': list[str] + } + + self.attribute_map = { + 'invoker_onboarded_by_user': 'invokerOnboardedByUser', + 'api_invoker_id': 'apiInvokerId' + } + + self._invoker_onboarded_by_user = invoker_onboarded_by_user + self._api_invoker_id = api_invoker_id + + @classmethod + def from_dict(cls, dikt) -> 'InvokerSelector': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The InvokerSelector of this InvokerSelector. # noqa: E501 + :rtype: InvokerSelector + """ + return util.deserialize_model(dikt, cls) + + @property + def invoker_onboarded_by_user(self) -> list[str]: + """Gets the invoker_onboarded_by_user of this InvokerSelector. + + + :return: The invoker_onboarded_by_user of this InvokerSelector. + :rtype: list[str] + """ + return self._invoker_onboarded_by_user + + @invoker_onboarded_by_user.setter + def invoker_onboarded_by_user(self, invoker_onboarded_by_user: list[str]): + """Sets the invoker_onboarded_by_user of this InvokerSelector. + + + :param invoker_onboarded_by_user: The invoker_onboarded_by_user of this InvokerSelector. + :type invoker_onboarded_by_user: list[str] + """ + if invoker_onboarded_by_user is not None and len(invoker_onboarded_by_user) < 0: + raise ValueError("Invalid value for `invoker_onboarded_by_user`, number of items must be greater than or equal to `0`") # noqa: E501 + + self._invoker_onboarded_by_user = invoker_onboarded_by_user + + @property + def api_invoker_id(self) -> list[str]: + """Gets the api_invoker_id of this InvokerSelector. + + + :return: The api_invoker_id of this InvokerSelector. + :rtype: list[str] + """ + return self._api_invoker_id + + @api_invoker_id.setter + def api_invoker_id(self, api_invoker_id: list[str]): + """Sets the api_invoker_id of this InvokerSelector. + + + :param api_invoker_id: The api_invoker_id of this InvokerSelector. + :type api_invoker_id: list[str] + """ + if api_invoker_id is not None and len(api_invoker_id) < 0: + raise ValueError("Invalid value for `api_invoker_id`, number of items must be greater than or equal to `0`") # noqa: E501 + + self._api_invoker_id = api_invoker_id diff --git a/services/helper/helper_service/services/visibility_control/models/ip_addr_range.py b/services/helper/helper_service/services/visibility_control/models/ip_addr_range.py new file mode 100644 index 0000000000000000000000000000000000000000..e1eddcf627b5f93585d53734b11b330a75d6fc33 --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/models/ip_addr_range.py @@ -0,0 +1,63 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from visibility_control.models.base_model import Model +from visibility_control.models.ip_addr_range_ue_ipv4_addr_ranges_inner import IpAddrRangeUeIpv4AddrRangesInner +from visibility_control import util + +from visibility_control.models.ip_addr_range_ue_ipv4_addr_ranges_inner import IpAddrRangeUeIpv4AddrRangesInner # noqa: E501 + +class IpAddrRange(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, ue_ipv4_addr_ranges=None): # noqa: E501 + """IpAddrRange - a model defined in OpenAPI + + :param ue_ipv4_addr_ranges: The ue_ipv4_addr_ranges of this IpAddrRange. # noqa: E501 + :type ue_ipv4_addr_ranges: List[IpAddrRangeUeIpv4AddrRangesInner] + """ + self.openapi_types = { + 'ue_ipv4_addr_ranges': List[IpAddrRangeUeIpv4AddrRangesInner] + } + + self.attribute_map = { + 'ue_ipv4_addr_ranges': 'ueIpv4AddrRanges' + } + + self._ue_ipv4_addr_ranges = ue_ipv4_addr_ranges + + @classmethod + def from_dict(cls, dikt) -> 'IpAddrRange': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The IpAddrRange of this IpAddrRange. # noqa: E501 + :rtype: IpAddrRange + """ + return util.deserialize_model(dikt, cls) + + @property + def ue_ipv4_addr_ranges(self) -> List[IpAddrRangeUeIpv4AddrRangesInner]: + """Gets the ue_ipv4_addr_ranges of this IpAddrRange. + + + :return: The ue_ipv4_addr_ranges of this IpAddrRange. + :rtype: List[IpAddrRangeUeIpv4AddrRangesInner] + """ + return self._ue_ipv4_addr_ranges + + @ue_ipv4_addr_ranges.setter + def ue_ipv4_addr_ranges(self, ue_ipv4_addr_ranges: List[IpAddrRangeUeIpv4AddrRangesInner]): + """Sets the ue_ipv4_addr_ranges of this IpAddrRange. + + + :param ue_ipv4_addr_ranges: The ue_ipv4_addr_ranges of this IpAddrRange. + :type ue_ipv4_addr_ranges: List[IpAddrRangeUeIpv4AddrRangesInner] + """ + + self._ue_ipv4_addr_ranges = ue_ipv4_addr_ranges diff --git a/services/helper/helper_service/services/visibility_control/models/ip_addr_range_ue_ipv4_addr_ranges_inner.py b/services/helper/helper_service/services/visibility_control/models/ip_addr_range_ue_ipv4_addr_ranges_inner.py new file mode 100644 index 0000000000000000000000000000000000000000..d92d5e9d4edfe101af87f56973fb84404f2f0313 --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/models/ip_addr_range_ue_ipv4_addr_ranges_inner.py @@ -0,0 +1,87 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from visibility_control.models.base_model import Model +from visibility_control import util + + +class IpAddrRangeUeIpv4AddrRangesInner(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, start=None, end=None): # noqa: E501 + """IpAddrRangeUeIpv4AddrRangesInner - a model defined in OpenAPI + + :param start: The start of this IpAddrRangeUeIpv4AddrRangesInner. # noqa: E501 + :type start: str + :param end: The end of this IpAddrRangeUeIpv4AddrRangesInner. # noqa: E501 + :type end: str + """ + self.openapi_types = { + 'start': str, + 'end': str + } + + self.attribute_map = { + 'start': 'start', + 'end': 'end' + } + + self._start = start + self._end = end + + @classmethod + def from_dict(cls, dikt) -> 'IpAddrRangeUeIpv4AddrRangesInner': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The IpAddrRange_ueIpv4AddrRanges_inner of this IpAddrRangeUeIpv4AddrRangesInner. # noqa: E501 + :rtype: IpAddrRangeUeIpv4AddrRangesInner + """ + return util.deserialize_model(dikt, cls) + + @property + def start(self) -> str: + """Gets the start of this IpAddrRangeUeIpv4AddrRangesInner. + + + :return: The start of this IpAddrRangeUeIpv4AddrRangesInner. + :rtype: str + """ + return self._start + + @start.setter + def start(self, start: str): + """Sets the start of this IpAddrRangeUeIpv4AddrRangesInner. + + + :param start: The start of this IpAddrRangeUeIpv4AddrRangesInner. + :type start: str + """ + + self._start = start + + @property + def end(self) -> str: + """Gets the end of this IpAddrRangeUeIpv4AddrRangesInner. + + + :return: The end of this IpAddrRangeUeIpv4AddrRangesInner. + :rtype: str + """ + return self._end + + @end.setter + def end(self, end: str): + """Sets the end of this IpAddrRangeUeIpv4AddrRangesInner. + + + :param end: The end of this IpAddrRangeUeIpv4AddrRangesInner. + :type end: str + """ + + self._end = end diff --git a/services/helper/helper_service/services/visibility_control/models/o_auth_grant_type.py b/services/helper/helper_service/services/visibility_control/models/o_auth_grant_type.py new file mode 100644 index 0000000000000000000000000000000000000000..5536af0345da3cdfa0c37a6ae27b93436c8de862 --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/models/o_auth_grant_type.py @@ -0,0 +1,40 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from visibility_control.models.base_model import Model +from visibility_control import util + + +class OAuthGrantType(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + CLIENT_CREDENTIALS = 'CLIENT_CREDENTIALS' + AUTHORIZATION_CODE = 'AUTHORIZATION_CODE' + AUTHORIZATION_CODE_WITH_PKCE = 'AUTHORIZATION_CODE_WITH_PKCE' + def __init__(self): # noqa: E501 + """OAuthGrantType - a model defined in OpenAPI + + """ + self.openapi_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'OAuthGrantType': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The OAuthGrantType of this OAuthGrantType. # noqa: E501 + :rtype: OAuthGrantType + """ + return util.deserialize_model(dikt, cls) diff --git a/services/helper/helper_service/services/visibility_control/models/operation.py b/services/helper/helper_service/services/visibility_control/models/operation.py new file mode 100644 index 0000000000000000000000000000000000000000..3b06d35a9f21c6c1bdb34251cf5fbd2addd6015b --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/models/operation.py @@ -0,0 +1,42 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from visibility_control.models.base_model import Model +from visibility_control import util + + +class Operation(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + GET = 'GET' + POST = 'POST' + PUT = 'PUT' + PATCH = 'PATCH' + DELETE = 'DELETE' + def __init__(self): # noqa: E501 + """Operation - a model defined in OpenAPI + + """ + self.openapi_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'Operation': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The Operation of this Operation. # noqa: E501 + :rtype: Operation + """ + return util.deserialize_model(dikt, cls) diff --git a/services/helper/helper_service/services/visibility_control/models/patch_provider_selector.py b/services/helper/helper_service/services/visibility_control/models/patch_provider_selector.py new file mode 100644 index 0000000000000000000000000000000000000000..c5b83c5be65509c0015ff1a9c92c57bdc2b3623c --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/models/patch_provider_selector.py @@ -0,0 +1,147 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from visibility_control.models.base_model import Model +from visibility_control import util + + +class PatchProviderSelector(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, api_provider_id=None, api_name=None, api_id=None, aef_id=None): # noqa: E501 + """PatchProviderSelector - a model defined in OpenAPI + + :param api_provider_id: The api_provider_id of this PatchProviderSelector. # noqa: E501 + :type api_provider_id: list[str] + :param api_name: The api_name of this PatchProviderSelector. # noqa: E501 + :type api_name: list[str] + :param api_id: The api_id of this PatchProviderSelector. # noqa: E501 + :type api_id: list[str] + :param aef_id: The aef_id of this PatchProviderSelector. # noqa: E501 + :type aef_id: list[str] + """ + self.openapi_types = { + 'api_provider_id': list[str], + 'api_name': list[str], + 'api_id': list[str], + 'aef_id': list[str] + } + + self.attribute_map = { + 'api_provider_id': 'apiProviderId', + 'api_name': 'apiName', + 'api_id': 'apiId', + 'aef_id': 'aefId' + } + + self._api_provider_id = api_provider_id + self._api_name = api_name + self._api_id = api_id + self._aef_id = aef_id + + @classmethod + def from_dict(cls, dikt) -> 'PatchProviderSelector': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The PatchProviderSelector of this PatchProviderSelector. # noqa: E501 + :rtype: PatchProviderSelector + """ + return util.deserialize_model(dikt, cls) + + @property + def api_provider_id(self) -> list[str]: + """Gets the api_provider_id of this PatchProviderSelector. + + + :return: The api_provider_id of this PatchProviderSelector. + :rtype: list[str] + """ + return self._api_provider_id + + @api_provider_id.setter + def api_provider_id(self, api_provider_id: list[str]): + """Sets the api_provider_id of this PatchProviderSelector. + + + :param api_provider_id: The api_provider_id of this PatchProviderSelector. + :type api_provider_id: list[str] + """ + if api_provider_id is not None and len(api_provider_id) < 0: + raise ValueError("Invalid value for `api_provider_id`, number of items must be greater than or equal to `0`") # noqa: E501 + + self._api_provider_id = api_provider_id + + @property + def api_name(self) -> list[str]: + """Gets the api_name of this PatchProviderSelector. + + + :return: The api_name of this PatchProviderSelector. + :rtype: list[str] + """ + return self._api_name + + @api_name.setter + def api_name(self, api_name: list[str]): + """Sets the api_name of this PatchProviderSelector. + + + :param api_name: The api_name of this PatchProviderSelector. + :type api_name: list[str] + """ + if api_name is not None and len(api_name) < 0: + raise ValueError("Invalid value for `api_name`, number of items must be greater than or equal to `0`") # noqa: E501 + + self._api_name = api_name + + @property + def api_id(self) -> list[str]: + """Gets the api_id of this PatchProviderSelector. + + + :return: The api_id of this PatchProviderSelector. + :rtype: list[str] + """ + return self._api_id + + @api_id.setter + def api_id(self, api_id: list[str]): + """Sets the api_id of this PatchProviderSelector. + + + :param api_id: The api_id of this PatchProviderSelector. + :type api_id: list[str] + """ + if api_id is not None and len(api_id) < 0: + raise ValueError("Invalid value for `api_id`, number of items must be greater than or equal to `0`") # noqa: E501 + + self._api_id = api_id + + @property + def aef_id(self) -> list[str]: + """Gets the aef_id of this PatchProviderSelector. + + + :return: The aef_id of this PatchProviderSelector. + :rtype: list[str] + """ + return self._aef_id + + @aef_id.setter + def aef_id(self, aef_id: list[str]): + """Sets the aef_id of this PatchProviderSelector. + + + :param aef_id: The aef_id of this PatchProviderSelector. + :type aef_id: list[str] + """ + if aef_id is not None and len(aef_id) < 0: + raise ValueError("Invalid value for `aef_id`, number of items must be greater than or equal to `0`") # noqa: E501 + + self._aef_id = aef_id diff --git a/services/helper/helper_service/services/visibility_control/models/protocol.py b/services/helper/helper_service/services/visibility_control/models/protocol.py new file mode 100644 index 0000000000000000000000000000000000000000..ef8c55c7e4528f4628fea3e3fcbabf2e98f651b7 --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/models/protocol.py @@ -0,0 +1,41 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from visibility_control.models.base_model import Model +from visibility_control import util + + +class Protocol(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + HTTP_1_1 = 'HTTP_1_1' + HTTP_2 = 'HTTP_2' + MQTT = 'MQTT' + WEBSOCKET = 'WEBSOCKET' + def __init__(self): # noqa: E501 + """Protocol - a model defined in OpenAPI + + """ + self.openapi_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'Protocol': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The Protocol of this Protocol. # noqa: E501 + :rtype: Protocol + """ + return util.deserialize_model(dikt, cls) diff --git a/services/helper/helper_service/services/visibility_control/models/provider_selector.py b/services/helper/helper_service/services/visibility_control/models/provider_selector.py new file mode 100644 index 0000000000000000000000000000000000000000..975d96ccc47b59c17114546a908cb582bfe19c81 --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/models/provider_selector.py @@ -0,0 +1,177 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from visibility_control.models.base_model import Model +from visibility_control import util + + +class ProviderSelector(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, created_by_user=None, api_provider_id=None, api_name=None, api_id=None, aef_id=None): # noqa: E501 + """ProviderSelector - a model defined in OpenAPI + + :param created_by_user: The created_by_user of this ProviderSelector. # noqa: E501 + :type created_by_user: str + :param api_provider_id: The api_provider_id of this ProviderSelector. # noqa: E501 + :type api_provider_id: list[str] + :param api_name: The api_name of this ProviderSelector. # noqa: E501 + :type api_name: list[str] + :param api_id: The api_id of this ProviderSelector. # noqa: E501 + :type api_id: list[str] + :param aef_id: The aef_id of this ProviderSelector. # noqa: E501 + :type aef_id: list[str] + """ + self.openapi_types = { + 'created_by_user': str, + 'api_provider_id': list[str], + 'api_name': list[str], + 'api_id': list[str], + 'aef_id': list[str] + } + + self.attribute_map = { + 'created_by_user': 'createdByUser', + 'api_provider_id': 'apiProviderId', + 'api_name': 'apiName', + 'api_id': 'apiId', + 'aef_id': 'aefId' + } + + self._created_by_user = created_by_user + self._api_provider_id = api_provider_id + self._api_name = api_name + self._api_id = api_id + self._aef_id = aef_id + + @classmethod + def from_dict(cls, dikt) -> 'ProviderSelector': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The ProviderSelector of this ProviderSelector. # noqa: E501 + :rtype: ProviderSelector + """ + return util.deserialize_model(dikt, cls) + + @property + def created_by_user(self) -> str: + """Gets the created_by_user of this ProviderSelector. + + + :return: The created_by_user of this ProviderSelector. + :rtype: str + """ + return self._created_by_user + + @created_by_user.setter + def created_by_user(self, created_by_user: str): + """Sets the created_by_user of this ProviderSelector. + + + :param created_by_user: The created_by_user of this ProviderSelector. + :type created_by_user: str + """ + if created_by_user is None: + raise ValueError("Invalid value for `created_by_user`, must not be `None`") # noqa: E501 + if created_by_user is not None and len(created_by_user) < 1: + raise ValueError("Invalid value for `created_by_user`, length must be greater than or equal to `1`") # noqa: E501 + + self._created_by_user = created_by_user + + @property + def api_provider_id(self) -> list[str]: + """Gets the api_provider_id of this ProviderSelector. + + + :return: The api_provider_id of this ProviderSelector. + :rtype: list[str] + """ + return self._api_provider_id + + @api_provider_id.setter + def api_provider_id(self, api_provider_id: list[str]): + """Sets the api_provider_id of this ProviderSelector. + + + :param api_provider_id: The api_provider_id of this ProviderSelector. + :type api_provider_id: list[str] + """ + if api_provider_id is not None and len(api_provider_id) < 0: + raise ValueError("Invalid value for `api_provider_id`, number of items must be greater than or equal to `0`") # noqa: E501 + + self._api_provider_id = api_provider_id + + @property + def api_name(self) -> list[str]: + """Gets the api_name of this ProviderSelector. + + + :return: The api_name of this ProviderSelector. + :rtype: list[str] + """ + return self._api_name + + @api_name.setter + def api_name(self, api_name: list[str]): + """Sets the api_name of this ProviderSelector. + + + :param api_name: The api_name of this ProviderSelector. + :type api_name: list[str] + """ + if api_name is not None and len(api_name) < 0: + raise ValueError("Invalid value for `api_name`, number of items must be greater than or equal to `0`") # noqa: E501 + + self._api_name = api_name + + @property + def api_id(self) -> list[str]: + """Gets the api_id of this ProviderSelector. + + + :return: The api_id of this ProviderSelector. + :rtype: list[str] + """ + return self._api_id + + @api_id.setter + def api_id(self, api_id: list[str]): + """Sets the api_id of this ProviderSelector. + + + :param api_id: The api_id of this ProviderSelector. + :type api_id: list[str] + """ + if api_id is not None and len(api_id) < 0: + raise ValueError("Invalid value for `api_id`, number of items must be greater than or equal to `0`") # noqa: E501 + + self._api_id = api_id + + @property + def aef_id(self) -> list[str]: + """Gets the aef_id of this ProviderSelector. + + + :return: The aef_id of this ProviderSelector. + :rtype: list[str] + """ + return self._aef_id + + @aef_id.setter + def aef_id(self, aef_id: list[str]): + """Sets the aef_id of this ProviderSelector. + + + :param aef_id: The aef_id of this ProviderSelector. + :type aef_id: list[str] + """ + if aef_id is not None and len(aef_id) < 0: + raise ValueError("Invalid value for `aef_id`, number of items must be greater than or equal to `0`") # noqa: E501 + + self._aef_id = aef_id diff --git a/services/helper/helper_service/services/visibility_control/models/published_api_path.py b/services/helper/helper_service/services/visibility_control/models/published_api_path.py new file mode 100644 index 0000000000000000000000000000000000000000..629df63616004a7436354259b5e3c2e186164f89 --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/models/published_api_path.py @@ -0,0 +1,61 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from visibility_control.models.base_model import Model +from visibility_control import util + + +class PublishedApiPath(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, ccf_ids=None): # noqa: E501 + """PublishedApiPath - a model defined in OpenAPI + + :param ccf_ids: The ccf_ids of this PublishedApiPath. # noqa: E501 + :type ccf_ids: List[str] + """ + self.openapi_types = { + 'ccf_ids': List[str] + } + + self.attribute_map = { + 'ccf_ids': 'ccfIds' + } + + self._ccf_ids = ccf_ids + + @classmethod + def from_dict(cls, dikt) -> 'PublishedApiPath': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The PublishedApiPath of this PublishedApiPath. # noqa: E501 + :rtype: PublishedApiPath + """ + return util.deserialize_model(dikt, cls) + + @property + def ccf_ids(self) -> List[str]: + """Gets the ccf_ids of this PublishedApiPath. + + + :return: The ccf_ids of this PublishedApiPath. + :rtype: List[str] + """ + return self._ccf_ids + + @ccf_ids.setter + def ccf_ids(self, ccf_ids: List[str]): + """Sets the ccf_ids of this PublishedApiPath. + + + :param ccf_ids: The ccf_ids of this PublishedApiPath. + :type ccf_ids: List[str] + """ + + self._ccf_ids = ccf_ids diff --git a/services/helper/helper_service/services/visibility_control/models/resource.py b/services/helper/helper_service/services/visibility_control/models/resource.py new file mode 100644 index 0000000000000000000000000000000000000000..a7b3f90a158eefb1dab6e051ac92b77b9d703ec3 --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/models/resource.py @@ -0,0 +1,201 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from visibility_control.models.base_model import Model +from visibility_control.models.communication_type import CommunicationType +from visibility_control.models.operation import Operation +from visibility_control import util + +from visibility_control.models.communication_type import CommunicationType # noqa: E501 +from visibility_control.models.operation import Operation # noqa: E501 + +class Resource(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, resource_name=None, comm_type=None, uri=None, cust_op_name=None, operations=None, description=None): # noqa: E501 + """Resource - a model defined in OpenAPI + + :param resource_name: The resource_name of this Resource. # noqa: E501 + :type resource_name: str + :param comm_type: The comm_type of this Resource. # noqa: E501 + :type comm_type: CommunicationType + :param uri: The uri of this Resource. # noqa: E501 + :type uri: str + :param cust_op_name: The cust_op_name of this Resource. # noqa: E501 + :type cust_op_name: str + :param operations: The operations of this Resource. # noqa: E501 + :type operations: List[Operation] + :param description: The description of this Resource. # noqa: E501 + :type description: str + """ + self.openapi_types = { + 'resource_name': str, + 'comm_type': CommunicationType, + 'uri': str, + 'cust_op_name': str, + 'operations': List[Operation], + 'description': str + } + + self.attribute_map = { + 'resource_name': 'resourceName', + 'comm_type': 'commType', + 'uri': 'uri', + 'cust_op_name': 'custOpName', + 'operations': 'operations', + 'description': 'description' + } + + self._resource_name = resource_name + self._comm_type = comm_type + self._uri = uri + self._cust_op_name = cust_op_name + self._operations = operations + self._description = description + + @classmethod + def from_dict(cls, dikt) -> 'Resource': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The Resource of this Resource. # noqa: E501 + :rtype: Resource + """ + return util.deserialize_model(dikt, cls) + + @property + def resource_name(self) -> str: + """Gets the resource_name of this Resource. + + + :return: The resource_name of this Resource. + :rtype: str + """ + return self._resource_name + + @resource_name.setter + def resource_name(self, resource_name: str): + """Sets the resource_name of this Resource. + + + :param resource_name: The resource_name of this Resource. + :type resource_name: str + """ + if resource_name is None: + raise ValueError("Invalid value for `resource_name`, must not be `None`") # noqa: E501 + + self._resource_name = resource_name + + @property + def comm_type(self) -> CommunicationType: + """Gets the comm_type of this Resource. + + + :return: The comm_type of this Resource. + :rtype: CommunicationType + """ + return self._comm_type + + @comm_type.setter + def comm_type(self, comm_type: CommunicationType): + """Sets the comm_type of this Resource. + + + :param comm_type: The comm_type of this Resource. + :type comm_type: CommunicationType + """ + if comm_type is None: + raise ValueError("Invalid value for `comm_type`, must not be `None`") # noqa: E501 + + self._comm_type = comm_type + + @property + def uri(self) -> str: + """Gets the uri of this Resource. + + + :return: The uri of this Resource. + :rtype: str + """ + return self._uri + + @uri.setter + def uri(self, uri: str): + """Sets the uri of this Resource. + + + :param uri: The uri of this Resource. + :type uri: str + """ + if uri is None: + raise ValueError("Invalid value for `uri`, must not be `None`") # noqa: E501 + + self._uri = uri + + @property + def cust_op_name(self) -> str: + """Gets the cust_op_name of this Resource. + + + :return: The cust_op_name of this Resource. + :rtype: str + """ + return self._cust_op_name + + @cust_op_name.setter + def cust_op_name(self, cust_op_name: str): + """Sets the cust_op_name of this Resource. + + + :param cust_op_name: The cust_op_name of this Resource. + :type cust_op_name: str + """ + + self._cust_op_name = cust_op_name + + @property + def operations(self) -> List[Operation]: + """Gets the operations of this Resource. + + + :return: The operations of this Resource. + :rtype: List[Operation] + """ + return self._operations + + @operations.setter + def operations(self, operations: List[Operation]): + """Sets the operations of this Resource. + + + :param operations: The operations of this Resource. + :type operations: List[Operation] + """ + + self._operations = operations + + @property + def description(self) -> str: + """Gets the description of this Resource. + + + :return: The description of this Resource. + :rtype: str + """ + return self._description + + @description.setter + def description(self, description: str): + """Sets the description of this Resource. + + + :param description: The description of this Resource. + :type description: str + """ + + self._description = description diff --git a/services/helper/helper_service/services/visibility_control/models/rule.py b/services/helper/helper_service/services/visibility_control/models/rule.py new file mode 100644 index 0000000000000000000000000000000000000000..1aa6de1ce65cde263a8edcbacb59520d55209e47 --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/models/rule.py @@ -0,0 +1,309 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from visibility_control.models.base_model import Model +from visibility_control.models.invoker_selector import InvokerSelector +from visibility_control.models.provider_selector import ProviderSelector +from visibility_control import util + +from visibility_control.models.invoker_selector import InvokerSelector # noqa: E501 +from visibility_control.models.provider_selector import ProviderSelector # noqa: E501 + +class Rule(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, rule_id=None, provider_selector=None, invoker_exceptions=None, default_access=None, enabled=True, starts_at=None, ends_at=None, notes=None, updated_at=None, updated_by=None): # noqa: E501 + """Rule - a model defined in OpenAPI + + :param rule_id: The rule_id of this Rule. # noqa: E501 + :type rule_id: str + :param provider_selector: The provider_selector of this Rule. # noqa: E501 + :type provider_selector: ProviderSelector + :param invoker_exceptions: The invoker_exceptions of this Rule. # noqa: E501 + :type invoker_exceptions: InvokerSelector + :param default_access: The default_access of this Rule. # noqa: E501 + :type default_access: str + :param enabled: The enabled of this Rule. # noqa: E501 + :type enabled: bool + :param starts_at: The starts_at of this Rule. # noqa: E501 + :type starts_at: datetime + :param ends_at: The ends_at of this Rule. # noqa: E501 + :type ends_at: datetime + :param notes: The notes of this Rule. # noqa: E501 + :type notes: str + :param updated_at: The updated_at of this Rule. # noqa: E501 + :type updated_at: datetime + :param updated_by: The updated_by of this Rule. # noqa: E501 + :type updated_by: str + """ + self.openapi_types = { + 'rule_id': str, + 'provider_selector': ProviderSelector, + 'invoker_exceptions': InvokerSelector, + 'default_access': str, + 'enabled': bool, + 'starts_at': datetime, + 'ends_at': datetime, + 'notes': str, + 'updated_at': datetime, + 'updated_by': str + } + + self.attribute_map = { + 'rule_id': 'ruleId', + 'provider_selector': 'providerSelector', + 'invoker_exceptions': 'invokerExceptions', + 'default_access': 'default_access', + 'enabled': 'enabled', + 'starts_at': 'startsAt', + 'ends_at': 'endsAt', + 'notes': 'notes', + 'updated_at': 'updatedAt', + 'updated_by': 'updatedBy' + } + + self._rule_id = rule_id + self._provider_selector = provider_selector + self._invoker_exceptions = invoker_exceptions + self._default_access = default_access + self._enabled = enabled + self._starts_at = starts_at + self._ends_at = ends_at + self._notes = notes + self._updated_at = updated_at + self._updated_by = updated_by + + @classmethod + def from_dict(cls, dikt) -> 'Rule': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The Rule of this Rule. # noqa: E501 + :rtype: Rule + """ + return util.deserialize_model(dikt, cls) + + @property + def rule_id(self) -> str: + """Gets the rule_id of this Rule. + + + :return: The rule_id of this Rule. + :rtype: str + """ + return self._rule_id + + @rule_id.setter + def rule_id(self, rule_id: str): + """Sets the rule_id of this Rule. + + + :param rule_id: The rule_id of this Rule. + :type rule_id: str + """ + if rule_id is None: + raise ValueError("Invalid value for `rule_id`, must not be `None`") # noqa: E501 + + self._rule_id = rule_id + + @property + def provider_selector(self) -> ProviderSelector: + """Gets the provider_selector of this Rule. + + + :return: The provider_selector of this Rule. + :rtype: ProviderSelector + """ + return self._provider_selector + + @provider_selector.setter + def provider_selector(self, provider_selector: ProviderSelector): + """Sets the provider_selector of this Rule. + + + :param provider_selector: The provider_selector of this Rule. + :type provider_selector: ProviderSelector + """ + if provider_selector is None: + raise ValueError("Invalid value for `provider_selector`, must not be `None`") # noqa: E501 + + self._provider_selector = provider_selector + + @property + def invoker_exceptions(self) -> InvokerSelector: + """Gets the invoker_exceptions of this Rule. + + + :return: The invoker_exceptions of this Rule. + :rtype: InvokerSelector + """ + return self._invoker_exceptions + + @invoker_exceptions.setter + def invoker_exceptions(self, invoker_exceptions: InvokerSelector): + """Sets the invoker_exceptions of this Rule. + + + :param invoker_exceptions: The invoker_exceptions of this Rule. + :type invoker_exceptions: InvokerSelector + """ + + self._invoker_exceptions = invoker_exceptions + + @property + def default_access(self) -> str: + """Gets the default_access of this Rule. + + + :return: The default_access of this Rule. + :rtype: str + """ + return self._default_access + + @default_access.setter + def default_access(self, default_access: str): + """Sets the default_access of this Rule. + + + :param default_access: The default_access of this Rule. + :type default_access: str + """ + allowed_values = ["ALLOW", "DENY"] # noqa: E501 + if default_access not in allowed_values: + raise ValueError( + "Invalid value for `default_access` ({0}), must be one of {1}" + .format(default_access, allowed_values) + ) + + self._default_access = default_access + + @property + def enabled(self) -> bool: + """Gets the enabled of this Rule. + + + :return: The enabled of this Rule. + :rtype: bool + """ + return self._enabled + + @enabled.setter + def enabled(self, enabled: bool): + """Sets the enabled of this Rule. + + + :param enabled: The enabled of this Rule. + :type enabled: bool + """ + + self._enabled = enabled + + @property + def starts_at(self) -> datetime: + """Gets the starts_at of this Rule. + + + :return: The starts_at of this Rule. + :rtype: datetime + """ + return self._starts_at + + @starts_at.setter + def starts_at(self, starts_at: datetime): + """Sets the starts_at of this Rule. + + + :param starts_at: The starts_at of this Rule. + :type starts_at: datetime + """ + + self._starts_at = starts_at + + @property + def ends_at(self) -> datetime: + """Gets the ends_at of this Rule. + + + :return: The ends_at of this Rule. + :rtype: datetime + """ + return self._ends_at + + @ends_at.setter + def ends_at(self, ends_at: datetime): + """Sets the ends_at of this Rule. + + + :param ends_at: The ends_at of this Rule. + :type ends_at: datetime + """ + + self._ends_at = ends_at + + @property + def notes(self) -> str: + """Gets the notes of this Rule. + + + :return: The notes of this Rule. + :rtype: str + """ + return self._notes + + @notes.setter + def notes(self, notes: str): + """Sets the notes of this Rule. + + + :param notes: The notes of this Rule. + :type notes: str + """ + + self._notes = notes + + @property + def updated_at(self) -> datetime: + """Gets the updated_at of this Rule. + + + :return: The updated_at of this Rule. + :rtype: datetime + """ + return self._updated_at + + @updated_at.setter + def updated_at(self, updated_at: datetime): + """Sets the updated_at of this Rule. + + + :param updated_at: The updated_at of this Rule. + :type updated_at: datetime + """ + + self._updated_at = updated_at + + @property + def updated_by(self) -> str: + """Gets the updated_by of this Rule. + + + :return: The updated_by of this Rule. + :rtype: str + """ + return self._updated_by + + @updated_by.setter + def updated_by(self, updated_by: str): + """Sets the updated_by of this Rule. + + + :param updated_by: The updated_by of this Rule. + :type updated_by: str + """ + + self._updated_by = updated_by diff --git a/services/helper/helper_service/services/visibility_control/models/rule_create_request.py b/services/helper/helper_service/services/visibility_control/models/rule_create_request.py new file mode 100644 index 0000000000000000000000000000000000000000..76aa429cc8ac12941a0c21a52fc74d8950a56f94 --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/models/rule_create_request.py @@ -0,0 +1,229 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from visibility_control.models.base_model import Model +from visibility_control.models.invoker_selector import InvokerSelector +from visibility_control.models.provider_selector import ProviderSelector +from visibility_control import util + +from visibility_control.models.invoker_selector import InvokerSelector # noqa: E501 +from visibility_control.models.provider_selector import ProviderSelector # noqa: E501 + +class RuleCreateRequest(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, provider_selector=None, invoker_exceptions=None, default_access=None, enabled=True, starts_at=None, ends_at=None, notes=None): # noqa: E501 + """RuleCreateRequest - a model defined in OpenAPI + + :param provider_selector: The provider_selector of this RuleCreateRequest. # noqa: E501 + :type provider_selector: ProviderSelector + :param invoker_exceptions: The invoker_exceptions of this RuleCreateRequest. # noqa: E501 + :type invoker_exceptions: InvokerSelector + :param default_access: The default_access of this RuleCreateRequest. # noqa: E501 + :type default_access: str + :param enabled: The enabled of this RuleCreateRequest. # noqa: E501 + :type enabled: bool + :param starts_at: The starts_at of this RuleCreateRequest. # noqa: E501 + :type starts_at: datetime + :param ends_at: The ends_at of this RuleCreateRequest. # noqa: E501 + :type ends_at: datetime + :param notes: The notes of this RuleCreateRequest. # noqa: E501 + :type notes: str + """ + self.openapi_types = { + 'provider_selector': ProviderSelector, + 'invoker_exceptions': InvokerSelector, + 'default_access': str, + 'enabled': bool, + 'starts_at': datetime, + 'ends_at': datetime, + 'notes': str + } + + self.attribute_map = { + 'provider_selector': 'providerSelector', + 'invoker_exceptions': 'invokerExceptions', + 'default_access': 'default_access', + 'enabled': 'enabled', + 'starts_at': 'startsAt', + 'ends_at': 'endsAt', + 'notes': 'notes' + } + + self._provider_selector = provider_selector + self._invoker_exceptions = invoker_exceptions + self._default_access = default_access + self._enabled = enabled + self._starts_at = starts_at + self._ends_at = ends_at + self._notes = notes + + @classmethod + def from_dict(cls, dikt) -> 'RuleCreateRequest': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The RuleCreateRequest of this RuleCreateRequest. # noqa: E501 + :rtype: RuleCreateRequest + """ + return util.deserialize_model(dikt, cls) + + @property + def provider_selector(self) -> ProviderSelector: + """Gets the provider_selector of this RuleCreateRequest. + + + :return: The provider_selector of this RuleCreateRequest. + :rtype: ProviderSelector + """ + return self._provider_selector + + @provider_selector.setter + def provider_selector(self, provider_selector: ProviderSelector): + """Sets the provider_selector of this RuleCreateRequest. + + + :param provider_selector: The provider_selector of this RuleCreateRequest. + :type provider_selector: ProviderSelector + """ + if provider_selector is None: + raise ValueError("Invalid value for `provider_selector`, must not be `None`") # noqa: E501 + + self._provider_selector = provider_selector + + @property + def invoker_exceptions(self) -> InvokerSelector: + """Gets the invoker_exceptions of this RuleCreateRequest. + + + :return: The invoker_exceptions of this RuleCreateRequest. + :rtype: InvokerSelector + """ + return self._invoker_exceptions + + @invoker_exceptions.setter + def invoker_exceptions(self, invoker_exceptions: InvokerSelector): + """Sets the invoker_exceptions of this RuleCreateRequest. + + + :param invoker_exceptions: The invoker_exceptions of this RuleCreateRequest. + :type invoker_exceptions: InvokerSelector + """ + + self._invoker_exceptions = invoker_exceptions + + @property + def default_access(self) -> str: + """Gets the default_access of this RuleCreateRequest. + + + :return: The default_access of this RuleCreateRequest. + :rtype: str + """ + return self._default_access + + @default_access.setter + def default_access(self, default_access: str): + """Sets the default_access of this RuleCreateRequest. + + + :param default_access: The default_access of this RuleCreateRequest. + :type default_access: str + """ + allowed_values = ["ALLOW", "DENY"] # noqa: E501 + if default_access not in allowed_values: + raise ValueError( + "Invalid value for `default_access` ({0}), must be one of {1}" + .format(default_access, allowed_values) + ) + + self._default_access = default_access + + @property + def enabled(self) -> bool: + """Gets the enabled of this RuleCreateRequest. + + + :return: The enabled of this RuleCreateRequest. + :rtype: bool + """ + return self._enabled + + @enabled.setter + def enabled(self, enabled: bool): + """Sets the enabled of this RuleCreateRequest. + + + :param enabled: The enabled of this RuleCreateRequest. + :type enabled: bool + """ + + self._enabled = enabled + + @property + def starts_at(self) -> datetime: + """Gets the starts_at of this RuleCreateRequest. + + + :return: The starts_at of this RuleCreateRequest. + :rtype: datetime + """ + return self._starts_at + + @starts_at.setter + def starts_at(self, starts_at: datetime): + """Sets the starts_at of this RuleCreateRequest. + + + :param starts_at: The starts_at of this RuleCreateRequest. + :type starts_at: datetime + """ + + self._starts_at = starts_at + + @property + def ends_at(self) -> datetime: + """Gets the ends_at of this RuleCreateRequest. + + + :return: The ends_at of this RuleCreateRequest. + :rtype: datetime + """ + return self._ends_at + + @ends_at.setter + def ends_at(self, ends_at: datetime): + """Sets the ends_at of this RuleCreateRequest. + + + :param ends_at: The ends_at of this RuleCreateRequest. + :type ends_at: datetime + """ + + self._ends_at = ends_at + + @property + def notes(self) -> str: + """Gets the notes of this RuleCreateRequest. + + + :return: The notes of this RuleCreateRequest. + :rtype: str + """ + return self._notes + + @notes.setter + def notes(self, notes: str): + """Sets the notes of this RuleCreateRequest. + + + :param notes: The notes of this RuleCreateRequest. + :type notes: str + """ + + self._notes = notes diff --git a/services/helper/helper_service/services/visibility_control/models/rule_patch_request.py b/services/helper/helper_service/services/visibility_control/models/rule_patch_request.py new file mode 100644 index 0000000000000000000000000000000000000000..a53a0e6af2611cd76affdd212cfb548fb49d9545 --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/models/rule_patch_request.py @@ -0,0 +1,227 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from visibility_control.models.base_model import Model +from visibility_control.models.invoker_selector import InvokerSelector +from visibility_control.models.patch_provider_selector import PatchProviderSelector +from visibility_control import util + +from visibility_control.models.invoker_selector import InvokerSelector # noqa: E501 +from visibility_control.models.patch_provider_selector import PatchProviderSelector # noqa: E501 + +class RulePatchRequest(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, provider_selector=None, invoker_exceptions=None, default_access=None, enabled=None, starts_at=None, ends_at=None, notes=None): # noqa: E501 + """RulePatchRequest - a model defined in OpenAPI + + :param provider_selector: The provider_selector of this RulePatchRequest. # noqa: E501 + :type provider_selector: PatchProviderSelector + :param invoker_exceptions: The invoker_exceptions of this RulePatchRequest. # noqa: E501 + :type invoker_exceptions: InvokerSelector + :param default_access: The default_access of this RulePatchRequest. # noqa: E501 + :type default_access: str + :param enabled: The enabled of this RulePatchRequest. # noqa: E501 + :type enabled: bool + :param starts_at: The starts_at of this RulePatchRequest. # noqa: E501 + :type starts_at: datetime + :param ends_at: The ends_at of this RulePatchRequest. # noqa: E501 + :type ends_at: datetime + :param notes: The notes of this RulePatchRequest. # noqa: E501 + :type notes: str + """ + self.openapi_types = { + 'provider_selector': PatchProviderSelector, + 'invoker_exceptions': InvokerSelector, + 'default_access': str, + 'enabled': bool, + 'starts_at': datetime, + 'ends_at': datetime, + 'notes': str + } + + self.attribute_map = { + 'provider_selector': 'providerSelector', + 'invoker_exceptions': 'invokerExceptions', + 'default_access': 'default_access', + 'enabled': 'enabled', + 'starts_at': 'startsAt', + 'ends_at': 'endsAt', + 'notes': 'notes' + } + + self._provider_selector = provider_selector + self._invoker_exceptions = invoker_exceptions + self._default_access = default_access + self._enabled = enabled + self._starts_at = starts_at + self._ends_at = ends_at + self._notes = notes + + @classmethod + def from_dict(cls, dikt) -> 'RulePatchRequest': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The RulePatchRequest of this RulePatchRequest. # noqa: E501 + :rtype: RulePatchRequest + """ + return util.deserialize_model(dikt, cls) + + @property + def provider_selector(self) -> PatchProviderSelector: + """Gets the provider_selector of this RulePatchRequest. + + + :return: The provider_selector of this RulePatchRequest. + :rtype: PatchProviderSelector + """ + return self._provider_selector + + @provider_selector.setter + def provider_selector(self, provider_selector: PatchProviderSelector): + """Sets the provider_selector of this RulePatchRequest. + + + :param provider_selector: The provider_selector of this RulePatchRequest. + :type provider_selector: PatchProviderSelector + """ + + self._provider_selector = provider_selector + + @property + def invoker_exceptions(self) -> InvokerSelector: + """Gets the invoker_exceptions of this RulePatchRequest. + + + :return: The invoker_exceptions of this RulePatchRequest. + :rtype: InvokerSelector + """ + return self._invoker_exceptions + + @invoker_exceptions.setter + def invoker_exceptions(self, invoker_exceptions: InvokerSelector): + """Sets the invoker_exceptions of this RulePatchRequest. + + + :param invoker_exceptions: The invoker_exceptions of this RulePatchRequest. + :type invoker_exceptions: InvokerSelector + """ + + self._invoker_exceptions = invoker_exceptions + + @property + def default_access(self) -> str: + """Gets the default_access of this RulePatchRequest. + + + :return: The default_access of this RulePatchRequest. + :rtype: str + """ + return self._default_access + + @default_access.setter + def default_access(self, default_access: str): + """Sets the default_access of this RulePatchRequest. + + + :param default_access: The default_access of this RulePatchRequest. + :type default_access: str + """ + allowed_values = ["ALLOW", "DENY"] # noqa: E501 + if default_access not in allowed_values: + raise ValueError( + "Invalid value for `default_access` ({0}), must be one of {1}" + .format(default_access, allowed_values) + ) + + self._default_access = default_access + + @property + def enabled(self) -> bool: + """Gets the enabled of this RulePatchRequest. + + + :return: The enabled of this RulePatchRequest. + :rtype: bool + """ + return self._enabled + + @enabled.setter + def enabled(self, enabled: bool): + """Sets the enabled of this RulePatchRequest. + + + :param enabled: The enabled of this RulePatchRequest. + :type enabled: bool + """ + + self._enabled = enabled + + @property + def starts_at(self) -> datetime: + """Gets the starts_at of this RulePatchRequest. + + + :return: The starts_at of this RulePatchRequest. + :rtype: datetime + """ + return self._starts_at + + @starts_at.setter + def starts_at(self, starts_at: datetime): + """Sets the starts_at of this RulePatchRequest. + + + :param starts_at: The starts_at of this RulePatchRequest. + :type starts_at: datetime + """ + + self._starts_at = starts_at + + @property + def ends_at(self) -> datetime: + """Gets the ends_at of this RulePatchRequest. + + + :return: The ends_at of this RulePatchRequest. + :rtype: datetime + """ + return self._ends_at + + @ends_at.setter + def ends_at(self, ends_at: datetime): + """Sets the ends_at of this RulePatchRequest. + + + :param ends_at: The ends_at of this RulePatchRequest. + :type ends_at: datetime + """ + + self._ends_at = ends_at + + @property + def notes(self) -> str: + """Gets the notes of this RulePatchRequest. + + + :return: The notes of this RulePatchRequest. + :rtype: str + """ + return self._notes + + @notes.setter + def notes(self, notes: str): + """Sets the notes of this RulePatchRequest. + + + :param notes: The notes of this RulePatchRequest. + :type notes: str + """ + + self._notes = notes diff --git a/services/helper/helper_service/services/visibility_control/models/rules_get200_response.py b/services/helper/helper_service/services/visibility_control/models/rules_get200_response.py new file mode 100644 index 0000000000000000000000000000000000000000..28530b7b966ca848ce5257ea7d2f35407889844c --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/models/rules_get200_response.py @@ -0,0 +1,91 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from visibility_control.models.base_model import Model +from visibility_control.models.rule import Rule +from visibility_control import util + +from visibility_control.models.rule import Rule # noqa: E501 + +class RulesGet200Response(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, items=None, next_page_token=None): # noqa: E501 + """RulesGet200Response - a model defined in OpenAPI + + :param items: The items of this RulesGet200Response. # noqa: E501 + :type items: List[Rule] + :param next_page_token: The next_page_token of this RulesGet200Response. # noqa: E501 + :type next_page_token: str + """ + self.openapi_types = { + 'items': List[Rule], + 'next_page_token': str + } + + self.attribute_map = { + 'items': 'items', + 'next_page_token': 'nextPageToken' + } + + self._items = items + self._next_page_token = next_page_token + + @classmethod + def from_dict(cls, dikt) -> 'RulesGet200Response': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The _rules_get_200_response of this RulesGet200Response. # noqa: E501 + :rtype: RulesGet200Response + """ + return util.deserialize_model(dikt, cls) + + @property + def items(self) -> List[Rule]: + """Gets the items of this RulesGet200Response. + + + :return: The items of this RulesGet200Response. + :rtype: List[Rule] + """ + return self._items + + @items.setter + def items(self, items: List[Rule]): + """Sets the items of this RulesGet200Response. + + + :param items: The items of this RulesGet200Response. + :type items: List[Rule] + """ + if items is None: + raise ValueError("Invalid value for `items`, must not be `None`") # noqa: E501 + + self._items = items + + @property + def next_page_token(self) -> str: + """Gets the next_page_token of this RulesGet200Response. + + + :return: The next_page_token of this RulesGet200Response. + :rtype: str + """ + return self._next_page_token + + @next_page_token.setter + def next_page_token(self, next_page_token: str): + """Sets the next_page_token of this RulesGet200Response. + + + :param next_page_token: The next_page_token of this RulesGet200Response. + :type next_page_token: str + """ + + self._next_page_token = next_page_token diff --git a/services/helper/helper_service/services/visibility_control/models/security_method.py b/services/helper/helper_service/services/visibility_control/models/security_method.py new file mode 100644 index 0000000000000000000000000000000000000000..4ceae5bea67d70b19457ffbc6c6b9a65c23b0983 --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/models/security_method.py @@ -0,0 +1,40 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from visibility_control.models.base_model import Model +from visibility_control import util + + +class SecurityMethod(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + PSK = 'PSK' + PKI = 'PKI' + OAUTH = 'OAUTH' + def __init__(self): # noqa: E501 + """SecurityMethod - a model defined in OpenAPI + + """ + self.openapi_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'SecurityMethod': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The SecurityMethod of this SecurityMethod. # noqa: E501 + :rtype: SecurityMethod + """ + return util.deserialize_model(dikt, cls) diff --git a/services/helper/helper_service/services/visibility_control/models/service_api_description.py b/services/helper/helper_service/services/visibility_control/models/service_api_description.py new file mode 100644 index 0000000000000000000000000000000000000000..bbbb3a54fc0a0e913cb843384eb40fc4f1c94bc2 --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/models/service_api_description.py @@ -0,0 +1,365 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from visibility_control.models.base_model import Model +from visibility_control.models.aef_profile import AefProfile +from visibility_control.models.api_status import ApiStatus +from visibility_control.models.published_api_path import PublishedApiPath +from visibility_control.models.shareable_information import ShareableInformation +import re +from visibility_control import util + +from visibility_control.models.aef_profile import AefProfile # noqa: E501 +from visibility_control.models.api_status import ApiStatus # noqa: E501 +from visibility_control.models.published_api_path import PublishedApiPath # noqa: E501 +from visibility_control.models.shareable_information import ShareableInformation # noqa: E501 +import re # noqa: E501 + +class ServiceAPIDescription(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, api_name=None, api_id=None, api_status=None, aef_profiles=None, description=None, supported_features=None, shareable_info=None, service_api_category=None, api_supp_feats=None, pub_api_path=None, ccf_id=None, api_prov_name=None): # noqa: E501 + """ServiceAPIDescription - a model defined in OpenAPI + + :param api_name: The api_name of this ServiceAPIDescription. # noqa: E501 + :type api_name: str + :param api_id: The api_id of this ServiceAPIDescription. # noqa: E501 + :type api_id: str + :param api_status: The api_status of this ServiceAPIDescription. # noqa: E501 + :type api_status: ApiStatus + :param aef_profiles: The aef_profiles of this ServiceAPIDescription. # noqa: E501 + :type aef_profiles: List[AefProfile] + :param description: The description of this ServiceAPIDescription. # noqa: E501 + :type description: str + :param supported_features: The supported_features of this ServiceAPIDescription. # noqa: E501 + :type supported_features: str + :param shareable_info: The shareable_info of this ServiceAPIDescription. # noqa: E501 + :type shareable_info: ShareableInformation + :param service_api_category: The service_api_category of this ServiceAPIDescription. # noqa: E501 + :type service_api_category: str + :param api_supp_feats: The api_supp_feats of this ServiceAPIDescription. # noqa: E501 + :type api_supp_feats: str + :param pub_api_path: The pub_api_path of this ServiceAPIDescription. # noqa: E501 + :type pub_api_path: PublishedApiPath + :param ccf_id: The ccf_id of this ServiceAPIDescription. # noqa: E501 + :type ccf_id: str + :param api_prov_name: The api_prov_name of this ServiceAPIDescription. # noqa: E501 + :type api_prov_name: str + """ + self.openapi_types = { + 'api_name': str, + 'api_id': str, + 'api_status': ApiStatus, + 'aef_profiles': List[AefProfile], + 'description': str, + 'supported_features': str, + 'shareable_info': ShareableInformation, + 'service_api_category': str, + 'api_supp_feats': str, + 'pub_api_path': PublishedApiPath, + 'ccf_id': str, + 'api_prov_name': str + } + + self.attribute_map = { + 'api_name': 'apiName', + 'api_id': 'apiId', + 'api_status': 'apiStatus', + 'aef_profiles': 'aefProfiles', + 'description': 'description', + 'supported_features': 'supportedFeatures', + 'shareable_info': 'shareableInfo', + 'service_api_category': 'serviceAPICategory', + 'api_supp_feats': 'apiSuppFeats', + 'pub_api_path': 'pubApiPath', + 'ccf_id': 'ccfId', + 'api_prov_name': 'apiProvName' + } + + self._api_name = api_name + self._api_id = api_id + self._api_status = api_status + self._aef_profiles = aef_profiles + self._description = description + self._supported_features = supported_features + self._shareable_info = shareable_info + self._service_api_category = service_api_category + self._api_supp_feats = api_supp_feats + self._pub_api_path = pub_api_path + self._ccf_id = ccf_id + self._api_prov_name = api_prov_name + + @classmethod + def from_dict(cls, dikt) -> 'ServiceAPIDescription': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The ServiceAPIDescription of this ServiceAPIDescription. # noqa: E501 + :rtype: ServiceAPIDescription + """ + return util.deserialize_model(dikt, cls) + + @property + def api_name(self) -> str: + """Gets the api_name of this ServiceAPIDescription. + + + :return: The api_name of this ServiceAPIDescription. + :rtype: str + """ + return self._api_name + + @api_name.setter + def api_name(self, api_name: str): + """Sets the api_name of this ServiceAPIDescription. + + + :param api_name: The api_name of this ServiceAPIDescription. + :type api_name: str + """ + if api_name is None: + raise ValueError("Invalid value for `api_name`, must not be `None`") # noqa: E501 + + self._api_name = api_name + + @property + def api_id(self) -> str: + """Gets the api_id of this ServiceAPIDescription. + + + :return: The api_id of this ServiceAPIDescription. + :rtype: str + """ + return self._api_id + + @api_id.setter + def api_id(self, api_id: str): + """Sets the api_id of this ServiceAPIDescription. + + + :param api_id: The api_id of this ServiceAPIDescription. + :type api_id: str + """ + + self._api_id = api_id + + @property + def api_status(self) -> ApiStatus: + """Gets the api_status of this ServiceAPIDescription. + + + :return: The api_status of this ServiceAPIDescription. + :rtype: ApiStatus + """ + return self._api_status + + @api_status.setter + def api_status(self, api_status: ApiStatus): + """Sets the api_status of this ServiceAPIDescription. + + + :param api_status: The api_status of this ServiceAPIDescription. + :type api_status: ApiStatus + """ + + self._api_status = api_status + + @property + def aef_profiles(self) -> List[AefProfile]: + """Gets the aef_profiles of this ServiceAPIDescription. + + + :return: The aef_profiles of this ServiceAPIDescription. + :rtype: List[AefProfile] + """ + return self._aef_profiles + + @aef_profiles.setter + def aef_profiles(self, aef_profiles: List[AefProfile]): + """Sets the aef_profiles of this ServiceAPIDescription. + + + :param aef_profiles: The aef_profiles of this ServiceAPIDescription. + :type aef_profiles: List[AefProfile] + """ + if aef_profiles is not None and len(aef_profiles) < 1: + raise ValueError("Invalid value for `aef_profiles`, number of items must be greater than or equal to `1`") # noqa: E501 + + self._aef_profiles = aef_profiles + + @property + def description(self) -> str: + """Gets the description of this ServiceAPIDescription. + + + :return: The description of this ServiceAPIDescription. + :rtype: str + """ + return self._description + + @description.setter + def description(self, description: str): + """Sets the description of this ServiceAPIDescription. + + + :param description: The description of this ServiceAPIDescription. + :type description: str + """ + + self._description = description + + @property + def supported_features(self) -> str: + """Gets the supported_features of this ServiceAPIDescription. + + + :return: The supported_features of this ServiceAPIDescription. + :rtype: str + """ + return self._supported_features + + @supported_features.setter + def supported_features(self, supported_features: str): + """Sets the supported_features of this ServiceAPIDescription. + + + :param supported_features: The supported_features of this ServiceAPIDescription. + :type supported_features: str + """ + if supported_features is not None and not re.search(r'^[A-Fa-f0-9]*$', supported_features): # noqa: E501 + raise ValueError(r"Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + + self._supported_features = supported_features + + @property + def shareable_info(self) -> ShareableInformation: + """Gets the shareable_info of this ServiceAPIDescription. + + + :return: The shareable_info of this ServiceAPIDescription. + :rtype: ShareableInformation + """ + return self._shareable_info + + @shareable_info.setter + def shareable_info(self, shareable_info: ShareableInformation): + """Sets the shareable_info of this ServiceAPIDescription. + + + :param shareable_info: The shareable_info of this ServiceAPIDescription. + :type shareable_info: ShareableInformation + """ + + self._shareable_info = shareable_info + + @property + def service_api_category(self) -> str: + """Gets the service_api_category of this ServiceAPIDescription. + + + :return: The service_api_category of this ServiceAPIDescription. + :rtype: str + """ + return self._service_api_category + + @service_api_category.setter + def service_api_category(self, service_api_category: str): + """Sets the service_api_category of this ServiceAPIDescription. + + + :param service_api_category: The service_api_category of this ServiceAPIDescription. + :type service_api_category: str + """ + + self._service_api_category = service_api_category + + @property + def api_supp_feats(self) -> str: + """Gets the api_supp_feats of this ServiceAPIDescription. + + + :return: The api_supp_feats of this ServiceAPIDescription. + :rtype: str + """ + return self._api_supp_feats + + @api_supp_feats.setter + def api_supp_feats(self, api_supp_feats: str): + """Sets the api_supp_feats of this ServiceAPIDescription. + + + :param api_supp_feats: The api_supp_feats of this ServiceAPIDescription. + :type api_supp_feats: str + """ + if api_supp_feats is not None and not re.search(r'^[A-Fa-f0-9]*$', api_supp_feats): # noqa: E501 + raise ValueError(r"Invalid value for `api_supp_feats`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501 + + self._api_supp_feats = api_supp_feats + + @property + def pub_api_path(self) -> PublishedApiPath: + """Gets the pub_api_path of this ServiceAPIDescription. + + + :return: The pub_api_path of this ServiceAPIDescription. + :rtype: PublishedApiPath + """ + return self._pub_api_path + + @pub_api_path.setter + def pub_api_path(self, pub_api_path: PublishedApiPath): + """Sets the pub_api_path of this ServiceAPIDescription. + + + :param pub_api_path: The pub_api_path of this ServiceAPIDescription. + :type pub_api_path: PublishedApiPath + """ + + self._pub_api_path = pub_api_path + + @property + def ccf_id(self) -> str: + """Gets the ccf_id of this ServiceAPIDescription. + + + :return: The ccf_id of this ServiceAPIDescription. + :rtype: str + """ + return self._ccf_id + + @ccf_id.setter + def ccf_id(self, ccf_id: str): + """Sets the ccf_id of this ServiceAPIDescription. + + + :param ccf_id: The ccf_id of this ServiceAPIDescription. + :type ccf_id: str + """ + + self._ccf_id = ccf_id + + @property + def api_prov_name(self) -> str: + """Gets the api_prov_name of this ServiceAPIDescription. + + + :return: The api_prov_name of this ServiceAPIDescription. + :rtype: str + """ + return self._api_prov_name + + @api_prov_name.setter + def api_prov_name(self, api_prov_name: str): + """Sets the api_prov_name of this ServiceAPIDescription. + + + :param api_prov_name: The api_prov_name of this ServiceAPIDescription. + :type api_prov_name: str + """ + + self._api_prov_name = api_prov_name diff --git a/services/helper/helper_service/services/visibility_control/models/service_kpis.py b/services/helper/helper_service/services/visibility_control/models/service_kpis.py new file mode 100644 index 0000000000000000000000000000000000000000..16abcd926c2428816b59ad1d9f6ec63f80cce066 --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/models/service_kpis.py @@ -0,0 +1,191 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from visibility_control.models.base_model import Model +from visibility_control import util + + +class ServiceKpis(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, max_req_rate=None, max_restime=None, availability=None, aval_comp=None, aval_mem=None, aval_stor=None): # noqa: E501 + """ServiceKpis - a model defined in OpenAPI + + :param max_req_rate: The max_req_rate of this ServiceKpis. # noqa: E501 + :type max_req_rate: int + :param max_restime: The max_restime of this ServiceKpis. # noqa: E501 + :type max_restime: int + :param availability: The availability of this ServiceKpis. # noqa: E501 + :type availability: int + :param aval_comp: The aval_comp of this ServiceKpis. # noqa: E501 + :type aval_comp: str + :param aval_mem: The aval_mem of this ServiceKpis. # noqa: E501 + :type aval_mem: str + :param aval_stor: The aval_stor of this ServiceKpis. # noqa: E501 + :type aval_stor: str + """ + self.openapi_types = { + 'max_req_rate': int, + 'max_restime': int, + 'availability': int, + 'aval_comp': str, + 'aval_mem': str, + 'aval_stor': str + } + + self.attribute_map = { + 'max_req_rate': 'maxReqRate', + 'max_restime': 'maxRestime', + 'availability': 'availability', + 'aval_comp': 'avalComp', + 'aval_mem': 'avalMem', + 'aval_stor': 'avalStor' + } + + self._max_req_rate = max_req_rate + self._max_restime = max_restime + self._availability = availability + self._aval_comp = aval_comp + self._aval_mem = aval_mem + self._aval_stor = aval_stor + + @classmethod + def from_dict(cls, dikt) -> 'ServiceKpis': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The ServiceKpis of this ServiceKpis. # noqa: E501 + :rtype: ServiceKpis + """ + return util.deserialize_model(dikt, cls) + + @property + def max_req_rate(self) -> int: + """Gets the max_req_rate of this ServiceKpis. + + + :return: The max_req_rate of this ServiceKpis. + :rtype: int + """ + return self._max_req_rate + + @max_req_rate.setter + def max_req_rate(self, max_req_rate: int): + """Sets the max_req_rate of this ServiceKpis. + + + :param max_req_rate: The max_req_rate of this ServiceKpis. + :type max_req_rate: int + """ + + self._max_req_rate = max_req_rate + + @property + def max_restime(self) -> int: + """Gets the max_restime of this ServiceKpis. + + + :return: The max_restime of this ServiceKpis. + :rtype: int + """ + return self._max_restime + + @max_restime.setter + def max_restime(self, max_restime: int): + """Sets the max_restime of this ServiceKpis. + + + :param max_restime: The max_restime of this ServiceKpis. + :type max_restime: int + """ + + self._max_restime = max_restime + + @property + def availability(self) -> int: + """Gets the availability of this ServiceKpis. + + + :return: The availability of this ServiceKpis. + :rtype: int + """ + return self._availability + + @availability.setter + def availability(self, availability: int): + """Sets the availability of this ServiceKpis. + + + :param availability: The availability of this ServiceKpis. + :type availability: int + """ + + self._availability = availability + + @property + def aval_comp(self) -> str: + """Gets the aval_comp of this ServiceKpis. + + + :return: The aval_comp of this ServiceKpis. + :rtype: str + """ + return self._aval_comp + + @aval_comp.setter + def aval_comp(self, aval_comp: str): + """Sets the aval_comp of this ServiceKpis. + + + :param aval_comp: The aval_comp of this ServiceKpis. + :type aval_comp: str + """ + + self._aval_comp = aval_comp + + @property + def aval_mem(self) -> str: + """Gets the aval_mem of this ServiceKpis. + + + :return: The aval_mem of this ServiceKpis. + :rtype: str + """ + return self._aval_mem + + @aval_mem.setter + def aval_mem(self, aval_mem: str): + """Sets the aval_mem of this ServiceKpis. + + + :param aval_mem: The aval_mem of this ServiceKpis. + :type aval_mem: str + """ + + self._aval_mem = aval_mem + + @property + def aval_stor(self) -> str: + """Gets the aval_stor of this ServiceKpis. + + + :return: The aval_stor of this ServiceKpis. + :rtype: str + """ + return self._aval_stor + + @aval_stor.setter + def aval_stor(self, aval_stor: str): + """Sets the aval_stor of this ServiceKpis. + + + :param aval_stor: The aval_stor of this ServiceKpis. + :type aval_stor: str + """ + + self._aval_stor = aval_stor diff --git a/services/helper/helper_service/services/visibility_control/models/shareable_information.py b/services/helper/helper_service/services/visibility_control/models/shareable_information.py new file mode 100644 index 0000000000000000000000000000000000000000..997f424a7f129b292dd4623267504cf4e5f4c2ad --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/models/shareable_information.py @@ -0,0 +1,89 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from visibility_control.models.base_model import Model +from visibility_control import util + + +class ShareableInformation(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, is_shareable=None, capif_prov_doms=None): # noqa: E501 + """ShareableInformation - a model defined in OpenAPI + + :param is_shareable: The is_shareable of this ShareableInformation. # noqa: E501 + :type is_shareable: bool + :param capif_prov_doms: The capif_prov_doms of this ShareableInformation. # noqa: E501 + :type capif_prov_doms: List[str] + """ + self.openapi_types = { + 'is_shareable': bool, + 'capif_prov_doms': List[str] + } + + self.attribute_map = { + 'is_shareable': 'isShareable', + 'capif_prov_doms': 'capifProvDoms' + } + + self._is_shareable = is_shareable + self._capif_prov_doms = capif_prov_doms + + @classmethod + def from_dict(cls, dikt) -> 'ShareableInformation': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The ShareableInformation of this ShareableInformation. # noqa: E501 + :rtype: ShareableInformation + """ + return util.deserialize_model(dikt, cls) + + @property + def is_shareable(self) -> bool: + """Gets the is_shareable of this ShareableInformation. + + + :return: The is_shareable of this ShareableInformation. + :rtype: bool + """ + return self._is_shareable + + @is_shareable.setter + def is_shareable(self, is_shareable: bool): + """Sets the is_shareable of this ShareableInformation. + + + :param is_shareable: The is_shareable of this ShareableInformation. + :type is_shareable: bool + """ + if is_shareable is None: + raise ValueError("Invalid value for `is_shareable`, must not be `None`") # noqa: E501 + + self._is_shareable = is_shareable + + @property + def capif_prov_doms(self) -> List[str]: + """Gets the capif_prov_doms of this ShareableInformation. + + + :return: The capif_prov_doms of this ShareableInformation. + :rtype: List[str] + """ + return self._capif_prov_doms + + @capif_prov_doms.setter + def capif_prov_doms(self, capif_prov_doms: List[str]): + """Sets the capif_prov_doms of this ShareableInformation. + + + :param capif_prov_doms: The capif_prov_doms of this ShareableInformation. + :type capif_prov_doms: List[str] + """ + + self._capif_prov_doms = capif_prov_doms diff --git a/services/helper/helper_service/services/visibility_control/models/version.py b/services/helper/helper_service/services/visibility_control/models/version.py new file mode 100644 index 0000000000000000000000000000000000000000..5752d1cf92856544867759fa73987b2564eda1d4 --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/models/version.py @@ -0,0 +1,145 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from visibility_control.models.base_model import Model +from visibility_control.models.custom_operation import CustomOperation +from visibility_control.models.resource import Resource +from visibility_control import util + +from visibility_control.models.custom_operation import CustomOperation # noqa: E501 +from visibility_control.models.resource import Resource # noqa: E501 + +class Version(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, api_version=None, expiry=None, resources=None, cust_operations=None): # noqa: E501 + """Version - a model defined in OpenAPI + + :param api_version: The api_version of this Version. # noqa: E501 + :type api_version: str + :param expiry: The expiry of this Version. # noqa: E501 + :type expiry: datetime + :param resources: The resources of this Version. # noqa: E501 + :type resources: List[Resource] + :param cust_operations: The cust_operations of this Version. # noqa: E501 + :type cust_operations: List[CustomOperation] + """ + self.openapi_types = { + 'api_version': str, + 'expiry': datetime, + 'resources': List[Resource], + 'cust_operations': List[CustomOperation] + } + + self.attribute_map = { + 'api_version': 'apiVersion', + 'expiry': 'expiry', + 'resources': 'resources', + 'cust_operations': 'custOperations' + } + + self._api_version = api_version + self._expiry = expiry + self._resources = resources + self._cust_operations = cust_operations + + @classmethod + def from_dict(cls, dikt) -> 'Version': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The Version of this Version. # noqa: E501 + :rtype: Version + """ + return util.deserialize_model(dikt, cls) + + @property + def api_version(self) -> str: + """Gets the api_version of this Version. + + + :return: The api_version of this Version. + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version: str): + """Sets the api_version of this Version. + + + :param api_version: The api_version of this Version. + :type api_version: str + """ + if api_version is None: + raise ValueError("Invalid value for `api_version`, must not be `None`") # noqa: E501 + + self._api_version = api_version + + @property + def expiry(self) -> datetime: + """Gets the expiry of this Version. + + + :return: The expiry of this Version. + :rtype: datetime + """ + return self._expiry + + @expiry.setter + def expiry(self, expiry: datetime): + """Sets the expiry of this Version. + + + :param expiry: The expiry of this Version. + :type expiry: datetime + """ + + self._expiry = expiry + + @property + def resources(self) -> List[Resource]: + """Gets the resources of this Version. + + + :return: The resources of this Version. + :rtype: List[Resource] + """ + return self._resources + + @resources.setter + def resources(self, resources: List[Resource]): + """Sets the resources of this Version. + + + :param resources: The resources of this Version. + :type resources: List[Resource] + """ + + self._resources = resources + + @property + def cust_operations(self) -> List[CustomOperation]: + """Gets the cust_operations of this Version. + + + :return: The cust_operations of this Version. + :rtype: List[CustomOperation] + """ + return self._cust_operations + + @cust_operations.setter + def cust_operations(self, cust_operations: List[CustomOperation]): + """Sets the cust_operations of this Version. + + + :param cust_operations: The cust_operations of this Version. + :type cust_operations: List[CustomOperation] + """ + + self._cust_operations = cust_operations diff --git a/services/helper/helper_service/services/visibility_control/openapi/openapi.yaml b/services/helper/helper_service/services/visibility_control/openapi/openapi.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1ca091427c259dc6d2783a0de9ff1b21cfc0b69b --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/openapi/openapi.yaml @@ -0,0 +1,1953 @@ +openapi: 3.0.3 +info: + description: | + Visibility control API manages visibility rules and evaluate decisions for API discovery and + security-context access within OpenCAPIF. This API controls whether APIs are visible to invokers + (discovery) and whether invokers are allowed to create a security context to access them. + - Rules are global and evaluated with "more specific wins" precedence. + - If no rule matches, the decision uses OpenCAPIF's global default (outside this API). + - Provider selector is mandatory in rules and must contain at least one selector field (userName is mandatory). + title: OpenCAPIF Visibility Control + version: 1.0.0 +# servers: +# - description: Production +# url: https://capif.example.com/access-control +# - description: Sandbox +# url: https://sandbox.capif.example.com/access-control +servers: +- url: "{apiRoot}/visibility-control" + variables: + apiRoot: + default: http://localhost:8080 + description: Base URL of the Helper service. +tags: +- description: Manage visibility rules + name: Rules +- description: Evaluate discovery and access decisions + name: Decision +paths: + /decision/invokers/{apiInvokerId}/discoverable-apis: + get: + description: | + Returns a filtered list of APIs for the API Invoker. + operationId: decision_invokers_api_invoker_id_discoverable_apis_get + parameters: + - description: CAPIF API Invoker identifier + explode: false + in: path + name: apiInvokerId + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DiscoveredAPIs' + description: Discover filter + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Invalid input + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Invoker not found (optional behavior) + summary: Get discoverable APIs filter for an invoker (global scope) + tags: + - Decision + x-openapi-router-controller: visibility_control.controllers.decision_controller + /rules: + get: + operationId: rules_get + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/_rules_get_200_response' + description: List of rules + summary: List rules + tags: + - Rules + x-openapi-router-controller: visibility_control.controllers.rules_controller + post: + description: Server generates the ruleId. Provider selector must include at + least one field. + operationId: rules_post + requestBody: + content: + application/json: + examples: + allow_except_some_invokers: + value: + providerSelector: + userName: userA + apiProviderId: + - capif-prov-01 + - capif-prov-02 + apiName: + - apiName-001 + apiId: + - apiId-001 + aefId: + - aef-001 + invokerExceptions: + apiInvokerId: + - invk-123 + - invk-999 + default_access: ALLOW + enabled: true + schema: + $ref: '#/components/schemas/RuleCreateRequest' + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/Rule' + description: Rule created + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Invalid input + summary: Create a rule + tags: + - Rules + x-openapi-router-controller: visibility_control.controllers.rules_controller + /rules/{ruleId}: + delete: + operationId: rules_rule_id_delete + parameters: + - description: Server-generated rule identifier + explode: false + in: path + name: ruleId + required: true + schema: + type: string + style: simple + responses: + "204": + description: Deleted + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Rule not found + summary: Delete a rule + tags: + - Rules + x-openapi-router-controller: visibility_control.controllers.rules_controller + get: + operationId: rules_rule_id_get + parameters: + - description: Server-generated rule identifier + explode: false + in: path + name: ruleId + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Rule' + description: Rule + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Rule not found + summary: Get a rule + tags: + - Rules + x-openapi-router-controller: visibility_control.controllers.rules_controller + patch: + operationId: rules_rule_id_patch + parameters: + - description: Server-generated rule identifier + explode: false + in: path + name: ruleId + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RulePatchRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Rule' + description: Rule updated + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Invalid input + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Rule not found + summary: Update a rule (partial) + tags: + - Rules + x-openapi-router-controller: visibility_control.controllers.rules_controller +components: + parameters: + RuleId: + description: Server-generated rule identifier + explode: false + in: path + name: ruleId + required: true + schema: + type: string + style: simple + ApiInvokerId: + description: CAPIF API Invoker identifier + explode: false + in: path + name: apiInvokerId + required: true + schema: + type: string + style: simple + schemas: + RuleCreateRequest: + description: | + Create a new rule. Provider selector is mandatory and must include at least one field. + If both startsAt and endsAt are present, endsAt must be greater than startsAt. + example: + default_access: ALLOW + notes: notes + startsAt: 2000-01-23T04:56:07.000+00:00 + invokerExceptions: + invokerOnboardedByUser: + - invokerOnboardedByUser + - invokerOnboardedByUser + apiInvokerId: + - apiInvokerId + - apiInvokerId + providerSelector: + apiProviderId: + - apiProviderId + - apiProviderId + apiName: + - apiName + - apiName + userName: + - userName + aefId: + - aefId + - aefId + apiId: + - apiId + - apiId + endsAt: 2000-01-23T04:56:07.000+00:00 + enabled: true + properties: + providerSelector: + $ref: '#/components/schemas/ProviderSelector' + invokerExceptions: + $ref: '#/components/schemas/InvokerSelector' + default_access: + enum: + - ALLOW + - DENY + title: default_access + type: string + enabled: + default: true + title: enabled + type: boolean + startsAt: + format: date-time + title: startsAt + type: string + endsAt: + format: date-time + title: endsAt + type: string + notes: + title: notes + type: string + required: + - default_access + - providerSelector + title: RuleCreateRequest + type: object + RulePatchRequest: + description: Partial update. Any omitted field remains unchanged. + example: + default_access: ALLOW + notes: notes + startsAt: 2000-01-23T04:56:07.000+00:00 + invokerExceptions: + invokerOnboardedByUser: + - invokerOnboardedByUser + - invokerOnboardedByUser + apiInvokerId: + - apiInvokerId + - apiInvokerId + providerSelector: + apiProviderId: + - apiProviderId + - apiProviderId + apiName: + - apiName + - apiName + aefId: + - aefId + - aefId + apiId: + - apiId + - apiId + endsAt: 2000-01-23T04:56:07.000+00:00 + enabled: true + properties: + providerSelector: + $ref: '#/components/schemas/PatchProviderSelector' + invokerExceptions: + $ref: '#/components/schemas/InvokerSelector' + default_access: + enum: + - ALLOW + - DENY + title: default_access + type: string + enabled: + title: enabled + type: boolean + startsAt: + format: date-time + title: startsAt + type: string + endsAt: + format: date-time + title: endsAt + type: string + notes: + title: notes + type: string + title: RulePatchRequest + type: object + Rule: + example: + default_access: ALLOW + notes: notes + updatedBy: updatedBy + startsAt: 2000-01-23T04:56:07.000+00:00 + invokerExceptions: + invokerOnboardedByUser: + - invokerOnboardedByUser + - invokerOnboardedByUser + apiInvokerId: + - apiInvokerId + - apiInvokerId + providerSelector: + apiProviderId: + - apiProviderId + - apiProviderId + apiName: + - apiName + - apiName + userName: + - userName + aefId: + - aefId + - aefId + apiId: + - apiId + - apiId + ruleId: ruleId + endsAt: 2000-01-23T04:56:07.000+00:00 + enabled: true + updatedAt: 2000-01-23T04:56:07.000+00:00 + properties: + ruleId: + title: ruleId + type: string + providerSelector: + $ref: '#/components/schemas/ProviderSelector' + invokerExceptions: + $ref: '#/components/schemas/InvokerSelector' + default_access: + enum: + - ALLOW + - DENY + title: default_access + type: string + enabled: + default: true + title: enabled + type: boolean + startsAt: + format: date-time + title: startsAt + type: string + endsAt: + format: date-time + title: endsAt + type: string + notes: + title: notes + type: string + updatedAt: + format: date-time + title: updatedAt + type: string + updatedBy: + title: updatedBy + type: string + required: + - default_access + - providerSelector + - ruleId + title: Rule + type: object + PatchProviderSelector: + additionalProperties: false + description: | + Patch Provider-side selector. + example: + apiProviderId: + - apiProviderId + - apiProviderId + apiName: + - apiName + - apiName + aefId: + - aefId + - aefId + apiId: + - apiId + - apiId + userName: + - userName + properties: + userName: + minLength: 1 + title: userName + type: string + apiProviderId: + items: + type: string + minItems: 0 + title: apiProviderId + type: array + uniqueItems: true + apiName: + items: + type: string + minItems: 0 + title: apiName + type: array + uniqueItems: true + apiId: + items: + type: string + minItems: 0 + title: apiId + type: array + uniqueItems: true + aefId: + items: + type: string + minItems: 0 + title: aefId + type: array + uniqueItems: true + title: PatchProviderSelector + type: object + ProviderSelector: + additionalProperties: false + description: | + Provider-side selector. Arrays apply OR within the field; AND across fields. + At least one of these fields must be present. + example: + apiProviderId: + - apiProviderId + - apiProviderId + apiName: + - apiName + - apiName + userName: + - userName + aefId: + - aefId + - aefId + apiId: + - apiId + - apiId + properties: + userName: + minLength: 1 + title: userName + type: string + apiProviderId: + items: + type: string + minItems: 0 + title: apiProviderId + type: array + uniqueItems: true + apiName: + items: + type: string + minItems: 0 + title: apiName + type: array + uniqueItems: true + apiId: + items: + type: string + minItems: 0 + title: apiId + type: array + uniqueItems: true + aefId: + items: + type: string + minItems: 0 + title: aefId + type: array + uniqueItems: true + required: + - userName + title: ProviderSelector + type: object + InvokerSelector: + additionalProperties: false + description: Invoker-side selector used for exceptions. Optional; arrays use + OR within the field; AND across fields. + example: + invokerOnboardedByUser: + - invokerOnboardedByUser + - invokerOnboardedByUser + apiInvokerId: + - apiInvokerId + - apiInvokerId + properties: + invokerOnboardedByUser: + items: + type: string + minItems: 0 + title: invokerOnboardedByUser + type: array + uniqueItems: true + apiInvokerId: + items: + type: string + minItems: 0 + title: apiInvokerId + type: array + uniqueItems: true + title: InvokerSelector + type: object + DiscoveredAPIs: + example: + serviceAPIDescriptions: + - serviceAPICategory: serviceAPICategory + ccfId: ccfId + apiName: apiName + shareableInfo: + capifProvDoms: + - capifProvDoms + - capifProvDoms + isShareable: true + apiProvName: apiProvName + supportedFeatures: supportedFeatures + description: description + apiSuppFeats: apiSuppFeats + apiId: apiId + apiStatus: + aefIds: + - aefIds + - aefIds + aefProfiles: + - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS + ueIpRange: + ueIpv4AddrRanges: + - start: start + end: end + - start: start + end: end + securityMethods: + - PSK + - PSK + versions: + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + dataFormat: JSON + domainName: domainName + aefLocation: + dcId: dcId + aefId: aefId + interfaceDescriptions: + - ipv6Addr: ipv6Addr + grantTypes: + - null + - null + securityMethods: + - null + - null + fqdn: fqdn + port: 0 + apiPrefix: apiPrefix + ipv4Addr: ipv4Addr + - ipv6Addr: ipv6Addr + grantTypes: + - null + - null + securityMethods: + - null + - null + fqdn: fqdn + port: 0 + apiPrefix: apiPrefix + ipv4Addr: ipv4Addr + serviceKpis: + avalMem: avalMem + avalStor: avalStor + avalComp: avalComp + maxRestime: 1 + availability: 5 + maxReqRate: 6 + - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS + ueIpRange: + ueIpv4AddrRanges: + - start: start + end: end + - start: start + end: end + securityMethods: + - PSK + - PSK + versions: + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + dataFormat: JSON + domainName: domainName + aefLocation: + dcId: dcId + aefId: aefId + interfaceDescriptions: + - ipv6Addr: ipv6Addr + grantTypes: + - null + - null + securityMethods: + - null + - null + fqdn: fqdn + port: 0 + apiPrefix: apiPrefix + ipv4Addr: ipv4Addr + - ipv6Addr: ipv6Addr + grantTypes: + - null + - null + securityMethods: + - null + - null + fqdn: fqdn + port: 0 + apiPrefix: apiPrefix + ipv4Addr: ipv4Addr + serviceKpis: + avalMem: avalMem + avalStor: avalStor + avalComp: avalComp + maxRestime: 1 + availability: 5 + maxReqRate: 6 + pubApiPath: + ccfIds: + - ccfIds + - ccfIds + - serviceAPICategory: serviceAPICategory + ccfId: ccfId + apiName: apiName + shareableInfo: + capifProvDoms: + - capifProvDoms + - capifProvDoms + isShareable: true + apiProvName: apiProvName + supportedFeatures: supportedFeatures + description: description + apiSuppFeats: apiSuppFeats + apiId: apiId + apiStatus: + aefIds: + - aefIds + - aefIds + aefProfiles: + - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS + ueIpRange: + ueIpv4AddrRanges: + - start: start + end: end + - start: start + end: end + securityMethods: + - PSK + - PSK + versions: + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + dataFormat: JSON + domainName: domainName + aefLocation: + dcId: dcId + aefId: aefId + interfaceDescriptions: + - ipv6Addr: ipv6Addr + grantTypes: + - null + - null + securityMethods: + - null + - null + fqdn: fqdn + port: 0 + apiPrefix: apiPrefix + ipv4Addr: ipv4Addr + - ipv6Addr: ipv6Addr + grantTypes: + - null + - null + securityMethods: + - null + - null + fqdn: fqdn + port: 0 + apiPrefix: apiPrefix + ipv4Addr: ipv4Addr + serviceKpis: + avalMem: avalMem + avalStor: avalStor + avalComp: avalComp + maxRestime: 1 + availability: 5 + maxReqRate: 6 + - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS + ueIpRange: + ueIpv4AddrRanges: + - start: start + end: end + - start: start + end: end + securityMethods: + - PSK + - PSK + versions: + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + dataFormat: JSON + domainName: domainName + aefLocation: + dcId: dcId + aefId: aefId + interfaceDescriptions: + - ipv6Addr: ipv6Addr + grantTypes: + - null + - null + securityMethods: + - null + - null + fqdn: fqdn + port: 0 + apiPrefix: apiPrefix + ipv4Addr: ipv4Addr + - ipv6Addr: ipv6Addr + grantTypes: + - null + - null + securityMethods: + - null + - null + fqdn: fqdn + port: 0 + apiPrefix: apiPrefix + ipv4Addr: ipv4Addr + serviceKpis: + avalMem: avalMem + avalStor: avalStor + avalComp: avalComp + maxRestime: 1 + availability: 5 + maxReqRate: 6 + pubApiPath: + ccfIds: + - ccfIds + - ccfIds + suppFeat: suppFeat + properties: + serviceAPIDescriptions: + items: + $ref: '#/components/schemas/ServiceAPIDescription' + minItems: 1 + title: serviceAPIDescriptions + type: array + suppFeat: + pattern: "^[A-Fa-f0-9]*$" + title: SupportedFeatures + type: string + title: DiscoveredAPIs + type: object + ServiceAPIDescription: + example: + serviceAPICategory: serviceAPICategory + ccfId: ccfId + apiName: apiName + shareableInfo: + capifProvDoms: + - capifProvDoms + - capifProvDoms + isShareable: true + apiProvName: apiProvName + supportedFeatures: supportedFeatures + description: description + apiSuppFeats: apiSuppFeats + apiId: apiId + apiStatus: + aefIds: + - aefIds + - aefIds + aefProfiles: + - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS + ueIpRange: + ueIpv4AddrRanges: + - start: start + end: end + - start: start + end: end + securityMethods: + - PSK + - PSK + versions: + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + dataFormat: JSON + domainName: domainName + aefLocation: + dcId: dcId + aefId: aefId + interfaceDescriptions: + - ipv6Addr: ipv6Addr + grantTypes: + - null + - null + securityMethods: + - null + - null + fqdn: fqdn + port: 0 + apiPrefix: apiPrefix + ipv4Addr: ipv4Addr + - ipv6Addr: ipv6Addr + grantTypes: + - null + - null + securityMethods: + - null + - null + fqdn: fqdn + port: 0 + apiPrefix: apiPrefix + ipv4Addr: ipv4Addr + serviceKpis: + avalMem: avalMem + avalStor: avalStor + avalComp: avalComp + maxRestime: 1 + availability: 5 + maxReqRate: 6 + - protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS + ueIpRange: + ueIpv4AddrRanges: + - start: start + end: end + - start: start + end: end + securityMethods: + - PSK + - PSK + versions: + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + dataFormat: JSON + domainName: domainName + aefLocation: + dcId: dcId + aefId: aefId + interfaceDescriptions: + - ipv6Addr: ipv6Addr + grantTypes: + - null + - null + securityMethods: + - null + - null + fqdn: fqdn + port: 0 + apiPrefix: apiPrefix + ipv4Addr: ipv4Addr + - ipv6Addr: ipv6Addr + grantTypes: + - null + - null + securityMethods: + - null + - null + fqdn: fqdn + port: 0 + apiPrefix: apiPrefix + ipv4Addr: ipv4Addr + serviceKpis: + avalMem: avalMem + avalStor: avalStor + avalComp: avalComp + maxRestime: 1 + availability: 5 + maxReqRate: 6 + pubApiPath: + ccfIds: + - ccfIds + - ccfIds + properties: + apiName: + title: apiName + type: string + apiId: + title: apiId + type: string + apiStatus: + $ref: '#/components/schemas/ApiStatus' + aefProfiles: + items: + $ref: '#/components/schemas/AefProfile' + minItems: 1 + title: aefProfiles + type: array + description: + title: description + type: string + supportedFeatures: + pattern: "^[A-Fa-f0-9]*$" + title: SupportedFeatures + type: string + shareableInfo: + $ref: '#/components/schemas/ShareableInformation' + serviceAPICategory: + title: serviceAPICategory + type: string + apiSuppFeats: + pattern: "^[A-Fa-f0-9]*$" + title: SupportedFeatures + type: string + pubApiPath: + $ref: '#/components/schemas/PublishedApiPath' + ccfId: + title: ccfId + type: string + apiProvName: + title: apiProvName + type: string + required: + - apiName + title: ServiceAPIDescription + type: object + AefProfile: + example: + protocol: HTTP_1_1 + grantTypes: + - CLIENT_CREDENTIALS + - CLIENT_CREDENTIALS + ueIpRange: + ueIpv4AddrRanges: + - start: start + end: end + - start: start + end: end + securityMethods: + - PSK + - PSK + versions: + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + - apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + dataFormat: JSON + domainName: domainName + aefLocation: + dcId: dcId + aefId: aefId + interfaceDescriptions: + - ipv6Addr: ipv6Addr + grantTypes: + - null + - null + securityMethods: + - null + - null + fqdn: fqdn + port: 0 + apiPrefix: apiPrefix + ipv4Addr: ipv4Addr + - ipv6Addr: ipv6Addr + grantTypes: + - null + - null + securityMethods: + - null + - null + fqdn: fqdn + port: 0 + apiPrefix: apiPrefix + ipv4Addr: ipv4Addr + serviceKpis: + avalMem: avalMem + avalStor: avalStor + avalComp: avalComp + maxRestime: 1 + availability: 5 + maxReqRate: 6 + properties: + aefId: + title: aefId + type: string + versions: + items: + $ref: '#/components/schemas/Version' + minItems: 1 + title: versions + type: array + protocol: + $ref: '#/components/schemas/Protocol' + dataFormat: + $ref: '#/components/schemas/DataFormat' + securityMethods: + items: + $ref: '#/components/schemas/SecurityMethod' + title: securityMethods + type: array + grantTypes: + items: + $ref: '#/components/schemas/OAuthGrantType' + title: grantTypes + type: array + domainName: + title: domainName + type: string + interfaceDescriptions: + items: + $ref: '#/components/schemas/InterfaceDescription' + title: interfaceDescriptions + type: array + aefLocation: + $ref: '#/components/schemas/AefLocation' + serviceKpis: + $ref: '#/components/schemas/ServiceKpis' + ueIpRange: + $ref: '#/components/schemas/IpAddrRange' + required: + - aefId + - versions + title: AefProfile + type: object + Version: + example: + apiVersion: apiVersion + resources: + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + - operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + custOperations: + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + - operations: + - null + - null + commType: null + description: description + custOpName: custOpName + expiry: 2000-01-23T04:56:07.000+00:00 + properties: + apiVersion: + title: apiVersion + type: string + expiry: + format: date-time + title: expiry + type: string + resources: + items: + $ref: '#/components/schemas/Resource' + title: resources + type: array + custOperations: + items: + $ref: '#/components/schemas/CustomOperation' + title: custOperations + type: array + required: + - apiVersion + title: Version + type: object + Resource: + example: + operations: + - GET + - GET + commType: REQUEST_RESPONSE + description: description + resourceName: resourceName + custOpName: custOpName + uri: uri + properties: + resourceName: + title: resourceName + type: string + commType: + $ref: '#/components/schemas/CommunicationType' + uri: + title: uri + type: string + custOpName: + title: custOpName + type: string + operations: + items: + $ref: '#/components/schemas/Operation' + title: operations + type: array + description: + title: description + type: string + required: + - commType + - resourceName + - uri + title: Resource + type: object + CustomOperation: + example: + operations: + - null + - null + commType: null + description: description + custOpName: custOpName + properties: + commType: + $ref: '#/components/schemas/CommunicationType' + custOpName: + title: custOpName + type: string + operations: + items: + $ref: '#/components/schemas/Operation' + title: operations + type: array + description: + title: description + type: string + required: + - commType + - custOpName + title: CustomOperation + type: object + ApiStatus: + example: + aefIds: + - aefIds + - aefIds + properties: + aefIds: + items: + type: string + title: aefIds + type: array + required: + - aefIds + title: ApiStatus + type: object + InterfaceDescription: + example: + ipv6Addr: ipv6Addr + grantTypes: + - null + - null + securityMethods: + - null + - null + fqdn: fqdn + port: 0 + apiPrefix: apiPrefix + ipv4Addr: ipv4Addr + properties: + ipv4Addr: + title: ipv4Addr + type: string + ipv6Addr: + title: ipv6Addr + type: string + fqdn: + title: fqdn + type: string + port: + title: port + type: integer + apiPrefix: + title: apiPrefix + type: string + securityMethods: + items: + $ref: '#/components/schemas/SecurityMethod' + title: securityMethods + type: array + grantTypes: + items: + $ref: '#/components/schemas/OAuthGrantType' + title: grantTypes + type: array + title: InterfaceDescription + type: object + SupportedFeatures: + pattern: "^[A-Fa-f0-9]*$" + title: SupportedFeatures + type: string + CommunicationType: + enum: + - REQUEST_RESPONSE + - SUBSCRIBE_NOTIFY + title: CommunicationType + type: string + Protocol: + enum: + - HTTP_1_1 + - HTTP_2 + - MQTT + - WEBSOCKET + title: Protocol + type: string + DataFormat: + enum: + - JSON + - XML + - PROTOBUF3 + title: DataFormat + type: string + Operation: + enum: + - GET + - POST + - PUT + - PATCH + - DELETE + title: Operation + type: string + SecurityMethod: + enum: + - PSK + - PKI + - OAUTH + title: SecurityMethod + type: string + OAuthGrantType: + enum: + - CLIENT_CREDENTIALS + - AUTHORIZATION_CODE + - AUTHORIZATION_CODE_WITH_PKCE + title: OAuthGrantType + type: string + ShareableInformation: + example: + capifProvDoms: + - capifProvDoms + - capifProvDoms + isShareable: true + properties: + isShareable: + title: isShareable + type: boolean + capifProvDoms: + items: + type: string + title: capifProvDoms + type: array + required: + - isShareable + title: ShareableInformation + type: object + PublishedApiPath: + example: + ccfIds: + - ccfIds + - ccfIds + properties: + ccfIds: + items: + type: string + title: ccfIds + type: array + title: PublishedApiPath + type: object + AefLocation: + example: + dcId: dcId + properties: + dcId: + title: dcId + type: string + title: AefLocation + type: object + ServiceKpis: + example: + avalMem: avalMem + avalStor: avalStor + avalComp: avalComp + maxRestime: 1 + availability: 5 + maxReqRate: 6 + properties: + maxReqRate: + title: maxReqRate + type: integer + maxRestime: + title: maxRestime + type: integer + availability: + title: availability + type: integer + avalComp: + title: avalComp + type: string + avalMem: + title: avalMem + type: string + avalStor: + title: avalStor + type: string + title: ServiceKpis + type: object + IpAddrRange: + example: + ueIpv4AddrRanges: + - start: start + end: end + - start: start + end: end + properties: + ueIpv4AddrRanges: + items: + $ref: '#/components/schemas/IpAddrRange_ueIpv4AddrRanges_inner' + title: ueIpv4AddrRanges + type: array + title: IpAddrRange + type: object + Error: + example: + code: code + details: + key: "" + message: message + properties: + code: + title: code + type: string + message: + title: message + type: string + details: + additionalProperties: true + title: details + type: object + required: + - code + - message + title: Error + type: object + _rules_get_200_response: + example: + nextPageToken: nextPageToken + items: + - default_access: ALLOW + notes: notes + updatedBy: updatedBy + startsAt: 2000-01-23T04:56:07.000+00:00 + invokerExceptions: + invokerOnboardedByUser: + - invokerOnboardedByUser + - invokerOnboardedByUser + apiInvokerId: + - apiInvokerId + - apiInvokerId + providerSelector: + apiProviderId: + - apiProviderId + - apiProviderId + apiName: + - apiName + - apiName + userName: userName + aefId: + - aefId + - aefId + apiId: + - apiId + - apiId + ruleId: ruleId + endsAt: 2000-01-23T04:56:07.000+00:00 + enabled: true + updatedAt: 2000-01-23T04:56:07.000+00:00 + - default_access: ALLOW + notes: notes + updatedBy: updatedBy + startsAt: 2000-01-23T04:56:07.000+00:00 + invokerExceptions: + invokerOnboardedByUser: + - invokerOnboardedByUser + - invokerOnboardedByUser + apiInvokerId: + - apiInvokerId + - apiInvokerId + providerSelector: + apiProviderId: + - apiProviderId + - apiProviderId + apiName: + - apiName + - apiName + userName: userName + aefId: + - aefId + - aefId + apiId: + - apiId + - apiId + ruleId: ruleId + endsAt: 2000-01-23T04:56:07.000+00:00 + enabled: true + updatedAt: 2000-01-23T04:56:07.000+00:00 + properties: + items: + items: + $ref: '#/components/schemas/Rule' + title: items + type: array + nextPageToken: + title: nextPageToken + type: string + required: + - items + title: _rules_get_200_response + type: object + IpAddrRange_ueIpv4AddrRanges_inner: + example: + start: start + end: end + properties: + start: + title: start + type: string + end: + title: end + type: string + title: IpAddrRange_ueIpv4AddrRanges_inner + type: object diff --git a/services/helper/helper_service/services/visibility_control/typing_utils.py b/services/helper/helper_service/services/visibility_control/typing_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..74e3c913a7db6246bc765f147ca872996112c6bb --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/typing_utils.py @@ -0,0 +1,30 @@ +import sys + +if sys.version_info < (3, 7): + import typing + + def is_generic(klass): + """ Determine whether klass is a generic class """ + return type(klass) == typing.GenericMeta + + def is_dict(klass): + """ Determine whether klass is a Dict """ + return klass.__extra__ == dict + + def is_list(klass): + """ Determine whether klass is a List """ + return klass.__extra__ == list + +else: + + def is_generic(klass): + """ Determine whether klass is a generic class """ + return hasattr(klass, '__origin__') + + def is_dict(klass): + """ Determine whether klass is a Dict """ + return klass.__origin__ == dict + + def is_list(klass): + """ Determine whether klass is a List """ + return klass.__origin__ == list diff --git a/services/helper/helper_service/services/visibility_control/util.py b/services/helper/helper_service/services/visibility_control/util.py new file mode 100644 index 0000000000000000000000000000000000000000..bc420a2657adef2c775cc45ad7f52572c710bd9d --- /dev/null +++ b/services/helper/helper_service/services/visibility_control/util.py @@ -0,0 +1,147 @@ +import datetime + +import typing +from visibility_control import typing_utils + + +def _deserialize(data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if klass in (int, float, str, bool, bytearray): + return _deserialize_primitive(data, klass) + elif klass == object: + return _deserialize_object(data) + elif klass == datetime.date: + return deserialize_date(data) + elif klass == datetime.datetime: + return deserialize_datetime(data) + elif typing_utils.is_generic(klass): + if typing_utils.is_list(klass): + return _deserialize_list(data, klass.__args__[0]) + if typing_utils.is_dict(klass): + return _deserialize_dict(data, klass.__args__[1]) + else: + return deserialize_model(data, klass) + + +def _deserialize_primitive(data, klass): + """Deserializes to primitive type. + + :param data: data to deserialize. + :param klass: class literal. + + :return: int, long, float, str, bool. + :rtype: int | long | float | str | bool + """ + try: + value = klass(data) + except UnicodeEncodeError: + value = data + except TypeError: + value = data + return value + + +def _deserialize_object(value): + """Return an original value. + + :return: object. + """ + return value + + +def deserialize_date(string): + """Deserializes string to date. + + :param string: str. + :type string: str + :return: date. + :rtype: date + """ + if string is None: + return None + + try: + from dateutil.parser import parse + return parse(string).date() + except ImportError: + return string + + +def deserialize_datetime(string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :type string: str + :return: datetime. + :rtype: datetime + """ + if string is None: + return None + + try: + from dateutil.parser import parse + return parse(string) + except ImportError: + return string + + +def deserialize_model(data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :type data: dict | list + :param klass: class literal. + :return: model object. + """ + instance = klass() + + if not instance.openapi_types: + return data + + for attr, attr_type in instance.openapi_types.items(): + if data is not None \ + and instance.attribute_map[attr] in data \ + and isinstance(data, (list, dict)): + value = data[instance.attribute_map[attr]] + setattr(instance, attr, _deserialize(value, attr_type)) + + return instance + + +def _deserialize_list(data, boxed_type): + """Deserializes a list and its elements. + + :param data: list to deserialize. + :type data: list + :param boxed_type: class literal. + + :return: deserialized list. + :rtype: list + """ + return [_deserialize(sub_data, boxed_type) + for sub_data in data] + + +def _deserialize_dict(data, boxed_type): + """Deserializes a dict and its elements. + + :param data: dict to deserialize. + :type data: dict + :param boxed_type: class literal. + + :return: deserialized dict. + :rtype: dict + """ + return {k: _deserialize(v, boxed_type) + for k, v in data.items() } diff --git a/services/helper/requirements.txt b/services/helper/requirements.txt index 14644ee7471885fbfa74eb2c23a6d0fe698e7709..c2945f6f4f2d96d4d3163d7f995c6974258d08b6 100644 --- a/services/helper/requirements.txt +++ b/services/helper/requirements.txt @@ -1,12 +1,18 @@ -python_dateutil == 2.9.0.post0 -setuptools == 74.0.0 -Flask == 3.0.3 -pymongo == 4.7.3 -flask_jwt_extended == 4.6.0 -pyopenssl == 24.1.0 -pyyaml == 6.0.1 -requests == 2.32.2 +connexion[swagger-ui] >= 2.6.0; python_version>="3.6" +# 2.3 is the last version that supports python 3.4-3.5 +connexion[swagger-ui] <= 2.3.0; python_version=="3.5" or python_version=="3.4" +# prevent breaking dependencies from advent of connexion>=3.0 +connexion[swagger-ui] <= 2.14.2; python_version>"3.4" +# connexion requires werkzeug but connexion < 2.4.0 does not install werkzeug +# we must peg werkzeug versions below to fix connexion +# https://github.com/zalando/connexion/pull/1044 +werkzeug == 0.16.1; python_version=="3.5" or python_version=="3.4" +swagger-ui-bundle >= 0.0.2 +python_dateutil >= 2.6.0 +setuptools == 80.9.0 +Flask == 2.1.1 gunicorn == 23.0.0 uvicorn == 0.34.2 asgiref == 3.8.1 -packaging == 24.0 +pymongo == 4.7.3 +pyopenssl == 25.3.0 diff --git a/services/nginx/Dockerfile b/services/nginx/Dockerfile index b163386ec2e8883c87d09c768fe9edd1b6f35704..f8bb53561d5b1dc8c929c1dfc04216bfdfbcb6dd 100644 --- a/services/nginx/Dockerfile +++ b/services/nginx/Dockerfile @@ -9,6 +9,9 @@ RUN mkdir -p /etc/nginx/certs COPY ./certs/sign_req_body_tmp.json /etc/nginx/certs/sign_req_body_tmp.json COPY ./nginx.conf /etc/nginx/nginx.conf +COPY ./endpoints /etc/nginx/endpoints +COPY ./maps /etc/nginx/maps +COPY ./policies /etc/nginx/policies COPY ./nginx_prepare.sh . RUN chmod a+x nginx_prepare.sh diff --git a/services/nginx/endpoints/endpoints.conf b/services/nginx/endpoints/endpoints.conf new file mode 100644 index 0000000000000000000000000000000000000000..76448f7e633213cf1976d0e68f2c10f9c9454a66 --- /dev/null +++ b/services/nginx/endpoints/endpoints.conf @@ -0,0 +1,40 @@ +map $uri $endpoint { + default "NO MATCH"; + + # Exact matches for endpoints that require specific handling (Must be on top of the regex matches) + /api-invoker-management/v1/onboardedInvokers invoker_onboarding_exact; + /api-provider-management/v1/registrations provider_registrations_exact; + /service-apis/v1/allServiceAPIs discover_service_exact; + + # Regex matches for endpoints that can be grouped by common patterns + # Helper related endpoints + ~^/helper/ helper_base_tree; + + # Invoker management related endpoints + ~^/api-invoker-management/v1/onboardedInvokers/ invoker_onboarding_tree; + + # Provider management related endpoints + ~^/api-provider-management/v1/registrations/ provider_registrations_tree; + + # Published APIs related endpoints + ~^/published-apis/v1/ published_apis_tree; + + # Logging related endpoints + ~^/api-invocation-logs/v1/ logging_tree; + + # Auditing related endpoints + ~^/logs/v1/ auditing_tree; + + # Security related endpoints + ~^/capif-security/v1/trustedInvokers/.+/update security_update; + ~^/capif-security/v1/trustedInvokers/.+/delete security_delete; + ~^/capif-security/v1/trustedInvokers/.+ security_trusted_invokers_exact; + ~^/capif-security/v1/securities/.+/token security_token; + ~^/capif-security/v1/ security_tree; + + # Events related endpoints + ~^/capif-events/v1/ events_tree; + + # Access control policy related endpoints + ~^/access-control-policy/v1/ acl_tree; +} diff --git a/services/nginx/maps/00-services.conf b/services/nginx/maps/00-services.conf new file mode 100644 index 0000000000000000000000000000000000000000..44ec473001ac1be68faace8731da7b38d4cfbdbd --- /dev/null +++ b/services/nginx/maps/00-services.conf @@ -0,0 +1,13 @@ +map $uri $service { + default ""; + ~^/helper(/|$) helper; + ~^/api-invoker-management(/|$) invoker-management; + ~^/api-provider-management(/|$) provider-management; + ~^/service-apis(/|$) discover-service; + ~^/published-apis(/|$) publish-service; + ~^/api-invocation-logs(/|$) logging-service; + ~^/logs(/|$) auditing-service; + ~^/capif-security(/|$) security-service; + ~^/capif-events(/|$) events-service; + ~^/access-control-policy(/|$) access-control-policy; +} diff --git a/services/nginx/maps/20-methods.conf b/services/nginx/maps/20-methods.conf new file mode 100644 index 0000000000000000000000000000000000000000..2f3bd12088f3fce6f580a631b4384b977fbd8718 --- /dev/null +++ b/services/nginx/maps/20-methods.conf @@ -0,0 +1,8 @@ +map $request_method $method { + default OTHER; + GET GET; + POST POST; + PUT PUT; + DELETE DELETE; + PATCH PATCH; +} diff --git a/services/nginx/maps/30-auth-type.conf b/services/nginx/maps/30-auth-type.conf new file mode 100644 index 0000000000000000000000000000000000000000..90309a9a4a74329483ace155cec089d743963341 --- /dev/null +++ b/services/nginx/maps/30-auth-type.conf @@ -0,0 +1,9 @@ +map $ssl_client_verify $has_cert { + default 0; + SUCCESS 1; +} + +map $http_authorization $has_token { + default 0; + ~^Bearer\s+.+ 1; +} diff --git a/services/nginx/maps/40-roles.conf b/services/nginx/maps/40-roles.conf new file mode 100644 index 0000000000000000000000000000000000000000..7984b351f4f3a3351948fa53056bd928b66921ef --- /dev/null +++ b/services/nginx/maps/40-roles.conf @@ -0,0 +1,9 @@ +map $ssl_client_s_dn_cn $role { + default unknown; + superadmin superadmin; + "~^INV[a-zA-Z0-9]+$" invoker; + "~^AMF[a-zA-Z0-9]+$" amf; + "~^APF[a-zA-Z0-9]+$" apf; + "~^AEF[a-zA-Z0-9]+$" aef; + "~^CCF[a-zA-Z0-9]+$" ccf; +} \ No newline at end of file diff --git a/services/nginx/maps/90-policy-dispatch.conf b/services/nginx/maps/90-policy-dispatch.conf new file mode 100644 index 0000000000000000000000000000000000000000..6c85657084bf48c23f0b87dd449453229765a5f0 --- /dev/null +++ b/services/nginx/maps/90-policy-dispatch.conf @@ -0,0 +1,38 @@ +map "$service:$has_token:$has_cert" $active_policy { + default DENY; + # Define policies for each service, based on the presence of a token and/or client certificate + # The format is: service_name:has_token:has_cert + + # Helper Service + helper:0:1 $helper_mtls_policy; + + # Api Invoker Management Service + invoker-management:1:0 $invoker_token_policy; + invoker-management:0:1 $invoker_mtls_policy; + + # Api Provider Management Service + provider-management:1:0 $provider_token_policy; + provider-management:0:1 $provider_mtls_policy; + + # Discover Service + discover-service:0:1 $discover_service_mtls_policy; + + # Published APIs Service + publish-service:0:1 $publish_service_mtls_policy; + + # Logging Service + logging-service:0:1 $logging_service_mtls_policy; + + # Auditing Service + auditing-service:0:1 $auditing_service_mtls_policy; + + # Security Service + security-service:0:1 $security_service_mtls_policy; + + # Events Service + events-service:0:1 $events_service_mtls_policy; + + # Access Control Policy Service + access-control-policy:0:1 $access_control_policy_mtls_policy; + +} diff --git a/services/nginx/maps/95-auth-error.conf b/services/nginx/maps/95-auth-error.conf new file mode 100644 index 0000000000000000000000000000000000000000..9b0b713ca3fe733c1fdb67e779c94c3d5904ab1d --- /dev/null +++ b/services/nginx/maps/95-auth-error.conf @@ -0,0 +1,19 @@ +map "$service:$endpoint:$method:$has_token:$has_cert:$role" $auth_error { + default '{"status":401,"title":"Unauthorized","detail":"Operation not allowed","cause":"Access denied by policy"}'; + ~^.*:.*:.*:0:0:.*$ '{"status":401, "title":"Unauthorized" ,"detail":"Certifcate not present", "cause":"Certificate is required for this API route"}'; + ~^helper:.*:.*:0:1:(invoker|apf|aef)$ '{"status":401, "title":"Unauthorized" ,"detail":"Role not authorized for this API route", "cause":"User role must be superadmin"}'; + ~^invoker-management:.*:.*:0:1:(amf|apf|aef|ccf)$ '{"status":401, "title":"Unauthorized" ,"detail":"Role not authorized for this API route", "cause":"User role must be invoker"}'; + ~^provider-management:.*:.*:0:1:(invoker|apf|aef|ccf)$ '{"status":401, "title":"Unauthorized" ,"detail":"Role not authorized for this API route", "cause":"User role must be amf"}'; + ~^discover-service:.*:.*:0:1:(amf|apf|aef)$ '{"status":401, "title":"Unauthorized" ,"detail":"User not authorized", "cause":"Certificate not authorized"}'; + ~^publish-service:.*:.*:0:1:(invoker|amf|aef)$ '{"status":401, "title":"Unauthorized" ,"detail":"User not authorized", "cause":"Certificate not authorized"}'; + ~^events-service:.*:.*:0:1:(ccf)$ '{"status":401, "title":"Unauthorized" ,"detail":"User not authorized", "cause":"Certificate not authorized"}'; + ~^access-control-policy:.*:.*:0:1:(amf|apf|invoker)$ '{"status":401, "title":"Unauthorized" ,"detail":"Role not authorized for this API route", "cause":"Certificate not authorized"}'; + + ~^security-service:security_trusted_invokers_exact:GET:0:1:(invoker|amf|apf|ccf)$ '{"status":401, "title":"Unauthorized" ,"detail":"Role not authorized for this API route", "cause":"User role must be aef"}'; + ~^security-service:security_trusted_invokers_exact:DELETE:0:1:(invoker|amf|apf|ccf)$ '{"status":401, "title":"Unauthorized" ,"detail":"Role not authorized for this API route", "cause":"User role must be aef"}'; + ~^security-service:security_trusted_invokers_exact:PUT:0:1:(aef|amf|apf|ccf)$ '{"status":401, "title":"Unauthorized" ,"detail":"Role not authorized for this API route", "cause":"User role must be invoker"}'; + ~^security-service:security_update:POST:0:1:(aef|amf|apf|ccf)$ '{"status":401, "title":"Unauthorized" ,"detail":"Role not authorized for this API route", "cause":"User role must be invoker"}'; + ~^security-service:security_delete:POST:0:1:(invoker|amf|apf|ccf)$ '{"status":401, "title":"Unauthorized" ,"detail":"Role not authorized for this API route", "cause":"User role must be aef"}'; + ~^security-service:security_token:POST:0:1:(aef|amf|apf|ccf)$ '{"error":"unauthorized_client", "error_description":"Role not authorized for this API route"}'; + +} diff --git a/services/nginx/maps/99-auth-decision.conf b/services/nginx/maps/99-auth-decision.conf new file mode 100644 index 0000000000000000000000000000000000000000..82aa8bf06f1236ca7873ad056089aa9ba65a4fd4 --- /dev/null +++ b/services/nginx/maps/99-auth-decision.conf @@ -0,0 +1,4 @@ +map $active_policy $auth_allowed { + default 0; + ALLOW 1; +} diff --git a/services/nginx/nginx.conf b/services/nginx/nginx.conf index ecde2dc13855140e0b2cb70437149c297cf9bb46..3cd6fe89fe681e96fb69ec13497a6a4a456d92f1 100644 --- a/services/nginx/nginx.conf +++ b/services/nginx/nginx.conf @@ -1,6 +1,7 @@ worker_processes auto; error_log /var/log/nginx/error.log ${LOG_LEVEL}; + pid /tmp/nginx.pid; events { @@ -12,43 +13,11 @@ http { default ""; ~(^|,)CN=(?[^,]+) $CN; } - map "$request_method:$uri:$ssl_client_s_dn_cn" $helper_error_message { - default 'SUCCESS'; - "~*(GET|DELETE):.*:(?!(superadmin))(.*)" '{"status":401, "title":"Unauthorized" ,"detail":"Role not authorized for this API route", "cause":"User role must be superadmin"}'; - } - map "$request_method:$uri:$ssl_client_s_dn_cn" $invoker_error_message { - default 'SUCCESS'; - "~*(PUT|DELETE):.*:(?!(INV|superadmin))(.*)" '{"status":401, "title":"Unauthorized" ,"detail":"Role not authorized for this API route", "cause":"User role must be invoker"}'; - } - map "$request_method:$uri:$ssl_client_s_dn_cn" $provider_error_message { - default 'SUCCESS'; - "~*(PUT|DELETE|PATCH):.*:(?!(AMF|superadmin))(.*)" '{"status":401, "title":"Unauthorized" ,"detail":"Role not authorized for this API route", "cause":"User role must be amf"}'; - } - map "$request_method:$uri:$ssl_client_s_dn_cn" $publish_error_message { - default 'SUCCESS'; - "~*.*:.*:(?!(APF|ccf|superadmin))(.*)" '{"status":401, "title":"Unauthorized" ,"detail":"User not authorized", "cause":"Certificate not authorized"}'; - } - map "$request_method:$uri:$ssl_client_s_dn_cn" $acl_error_message { - default 'SUCCESS'; - "~*.*:.*:(?!(AEF|ccf|superadmin))(.*)" '{"status":401, "title":"Unauthorized" ,"detail":"Role not authorized for this API route", "cause":"Certificate not authorized"}'; - } - map "$request_method:$uri:$ssl_client_s_dn_cn" $discover_error_message { - default 'SUCCESS'; - "~*.*:.*:(?!(INV|ccf|superadmin))(.*)" '{"status":401, "title":"Unauthorized" ,"detail":"User not authorized", "cause":"Certificate not authorized"}'; - } - map "$request_method:$uri:$ssl_client_s_dn_cn" $security_error_message { - default 'SUCCESS'; - "~*DELETE:.*:(?!(AEF|superadmin))(.*)" '{"status":401, "title":"Unauthorized" ,"detail":"Role not authorized for this API route", "cause":"User role must be aef"}'; - "~*PUT:.*:(?!(INV|superadmin))(.*)" '{"status":401, "title":"Unauthorized" ,"detail":"Role not authorized for this API route", "cause":"User role must be invoker"}'; - "~*GET:.*:(?!(AEF|superadmin))(.*)" '{"status":401, "title":"Unauthorized" ,"detail":"Role not authorized for this API route", "cause":"User role must be aef"}'; - "~*POST:.*/update:(?!(INV|superadmin))(.*)" '{"status":401, "title":"Unauthorized" ,"detail":"Role not authorized for this API route", "cause":"User role must be invoker"}'; - "~*POST:.*/delete:(?!(AEF|superadmin))(.*)" '{"status":401, "title":"Unauthorized" ,"detail":"Role not authorized for this API route", "cause":"User role must be aef"}'; - "~*POST:.*/token:(?!(INV|superadmin))(.*)" '{"error":"unauthorized_client", "error_description":"Role not authorized for this API route"}'; - } - map "$request_method:$uri:$ssl_client_s_dn_cn" $events_error_message { - default 'SUCCESS'; - "~*.*:.*:ccf" '{"status":401, "title":"Unauthorized" ,"detail":"User not authorized", "cause":"Certificate not authorized"}'; - } + include maps/*.conf; + include policies/*.conf; + include endpoints/*.conf; + + # log_format debug_map 'Policy: $uri - $endpoint:$method:$role"$service:$has_token:$has_cert:$active_policy:$auth_allowed:$ssl_client_s_dn_cn' server { listen 8080; @@ -70,24 +39,32 @@ http { ssl_client_certificate /etc/nginx/certs/ca.crt; ssl_verify_client optional; ssl_verify_depth 2; + ssl_session_tickets off; + + # (ONLY DEVELOPMENT)Send the log directly to the console (useful in Docker or terminal) + # access_log /dev/stdout debug_map; + + location ~^/(?[^/]+)(?:/(?[^/]+))?/(ui|openapi\.json|swagger\.json) { + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - location / { - proxy_pass $scheme://$http_host/api-invoker-management/v1/ui/; + proxy_pass http://$service_forwarding:8080; } location /api-invoker-management { - if ( $invoker_error_message != SUCCESS ) { + if ($auth_allowed = 0) { add_header Content-Type 'application/problem+json'; - return 401 $invoker_error_message; + return 401 $auth_error; } proxy_set_header X-SSL-Client-Cert $ssl_client_cert; proxy_pass http://api-invoker-management:8080; } location /api-provider-management { - if ( $provider_error_message != SUCCESS ) { + if ($auth_allowed = 0) { add_header Content-Type 'application/problem+json'; - return 401 $provider_error_message; + return 401 $auth_error; } proxy_set_header X-SSL-Client-Cert $ssl_client_cert; proxy_pass http://api-provider-management:8080; @@ -97,9 +74,9 @@ http { if ($ssl_client_verify != SUCCESS) { return 403; } - if ( $discover_error_message != SUCCESS ) { + if ($auth_allowed = 0) { add_header Content-Type 'application/problem+json'; - return 401 $discover_error_message; + return 401 $auth_error; } proxy_set_header X-SSL-Client-Cert $ssl_client_cert; proxy_pass http://service-apis:8080; @@ -109,9 +86,9 @@ http { if ($ssl_client_verify != SUCCESS) { return 403; } - if ( $publish_error_message != SUCCESS ) { + if ($auth_allowed = 0) { add_header Content-Type 'application/problem+json'; - return 401 $publish_error_message; + return 401 $auth_error; } proxy_set_header X-SSL-Client-Cert $ssl_client_cert; proxy_pass http://published-apis:8080; @@ -121,6 +98,10 @@ http { if ($ssl_client_verify != SUCCESS) { return 403; } + if ($auth_allowed = 0) { + add_header Content-Type 'application/problem+json'; + return 401 $auth_error; + } proxy_set_header X-SSL-Client-Cert $ssl_client_cert; proxy_pass http://api-invocation-logs:8080; } @@ -129,6 +110,10 @@ http { if ($ssl_client_verify != SUCCESS) { return 403; } + if ($auth_allowed = 0) { + add_header Content-Type 'application/problem+json'; + return 401 $auth_error; + } proxy_set_header X-SSL-Client-Cert $ssl_client_cert; proxy_pass http://logs:8080; } @@ -137,9 +122,9 @@ http { if ($ssl_client_verify != SUCCESS) { return 403; } - if ( $security_error_message != SUCCESS ) { - add_header Content-Type 'application/problem+json'; - return 401 $security_error_message; + if ($auth_allowed = 0) { + add_header Content-Type 'application/problem+json'; + return 401 $auth_error; } proxy_set_header X-TLS-Protocol $ssl_protocol; @@ -154,29 +139,32 @@ http { if ($ssl_client_verify != SUCCESS) { return 403; } - if ( $events_error_message != SUCCESS ) { + if ($auth_allowed = 0) { add_header Content-Type 'application/problem+json'; - return 401 $events_error_message; + return 401 $auth_error; } proxy_set_header X-SSL-Client-Cert $ssl_client_cert; proxy_pass http://capif-events:8080; } location /access-control-policy { - if ( $acl_error_message != SUCCESS ) { + if ($auth_allowed = 0) { add_header Content-Type 'application/problem+json'; - return 401 $acl_error_message; + return 401 $auth_error; } proxy_set_header X-SSL-Client-Cert $ssl_client_cert; proxy_pass http://access-control-policy:8080; } location /helper { - if ( $helper_error_message != SUCCESS ) { + if ($auth_allowed = 0) { add_header Content-Type 'application/problem+json'; - return 401 $helper_error_message; + return 401 $auth_error; } - proxy_set_header X-SSL-Client-Cert $ssl_client_cert; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Ssl-Client-Cert $ssl_client_cert; proxy_pass http://helper:8080; } diff --git a/services/nginx/nginx_prepare.sh b/services/nginx/nginx_prepare.sh index 91884863cc069fc05e1ad71e018627143ed5aa88..71381d565274616835a7b36736c04862911e9671 100644 --- a/services/nginx/nginx_prepare.sh +++ b/services/nginx/nginx_prepare.sh @@ -14,104 +14,263 @@ ATTEMPT=0 # Success check SUCCES_OPERATION=false -while [ $ATTEMPT -lt $MAX_RETRIES ]; do - # Increment ATTEMPT using eval - eval "ATTEMPT=\$((ATTEMPT + 1))" - echo "Attempt $ATTEMPT of $MAX_RETRIES" - - # Make the request to Vault and store the response in a variable - RESPONSE=$(curl -s -k --connect-timeout 5 --max-time 10 \ - --header "X-Vault-Token: $VAULT_TOKEN" \ - --request GET "$VAULT_ADDR/v1/secret/data/ca" | jq -r '.data.data.ca') - - echo "$RESPONSE" - - # Check if the response is "null" or empty - if [ -n "$RESPONSE" ] && [ "$RESPONSE" != "null" ]; then - echo "$RESPONSE" > $CERTS_FOLDER/ca.crt - openssl verify -CAfile $CERTS_FOLDER/ca.crt $CERTS_FOLDER/ca.crt - echo "CA Root successfully saved." - SUCCES_OPERATION=true - break +# Variable to store CCF_ID retrieved from Helper +CCF_ID="" + +fetch_ca_root_cert_from_vault() { + if [ ! -f $CERTS_FOLDER/ca.crt ]; then + ############################################################### + # 1) FETCH CA ROOT CERTIFICATE FROM VAULT + ############################################################### + + echo "[STEP] Fetching CA root certificate from Vault" + while [ $ATTEMPT -lt $MAX_RETRIES ]; do + # Increment ATTEMPT using eval + eval "ATTEMPT=\$((ATTEMPT + 1))" + echo "[INFO] Attempt $ATTEMPT/$MAX_RETRIES – GET secret/data/ca" + + # Make the request to Vault and store the response in a variable + RESPONSE=$(curl -s -k --connect-timeout 5 --max-time 10 \ + --header "X-Vault-Token: $VAULT_TOKEN" \ + --request GET "$VAULT_ADDR/v1/secret/data/ca" | jq -r '.data.data.ca') + + echo "[DEBUG] Raw Vault response:" + echo "$RESPONSE" + + # Check if the response is "null" or empty + if [ -n "$RESPONSE" ] && [ "$RESPONSE" != "null" ]; then + echo "$RESPONSE" > $CERTS_FOLDER/ca.crt + openssl verify -CAfile $CERTS_FOLDER/ca.crt $CERTS_FOLDER/ca.crt + echo "CA Root successfully saved." + SUCCES_OPERATION=true + break + else + echo "[ERROR] CA not available yet (null or empty). Retrying in ${RETRY_DELAY}s" + sleep $RETRY_DELAY + fi + done + + if [ "$SUCCES_OPERATION" = false ]; then + echo "[ERROR] Unable to retrieve CA certificate from Vault after $MAX_RETRIES attempts" + exit 1 + fi else - echo "Invalid response ('null' or empty), retrying in $RETRY_DELAY seconds..." - sleep $RETRY_DELAY + echo "CA certificate already exists. Skipping retrieval from Vault." fi -done +} -if [ "$SUCCES_OPERATION" = false ]; then - echo "Error: Failed to retrieve a valid response after $MAX_RETRIES attempts." - exit 1 # Exit with failure -fi +generate_server_key_if_missing() { + ############################################################### + # 2) GENERATE SERVER KEY IF MISSING + ############################################################### + if [ ! -f $CERTS_FOLDER/server.key ]; then + echo "server.key not found. Generating new private key..." + openssl genrsa -out $CERTS_FOLDER/server.key 2048 + else + echo "server.key already exists. Skipping generation." + fi +} -# Setup inital value to ATTEMPT and SUCCESS_OPERATION -ATTEMPT=0 -SUCCES_OPERATION=false -while [ $ATTEMPT -lt $MAX_RETRIES ]; do - # Increment ATTEMPT using eval - eval "ATTEMPT=\$((ATTEMPT + 1))" - echo "Attempt $ATTEMPT of $MAX_RETRIES" +generate_server_key_and_sign() { + ############################################################### + # 3) IF NO SERVER CERT → GENERATE CSR + REQUEST SIGNING IN VAULT + ############################################################### + if [ ! -f $CERTS_FOLDER/server.crt ]; then + SUCCESS_OPERATION=false + + echo "[STEP 3] Server certificate not found" + echo "[STEP 3] Generating CSR for CAPIF service" + echo "[INFO] Common Name (CN): $CAPIF_HOSTNAME" - # Make the request to Vault and store the response in a variable - RESPONSE=$(curl -s -k --connect-timeout 5 --max-time 10 \ - --header "X-Vault-Token: $VAULT_TOKEN" \ - --request GET "$VAULT_ADDR/v1/secret/data/server_cert" | jq -r '.data.data.cert') + # Generate CSR using the previously generated server.key + openssl req -new -key $CERTS_FOLDER/server.key \ + -subj "/CN=$CAPIF_HOSTNAME" \ + -addext "subjectAltName=DNS:$CAPIF_HOSTNAME" \ + -out $CERTS_FOLDER/server.csr - echo "$RESPONSE" + # Convert the CSR to a single line with \n so it can be sent in the body of the request to Vault (which expects JSON) + CSR_CONTENT=$(sed ':a;N;$!ba;s/\n/\\n/g' $CERTS_FOLDER/server.csr) + + echo "[STEP 3] CSR generated successfully" + echo "[STEP 3] Requesting certificate signing from Vault" + echo "[INFO] Vault PKI endpoint: $VAULT_ADDR/v1/pki_int/sign/my-ca" - # Check if the response is "null" or empty - if [ -n "$RESPONSE" ] && [ "$RESPONSE" != "null" ]; then - echo "$RESPONSE" > $CERTS_FOLDER/server.crt - echo "Server Certificate successfully saved." ATTEMPT=0 - SUCCES_OPERATION=true - break + SUCCESS_OPERATION=false + + while [ $ATTEMPT -lt $MAX_RETRIES ]; do + ATTEMPT=$((ATTEMPT + 1)) + echo "[STEP 3] Attempt $ATTEMPT/$MAX_RETRIES – Signing CSR in Vault" + + # POST /v1/pki_int/sign/my-ca intermediate's endpoint to sign the CSR + SIGN_RESPONSE=$(curl -s -X POST \ + -H "X-Vault-Token: $VAULT_TOKEN" \ + -d "{\"csr\":\"$CSR_CONTENT\",\"format\":\"pem_bundle\",\"common_name\":\"$CAPIF_HOSTNAME\"}" \ + "$VAULT_ADDR/v1/pki_int/sign/my-ca") + + # SIGN_RESPONSE; return a PEM bundle format with the signed certificate + intermediate certificate chain (but without the root). + + CERT=$(printf '%s' "$SIGN_RESPONSE" | jq -er '.data.certificate') + + if [ -n "$CERT" ] && [ "$CERT" != "null" ]; then + echo "$CERT" > $CERTS_FOLDER/server.crt + echo "Server certificate successfully signed and saved." + SUCCESS_OPERATION=true + break + else + echo "Invalid certificate response. Retrying in $RETRY_DELAY seconds..." + sleep $RETRY_DELAY + fi + done + + if [ "$SUCCESS_OPERATION" = false ]; then + echo "[STEP 3][ERROR] Failed to sign server certificate after $MAX_RETRIES attempts" + exit 1 + fi else - echo "Invalid response ('null' or empty), retrying in $RETRY_DELAY seconds..." - sleep $RETRY_DELAY + echo "[STEP 3] $CERTS_FOLDER/server.crt already exists – skipping certificate signing" fi -done +} -if [ "$SUCCES_OPERATION" = false ]; then - echo "Error: Failed to retrieve a valid response after $MAX_RETRIES attempts." - exit 1 # Exit with failure -fi +extract_public_key() { + if [ ! -f $CERTS_FOLDER/server_pub.pem ]; then + ############################################################### + # 4) Extract the public key from server.crt and save it as server_pub.pem + ############################################################### + openssl x509 -pubkey -noout -in $CERTS_FOLDER/server.crt > $CERTS_FOLDER/server_pub.pem + else + echo "Public key already extracted. Skipping extraction." + fi +} -# Setup inital value to ATTEMPT and SUCCESS_OPERATION -ATTEMPT=0 -SUCCES_OPERATION=false +get_ccf_id_from_helper() { + ############################################################### + # 5) CCF_ID RETRIEVAL (from helper, inside docker network) + ############################################################### + HELPER_URL="http://helper:8080/helper/api/getCcfId" + ATTEMPT_CCFID=0 + -while [ $ATTEMPT -lt $MAX_RETRIES ]; do - # Increment ATTEMPT using eval - eval "ATTEMPT=\$((ATTEMPT + 1))" - echo "Attempt $ATTEMPT of $MAX_RETRIES" + echo "[STEP] Fetching CCF_ID from Helper: $HELPER_URL" - # Make the request to Vault and store the response in a variable - RESPONSE=$(curl -s -k --connect-timeout 5 --max-time 10 \ - --header "X-Vault-Token: $VAULT_TOKEN" \ - --request GET "$VAULT_ADDR/v1/secret/data/server_cert/private" | jq -r '.data.data.key') + # Retry loop to get CCF_ID from Helper + while [ $ATTEMPT_CCFID -lt $MAX_RETRIES ]; do + ATTEMPT_CCFID=$((ATTEMPT_CCFID + 1)) + echo "[INFO] Attempt $ATTEMPT_CCFID/$MAX_RETRIES – GET $HELPER_URL" - echo "$RESPONSE" + RESP=$(curl -s --connect-timeout 5 --max-time 10 "$HELPER_URL" || true) - # Check if the response is "null" or empty - if [ -n "$RESPONSE" ] && [ "$RESPONSE" != "null" ]; then - echo "$RESPONSE" > $CERTS_FOLDER/server.key - echo "Server Key successfully saved." - ATTEMPT=0 - SUCCES_OPERATION=true + CCF_ID=$(printf '%s' "$RESP" | jq -r '.ccf_id // empty' 2>/dev/null || true) + + if [ -n "$CCF_ID" ]; then + echo "[INFO] Got CCF_ID=$CCF_ID" break + fi + + echo "[WARN] Helper not ready or invalid response: $RESP" + echo "[WARN] Retrying in ${RETRY_DELAY}s..." + sleep $RETRY_DELAY + done + + if [ -z "$CCF_ID" ]; then + echo "[ERROR] Unable to retrieve CCF_ID from Helper after $MAX_RETRIES attempts" + exit 1 + fi +} + + +store_certs_in_vault() { + ############################################################### + # 6) STORE CERTIFICATES IN VAULT UNDER capif/ + ############################################################### + echo "Storing CAPIF certificates in Vault..." + + SERVER_CRT_ESCAPED=$(sed ':a;N;$!ba;s/\n/\\n/g' $CERTS_FOLDER/server.crt) + SERVER_KEY_ESCAPED=$(sed ':a;N;$!ba;s/\n/\\n/g' $CERTS_FOLDER/server.key) + SERVER_PUB_ESCAPED=$(sed ':a;N;$!ba;s/\n/\\n/g' $CERTS_FOLDER/server_pub.pem) + CA_ESCAPED=$(sed ':a;N;$!ba;s/\n/\\n/g' $CERTS_FOLDER/ca.crt) + + # Store the server certificate, private key and CA certificate in Vault under secret/data/capif//nginx + VAULT_RESPONSE=$(curl -s -w "%{http_code}" -o /tmp/vault_resp.json \ + -X POST \ + -H "X-Vault-Token: $VAULT_TOKEN" \ + -H "Content-Type: application/json" \ + -d "{ + \"data\": { + \"server_crt\": \"${SERVER_CRT_ESCAPED}\", + \"server_key\": \"${SERVER_KEY_ESCAPED}\", + \"server_pub\": \"${SERVER_PUB_ESCAPED}\", + \"ca\": \"${CA_ESCAPED}\" + } + }" \ + "$VAULT_ADDR/v1/secret/data/capif/${CCF_ID}/nginx") + + if [ "$VAULT_RESPONSE" != "200" ] && [ "$VAULT_RESPONSE" != "204" ]; then + echo "[ERROR] Failed to store certs in Vault" + cat /tmp/vault_resp.json + exit 1 + fi + + echo "Certificates successfully stored in Vault namespace: secret/capif/$CCF_ID" +} + +check_value_and_store(){ + INPUT_VALUE=$1 + OUTPUT_FILE=$2 + if [ -n "$INPUT_VALUE" ] && [ "$INPUT_VALUE" != "null" ]; then + echo "$INPUT_VALUE" > $OUTPUT_FILE + echo "Value successfully saved to $OUTPUT_FILE." else - echo "Invalid response ('null' or empty), retrying in $RETRY_DELAY seconds..." - sleep $RETRY_DELAY + echo "Invalid value for $OUTPUT_FILE ('null' or empty)." + exit 1 fi -done +} + + +get_ccf_id_from_helper +echo "Retrieved CCF_ID from Helper: $CCF_ID" + +# Make the request to Vault and store the response in a variable -if [ "$SUCCES_OPERATION" = false ]; then - echo "Error: Failed to retrieve a valid response after $MAX_RETRIES attempts." - exit 1 # Exit with failure +HTTP_STATUS=$(curl -s -k \ + --connect-timeout 5 \ + --max-time 10 \ + --header "X-Vault-Token: $VAULT_TOKEN" \ + --request GET "$VAULT_ADDR/v1/secret/data/capif/${CCF_ID}/nginx" \ + -o $CERTS_FOLDER/response.json \ + -w "%{http_code}") + +echo "HTTP STATUS: $HTTP_STATUS" + +RESPONSE=$(cat $CERTS_FOLDER/response.json) +if [ -n "$RESPONSE" ] && [ "$RESPONSE" != "null" ] && [ "$HTTP_STATUS" -eq 200 ] ; then + echo "RESPONSE is valid, proceeding with certificate extraction and storage" + CA_CERT=$(jq -r '.data.data.ca' $CERTS_FOLDER/response.json) + SERVER_CRT=$(jq -r '.data.data.server_crt' $CERTS_FOLDER/response.json) + SERVER_KEY=$(jq -r '.data.data.server_key' $CERTS_FOLDER/response.json) + SERVER_PUB=$(jq -r '.data.data.server_pub' $CERTS_FOLDER/response.json) + + check_value_and_store "$SERVER_CRT" "$CERTS_FOLDER/server.crt" + check_value_and_store "$SERVER_KEY" "$CERTS_FOLDER/server.key" + check_value_and_store "$SERVER_PUB" "$CERTS_FOLDER/server_pub.pem" + check_value_and_store "$CA_CERT" "$CERTS_FOLDER/ca.crt" + +else + echo "Data not previously stored at Vault. Initialize information" + fetch_ca_root_cert_from_vault + generate_server_key_if_missing + generate_server_key_and_sign + extract_public_key + store_certs_in_vault + echo "Certificate information successfully stored in Vault for CCF_ID=$CCF_ID" fi + +############################################################### +# 7) START NGINX +############################################################### + LOG_LEVEL=$(echo "${LOG_LEVEL}" | tr '[:upper:]' '[:lower:]') case "$LOG_LEVEL" in @@ -126,6 +285,8 @@ case "$LOG_LEVEL" in ;; esac +echo "Using log level: $LOG_LEVEL" envsubst '$LOG_LEVEL' < /etc/nginx/nginx.conf > /etc/nginx/nginx.conf.tmp mv /etc/nginx/nginx.conf.tmp /etc/nginx/nginx.conf +echo "Saving nginx configuration with log level: $LOG_LEVEL" nginx diff --git a/services/nginx/policies/acl-mtls.conf b/services/nginx/policies/acl-mtls.conf new file mode 100644 index 0000000000000000000000000000000000000000..67d8a4a5716125c81b796edc8497fd7f011809d0 --- /dev/null +++ b/services/nginx/policies/acl-mtls.conf @@ -0,0 +1,7 @@ +map "$endpoint:$method:$role" $access_control_policy_mtls_policy { + default DENY; + # Security policies that use mTLS for authentication + ~^acl_tree:GET:(aef|superadmin)$ ALLOW; + +} + diff --git a/services/nginx/policies/auditing-mtls.conf b/services/nginx/policies/auditing-mtls.conf new file mode 100644 index 0000000000000000000000000000000000000000..3c1379faa0d9944026751e7e4b8cf145257e7858 --- /dev/null +++ b/services/nginx/policies/auditing-mtls.conf @@ -0,0 +1,6 @@ +map "$endpoint:$method:$role" $auditing_service_mtls_policy { + default DENY; + # Auditing policies that use mTLS for authentication + ~^auditing_tree:(GET):(amf|superadmin)$ ALLOW; +} + diff --git a/services/nginx/policies/discover-mtls.conf b/services/nginx/policies/discover-mtls.conf new file mode 100644 index 0000000000000000000000000000000000000000..ba07065a8da87ce67fb5f092e38cc3615f60c2b2 --- /dev/null +++ b/services/nginx/policies/discover-mtls.conf @@ -0,0 +1,6 @@ +map "$endpoint:$method:$role" $discover_service_mtls_policy { + default DENY; + # Discover policies that use mTLS for authentication + ~^discover_service_exact:GET:(invoker|ccf|superadmin)$ ALLOW; +} + diff --git a/services/nginx/policies/events-mtls.conf b/services/nginx/policies/events-mtls.conf new file mode 100644 index 0000000000000000000000000000000000000000..2000826adff826c30f4558855ff0896bb7ac9fa4 --- /dev/null +++ b/services/nginx/policies/events-mtls.conf @@ -0,0 +1,6 @@ +map "$endpoint:$method:$role" $events_service_mtls_policy { + default DENY; + #Publish policies that use mTLS for authentication + ~^events_tree:(POST|DELETE|PUT|PATCH):(amf|apf|aef|invoker|superadmin)$ ALLOW; +} + diff --git a/services/nginx/policies/helper-mtls.conf b/services/nginx/policies/helper-mtls.conf new file mode 100644 index 0000000000000000000000000000000000000000..7054207ba55edf4c778b1143866be44a21a10a59 --- /dev/null +++ b/services/nginx/policies/helper-mtls.conf @@ -0,0 +1,5 @@ +map "$endpoint:$method:$role" $helper_mtls_policy { + default "DENY"; + ~^helper_base_tree:.*:superadmin$ ALLOW; + ~^helper_base_tree:.*:amf$ ALLOW; +} diff --git a/services/nginx/policies/invoker-mtls.conf b/services/nginx/policies/invoker-mtls.conf new file mode 100644 index 0000000000000000000000000000000000000000..ccd479a6a1eaf9a842f373f447e1fd21497793da --- /dev/null +++ b/services/nginx/policies/invoker-mtls.conf @@ -0,0 +1,7 @@ +map "$endpoint:$method:$role" $invoker_mtls_policy { + default DENY; + # Invoker policies that use mTLS for authentication + ~^invoker_onboarding_tree:(PUT|DELETE|PATCH):superadmin$ ALLOW; + ~^invoker_onboarding_tree:(PUT|DELETE|PATCH):invoker$ ALLOW; +} + diff --git a/services/nginx/policies/invoker-token.conf b/services/nginx/policies/invoker-token.conf new file mode 100644 index 0000000000000000000000000000000000000000..8f385e0261bebc2931c05a74317e5a0131ff2961 --- /dev/null +++ b/services/nginx/policies/invoker-token.conf @@ -0,0 +1,4 @@ +map "$endpoint:$method" $invoker_token_policy { + default DENY; + invoker_onboarding_exact:POST ALLOW; +} diff --git a/services/nginx/policies/logging-mtls.conf b/services/nginx/policies/logging-mtls.conf new file mode 100644 index 0000000000000000000000000000000000000000..dc66bb4906bcd2aa3732deb3bf8b9345c0da0151 --- /dev/null +++ b/services/nginx/policies/logging-mtls.conf @@ -0,0 +1,6 @@ +map "$endpoint:$method:$role" $logging_service_mtls_policy { + default DENY; + # Logging policies that use mTLS for authentication + ~^logging_tree:POST:(aef|superadmin)$ ALLOW; +} + diff --git a/services/nginx/policies/provider-mtls.conf b/services/nginx/policies/provider-mtls.conf new file mode 100644 index 0000000000000000000000000000000000000000..d8db996eb54bcd979db2c6d981e3dee0d1d56a07 --- /dev/null +++ b/services/nginx/policies/provider-mtls.conf @@ -0,0 +1,7 @@ +map "$endpoint:$method:$role" $provider_mtls_policy { + default DENY; + #Provider policies that use mTLS for authentication + ~^provider_registrations_tree:(PUT|DELETE|PATCH):superadmin$ ALLOW; + ~^provider_registrations_tree:(PUT|DELETE|PATCH):amf$ ALLOW; +} + diff --git a/services/nginx/policies/provider-token.conf b/services/nginx/policies/provider-token.conf new file mode 100644 index 0000000000000000000000000000000000000000..3dac3cf3ef2e34340d8195085382fc3b95eb88f6 --- /dev/null +++ b/services/nginx/policies/provider-token.conf @@ -0,0 +1,4 @@ +map "$endpoint:$method" $provider_token_policy { + default DENY; + provider_registrations_exact:POST ALLOW; +} diff --git a/services/nginx/policies/publish-mtls.conf b/services/nginx/policies/publish-mtls.conf new file mode 100644 index 0000000000000000000000000000000000000000..368089f7c01298d1c2eaef7fbd774e955f72a1ce --- /dev/null +++ b/services/nginx/policies/publish-mtls.conf @@ -0,0 +1,6 @@ +map "$endpoint:$method:$role" $publish_service_mtls_policy { + default DENY; + #Publish policies that use mTLS for authentication + ~^published_apis_tree:(GET|POST|PUT|DELETE|PATCH):(apf|superadmin|ccf)$ ALLOW; +} + diff --git a/services/nginx/policies/security-mtls.conf b/services/nginx/policies/security-mtls.conf new file mode 100644 index 0000000000000000000000000000000000000000..f1879835f0bf37a6142cce18114d7f2e8438a4d8 --- /dev/null +++ b/services/nginx/policies/security-mtls.conf @@ -0,0 +1,14 @@ +map "$endpoint:$method:$role" $security_service_mtls_policy { + default DENY; + # Security policies that use mTLS for authentication + security_trusted_invokers_exact:DELETE:aef ALLOW; + security_trusted_invokers_exact:PUT:invoker ALLOW; + security_trusted_invokers_exact:GET:aef ALLOW; + security_update:POST:invoker ALLOW; + security_delete:POST:aef ALLOW; + security_token:POST:invoker ALLOW; + + ~^.*:.*:superadmin$ ALLOW; + +} + diff --git a/services/register/Dockerfile b/services/register/Dockerfile index 24676e54345f768d50155c78a4d4a218aa46cfe0..5bdb0347f7f835fa6659796a652b063622a8544e 100644 --- a/services/register/Dockerfile +++ b/services/register/Dockerfile @@ -15,7 +15,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ libxslt1-dev && \ rm -rf /var/lib/apt/lists/* RUN pip3 install --no-cache-dir -r requirements.txt -RUN apt-get update && apt-get install -y --no-install-recommends openssl curl redis +RUN apt-get update && apt-get install -y --no-install-recommends openssl curl redis jq COPY . /usr/src/app diff --git a/services/register/register_prepare.sh b/services/register/register_prepare.sh index 2ae8deff25fce905a937fa87767796a9685f8482..740cc241d6bf31700f9bdf6fd397ace6b6fbb972 100644 --- a/services/register/register_prepare.sh +++ b/services/register/register_prepare.sh @@ -2,45 +2,97 @@ CERTS_FOLDER="/usr/src/app/register_service/certs" cd $CERTS_FOLDER -openssl req -x509 \ - -sha256 -days 356 \ - -nodes \ - -newkey rsa:2048 \ - -subj "/CN=register/C=ES/L=Madrid" \ - -keyout /usr/src/app/register_service/certs/registerCA.key -out /usr/src/app/register_service/certs/registerCA.crt - - -openssl genrsa -out /usr/src/app/register_service/certs/register_key.key 2048 - -COUNTRY="ES" # 2 letter country-code -STATE="Madrid" # state or province name -LOCALITY="Madrid" # Locality Name (e.g. city) -ORGNAME="Telefonica I+D" # Organization Name (eg, company) -ORGUNIT="Innovation" # Organizational Unit Name (eg. section) -COMMONNAME="register" -EMAIL="inno@tid.es" # certificate's email address -# optional extra details -CHALLENGE="" # challenge password -COMPANY="" # company name - -# DAYS="-days 365" - -# create the certificate request -cat <<__EOF__ | openssl req -new $DAYS -key /usr/src/app/register_service/certs/register_key.key -out /usr/src/app/register_service/certs/register.csr -$COUNTRY -$STATE -$LOCALITY -$ORGNAME -$ORGUNIT -$COMMONNAME -$EMAIL -$CHALLENGE -$COMPANY -__EOF__ - -openssl x509 -req -in /usr/src/app/register_service/certs/register.csr -CA /usr/src/app/register_service/certs/registerCA.crt -CAkey /usr/src/app/register_service/certs/registerCA.key -CAcreateserial -out /usr/src/app/register_service/certs/register_cert.crt -days 365 -sha256 +# === CONFIGURATION === +VAULT_ADDR="http://$VAULT_HOSTNAME:$VAULT_PORT" +VAULT_TOKEN=$VAULT_ACCESS_TOKEN +COUNTRY="ES" # 2 letter country-code +STATE="Madrid" # state or province name +LOCALITY="Madrid" # Locality Name (e.g. city) +ORGNAME="Telefonica I+D" # Organization Name (eg, company) +ORGUNIT="Innovation" # Organizational Unit Name (eg. section) +COMMONNAME=${REGISTER_HOSTNAME:-register} +EMAIL="inno@tid.es" # certificate's email address +TTL="4300h" + +# ============================================================== +# 1) GENERATE PRIVATE KEY IF NOT EXISTS +# ============================================================== + +if [ ! -f register_key.key ]; then + echo "Generating private key for Register." + openssl genrsa -out register_key.key 2048 +else + echo "register_key.key already exists. Skipping generation." +fi + +# ============================================================== +# 2) GENERATE CSR +# ============================================================== + +echo "Creating CSR for CN=${COMMONNAME}." +openssl req -new -key register_key.key \ + -subj "/C=${COUNTRY}/ST=${STATE}/L=${LOCALITY}/O=${ORGNAME}/OU=${ORGUNIT}/CN=${COMMONNAME}/emailAddress=${EMAIL}" \ + -addext "subjectAltName=DNS:${COMMONNAME}" \ + -out register.csr + +# ============================================================== +# 3) DOWNLOAD CA FROM VAULT +# ============================================================== + +echo "Downloading CA chain from Vault." +curl -s -H "X-Vault-Token: ${VAULT_TOKEN}" \ + "${VAULT_ADDR}/v1/secret/data/ca" | jq -r '.data.data.ca' > ca_root.crt + +if [ ! -s ca_root.crt ]; then + echo "ERROR: could not retrieve CA from Vault." + exit 1 +fi + +echo "CA chain retrieved successfully." + +echo "CA certificate content:" +echo "-----------------------------------" +cat ca_root.crt +echo "-----------------------------------" + + +# ============================================================== +# 4) REQUEST SIGNATURE +# ============================================================== + +echo "Requesting certificate signature from Vault..." +CSR_CONTENT=$(awk '{printf "%s\\n", $0}' register.csr) + +curl -s -X POST \ + -H "X-Vault-Token: ${VAULT_TOKEN}" \ + -d "{\"csr\": \"${CSR_CONTENT}\", \"common_name\": \"${COMMONNAME}\", \"format\": \"pem_bundle\", \"ttl\": \"${TTL}\"}" \ + "${VAULT_ADDR}/v1/pki_int/sign/my-ca" \ + | jq -r '.data.certificate' | awk '{gsub("\\\\n","\n")}1' > register_cert.crt + +if [ ! -s register_cert.crt ]; then + echo "ERROR: could not retrieve signed certificate from Vault." + exit 1 +fi + +echo "Certificate signed successfully by Vault intermediate CA." + +# ============================================================== +# 5) VERIFY CERTIFICATE CHAIN +# ============================================================== + +echo "Verifying certificate chain." +openssl verify -CAfile ca_root.crt register_cert.crt || { + echo "WARNING: certificate verification failed" +} + +# ============================================================== +# 7) START REGISTER SERVICE +# ============================================================== + +echo "Starting Register service with signed certificate." gunicorn --certfile=/usr/src/app/register_service/certs/register_cert.crt \ --keyfile=/usr/src/app/register_service/certs/register_key.key \ + --ca-certs=/usr/src/app/register_service/certs/ca_root.crt \ --bind 0.0.0.0:8080 \ --chdir /usr/src/app/register_service wsgi:app \ No newline at end of file diff --git a/services/register/register_service/app.py b/services/register/register_service/app.py index 60447746c814411cd5659a2a70f810c8426e8277..839b3fd05699e758c5ee1551c59afc37a65bffad 100644 --- a/services/register/register_service/app.py +++ b/services/register/register_service/app.py @@ -2,6 +2,7 @@ import json import logging import os +import time import requests from config import Config @@ -9,7 +10,8 @@ from controllers.register_controller import register_routes from db.db import MongoDatabse from flask import Flask from flask_jwt_extended import JWTManager -from OpenSSL.crypto import FILETYPE_PEM, TYPE_RSA, PKey, X509Req, dump_certificate_request, dump_privatekey +from OpenSSL.crypto import (FILETYPE_PEM, TYPE_RSA, PKey, X509Req, + dump_certificate_request, dump_privatekey) from utils.auth_utils import hash_password app = Flask(__name__) @@ -79,12 +81,37 @@ cert_file = open("certs/ca_root.crt", 'wb') cert_file.write(bytes(ca_root, 'utf-8')) cert_file.close() -# Request CAPIF private key to encode the CAPIF token -url = 'http://{}:{}/v1/secret/data/server_cert/private'.format(config["ca_factory"]["url"], config["ca_factory"]["port"]) + +# ------------------------------------------------------------ +# Get CCF_ID from helper (internal docker network) +# ------------------------------------------------------------ +helper_url = "http://helper:8080/helper/api/getCcfId" +CCF_ID = None +max_retries = 30 +retry_delay = 2 + +for attempt in range(1, max_retries + 1): + try: + ccf_resp = requests.get(helper_url, timeout=5) + ccf_resp.raise_for_status() + CCF_ID = ccf_resp.json().get("ccf_id") + if CCF_ID: + print(f"[INFO] Got CCF_ID={CCF_ID}") + break + except Exception as e: + print(f"[WARN] Helper not ready (attempt {attempt}/{max_retries}): {e}") + + time.sleep(retry_delay) + +if not CCF_ID: + raise RuntimeError("Helper did not return ccf_id after retries") + + +url = 'http://{}:{}/v1/secret/data/capif/{}/nginx'.format(config["ca_factory"]["url"], config["ca_factory"]["port"], CCF_ID) headers = {'X-Vault-Token': f"{config["ca_factory"]["token"]}"} response = requests.request("GET", url, headers=headers, verify = config["ca_factory"].get("verify", False)) - -key_data = json.loads(response.text)["data"]["data"]["key"] +response.raise_for_status() +key_data = json.loads(response.text)["data"]["data"]["server_key"] # Create an Admin in the Admin Collection client = MongoDatabse() diff --git a/services/register/register_service/controllers/register_controller.py b/services/register/register_service/controllers/register_controller.py index 031185eb516748932dd5b402e5b9223bc9e5cdbb..7eec76a13a9ef00591a3b0a68d3788d840adeb98 100644 --- a/services/register/register_service/controllers/register_controller.py +++ b/services/register/register_service/controllers/register_controller.py @@ -31,6 +31,7 @@ def generate_tokens(username): } access_token = jwt.encode(access_payload, current_app.config['REGISTRE_SECRET_KEY'], algorithm='HS256') refresh_token = jwt.encode(refresh_payload, current_app.config['REGISTRE_SECRET_KEY'], algorithm='HS256') + # TODO: should we remove this log to avoid logging access/refresh tokens? current_app.logger.debug(f"Access token : {access_token}\nRefresh token : {refresh_token}") return access_token, refresh_token @@ -42,11 +43,11 @@ def verify_password(username, password): client = MongoDatabse() admin = client.get_col_by_name(client.capif_admins).find_one({"admin_name": username}) if admin and check_password(password, admin["admin_pass"]): - current_app.logger.debug(f"Verified admin {username}") + current_app.logger.info(f"Verified admin {username}") return username, "admin" for user in users: if user["username"] == username and check_password(password, user["password"]): - current_app.logger.debug(f"Verified user {username}") + current_app.logger.info(f"Verified user {username}") return username, "client" @@ -58,15 +59,16 @@ def admin_required(): current_app.logger.debug("Checking admin token...") token = request.headers.get('Authorization') if not token: - current_app.logger.debug("Token is missing.") + current_app.logger.warning("Token is missing.") return jsonify({'message': 'Token is missing'}), 401 if token.startswith('Bearer '): + # Token is not missing but provided with the "Bearer " prefix. Consider changing the following message accordingly or remove it. current_app.logger.debug("Token is missing.") token = token.split('Bearer ')[1] if not token: - current_app.logger.debug("Token is missing.") + current_app.logger.warning("Token is missing.") return jsonify({'message': 'Token is missing'}), 401 try: @@ -85,7 +87,7 @@ def admin_required(): def login(): username, rol = auth.current_user() if rol != "admin": - current_app.logger.debug(f"User {username} trying to log in as admin") + current_app.logger.warning(f"User {username} trying to log in as admin") return jsonify(message="Unauthorized. Administrator privileges required."), 401 access_token, refresh_token = generate_tokens(username) return jsonify({'access_token': access_token, 'refresh_token': refresh_token}) @@ -117,24 +119,26 @@ def register(username): } user_info = request.get_json() + # TODO: consider excluding sensitive fields (e.g. password) from logged user info even in debug mode. + # Example: log_user_info = {k: v for k, v in user_info.items() if k != "password"} current_app.logger.debug(f"User Info: {user_info}") missing_fields = [] for field, field_type in required_fields.items(): if field not in user_info: missing_fields.append(field) elif not isinstance(user_info[field], field_type): - current_app.logger.debug(f"Error: Field {field} must be of type {field_type.__name__}") + current_app.logger.warning(f"Error: Field {field} must be of type {field_type.__name__}") return jsonify({"error": f"Field '{field}' must be of type {field_type.__name__}"}), 400 for field, field_type in optional_fields.items(): if field in user_info and not isinstance(user_info[field], field_type): - current_app.logger.debug(f"Error: Field {field} must be of type {field_type.__name__}") + current_app.logger.warning(f"Error: Field {field} must be of type {field_type.__name__}") return jsonify({"error": f"Optional field '{field}' must be of type {field_type.__name__}"}), 400 if field not in user_info: user_info[field] = None if missing_fields: - current_app.logger.debug(f"Error: missing requuired fields : {missing_fields}") + current_app.logger.warning(f"Error: missing requuired fields : {missing_fields}") return jsonify({"error": "Missing required fields", "fields": missing_fields}), 400 return register_operation.register_user(user_info) diff --git a/services/register/register_service/core/register_operations.py b/services/register/register_service/core/register_operations.py index 8dc4a2eaea93bec8f4826ef69f20538b01e5b6d4..2244d3026ec9746c328f80e835ecf741a8a501aa 100644 --- a/services/register/register_service/core/register_operations.py +++ b/services/register/register_service/core/register_operations.py @@ -7,8 +7,9 @@ from config import Config from db.db import MongoDatabse from flask import current_app, jsonify from flask_jwt_extended import create_access_token -from utils.utils import convert_dict_keys_to_snake_case, to_snake_case, validate_snake_case_keys from utils.auth_utils import hash_password +from utils.utils import (convert_dict_keys_to_snake_case, to_snake_case, + validate_snake_case_keys) class RegisterOperations: @@ -23,7 +24,7 @@ class RegisterOperations: mycol = self.db.get_col_by_name(self.db.capif_users) exist_user = mycol.find_one({"username": user_info["username"]}) if exist_user: - current_app.logger.debug(f"User already exists : {user_info["username"]}") + current_app.logger.warning(f"User already exists : {user_info["username"]}") return jsonify("user already exists"), 409 name_space = uuid.UUID(self.config["register"]["register_uuid"]) @@ -35,7 +36,7 @@ class RegisterOperations: user_info["password"] = hash_password(user_info["password"]) mycol.insert_one(user_info) - current_app.logger.debug(f"User with uuid {user_uuid} and username {user_info["username"]} registered successfully") + current_app.logger.info(f"User with uuid {user_uuid} and username {user_info["username"]} registered successfully") return jsonify(message="User registered successfully", uuid=user_uuid), 201 @@ -48,10 +49,11 @@ class RegisterOperations: exist_user = mycol.find_one({"username": username}) if exist_user is None: - current_app.logger.debug(f"No user exists with these credentials: {username}") + current_app.logger.warning(f"No user exists with these credentials: {username}") return jsonify("No user exists with these credentials"), 400 access_token = create_access_token(identity=(username + " " + exist_user["uuid"])) + # TODO: should we remove this log to avoid logging access/refresh tokens? current_app.logger.debug(f"Access token generated for user {username} : {access_token}") cert_file = open("certs/ca_root.crt", 'rb') @@ -70,6 +72,8 @@ class RegisterOperations: ccf_security_url="capif-security/v1/trustedInvokers/"), 200 except Exception as e: + # TODO: consider logging exceptions here for troubleshooting. + # Example: current_app.logger.exception(f"Unexpected error in get_auth for user {username}") return jsonify(message=f"Errors when try getting auth: {e}"), 500 def remove_user(self, uuid): @@ -83,20 +87,25 @@ class RegisterOperations: current_app.logger.debug(f"Removing User with uuid {uuid} from db") mycol.delete_one({"uuid": uuid}) - current_app.logger.debug(f"User with uuid {uuid} removed successfully") + current_app.logger.info(f"User with uuid {uuid} removed successfully") return jsonify(message="User removed successfully"), 204 except Exception as e: + # TODO: consider logging exceptions here for troubleshooting. + # Example: current_app.logger.exception(f"Unexpected error in remove_user for uuid {uuid}") return jsonify(message=f"Errors when try remove user: {e}"), 500 def get_users(self): mycol = self.db.get_col_by_name(self.db.capif_users) try: + # TODO: consider excluding sensitive fields (e.g. password) from logged user info even in debug mode. current_app.logger.debug(f"users") users=list(mycol.find({}, {"_id":0})) current_app.logger.debug(f"{users}") return jsonify(message="Users successfully obtained", users=users), 200 except Exception as e: + # TODO: consider logging exceptions here for troubleshooting. + # Example: current_app.logger.exception(f"Unexpected error in get_users") return jsonify(message=f"Error trying to get users: {e}"), 500 diff --git a/services/register/requirements.txt b/services/register/requirements.txt index dc9b58d927d0c1928015d35feeb6d242dee4ac49..2d5ea17f369c7ebb077319fba46c9582651ad2a9 100644 --- a/services/register/requirements.txt +++ b/services/register/requirements.txt @@ -1,9 +1,9 @@ python_dateutil >= 2.6.0 -setuptools == 74.0.0 +setuptools == 80.9.0 Flask == 3.0.3 pymongo == 4.7.3 flask_jwt_extended == 4.6.0 -pyopenssl == 24.1.0 +pyopenssl == 25.3.0 pyyaml == 6.0.1 requests == 2.32.2 bcrypt == 4.3.0 diff --git a/services/run.sh b/services/run.sh index 9f2983bb3c3d79045a1f22764eaa5e5e9a296ffb..5acc9afe69c71235ce234378b6bbe2f1236b3027 100755 --- a/services/run.sh +++ b/services/run.sh @@ -4,6 +4,7 @@ source $(dirname "$(readlink -f "$0")")/variables.sh help() { echo "Usage: $1 " echo " -c : Setup different hostname for capif" + echo " -R : Setup different hostname for register service" echo " -s : Run Mock server. Default true" echo " -m : Run monitoring service" echo " -l : Set Log Level (default DEBUG). Select one of: [CRITICAL, FATAL, ERROR, WARNING, WARN, INFO, DEBUG, NOTSET]" @@ -40,6 +41,9 @@ while getopts ":c:l:ms:hrv:f:g:b:" opt; do c) CAPIF_HOSTNAME="$OPTARG" ;; + R) + CAPIF_REGISTER="$OPTARG" + ;; m) MONITORING_STATE=true ;; @@ -78,7 +82,7 @@ while getopts ":c:l:ms:hrv:f:g:b:" opt; do esac done -echo Nginx hostname will be $CAPIF_HOSTNAME, deploy $DEPLOY, monitoring $MONITORING_STATE +echo Nginx hostname will be $CAPIF_HOSTNAME, Register Hostname $CAPIF_REGISTER, deploy $DEPLOY, monitoring $MONITORING_STATE if [ "$BUILD_DOCKER_IMAGES" == "true" ] ; then echo '***Building Docker images set as true***' @@ -139,7 +143,7 @@ yq eval ".ccf.url = \"$CAPIF_HOSTNAME\"" -i "$REGISTER_CONFIG_FILE" -P # Deploy Register service CAPIF_PRIV_KEY_BASE_64=$(echo "$(cat ${SERVICES_DIR}/nginx/certs/server.key)") -REGISTRY_BASE_URL=$REGISTRY_BASE_URL SERVICES_DIR=$SERVICES_DIR OCF_VERSION=$OCF_VERSION CAPIF_PRIV_KEY=$CAPIF_PRIV_KEY_BASE_64 LOG_LEVEL=$LOG_LEVEL docker compose -f "$SERVICES_DIR/docker-compose-register.yml" up --detach $BUILD $CACHED_INFO +REGISTRY_BASE_URL=$REGISTRY_BASE_URL SERVICES_DIR=$SERVICES_DIR OCF_VERSION=$OCF_VERSION CAPIF_PRIV_KEY=$CAPIF_PRIV_KEY_BASE_64 LOG_LEVEL=$LOG_LEVEL CAPIF_REGISTER=$CAPIF_REGISTER docker compose -f "$SERVICES_DIR/docker-compose-register.yml" up --detach $BUILD $CACHED_INFO status=$? if [ $status -eq 0 ]; then diff --git a/services/vault/vault_prepare_certs.sh b/services/vault/vault_prepare_certs.sh index f1e1c5aaa1eff9c7eebef4509df5b65261126a85..0be8b85d72fc22dec8f0731833ff7045e7aa165e 100755 --- a/services/vault/vault_prepare_certs.sh +++ b/services/vault/vault_prepare_certs.sh @@ -9,100 +9,94 @@ echo "CAPIF_HOSTNAME: $CAPIF_HOSTNAME" echo "VAULT_ADDR: $VAULT_ADDR" echo "VAULT_TOKEN: $VAULT_TOKEN" +# Enable PKI secrets engine, default path is pki/ vault secrets enable pki -# Generate a root CA + +############################################################ +# 1) ROOT CA +############################################################ + +# Modify pki engine settings vault secrets tune -max-lease-ttl=87600h pki -vault write -field=certificate pki/root/generate/internal \ +# Create a root CA with a common name of "capif" and an issuer name of "root-2026". The certificate will be valid for 87600 hours (10 years). +# pki/root/generate/internal => vault generates and store the root CA private key internally and returns the certificate. +vault write -field=certificate \ + pki/root/generate/internal \ common_name="capif" \ - issuer_name="root-2023" \ - ttl=87600h > root_2023_ca.crt + issuer_name="root-2026" \ + ttl=87600h > root_2026_ca.crt +# Configure the URLs that Vault will include in the issued certificates: +# issuing_certificates: where the CA certificate is published. crl_distribution_points: where the CRL (Certificate Revocation List) is published. vault write pki/config/urls \ issuing_certificates="$VAULT_ADDR/v1/pki/ca" \ crl_distribution_points="$VAULT_ADDR/v1/pki/crl" -# Generate an intermediate CA + +############################################################ +# 2) INTERMEDIATE CA +############################################################ + +# Enable another PKI engine, but at path pki_int. vault secrets enable -path=pki_int pki +# Adjust the maximum TTL of the intermediate engine. vault secrets tune -max-lease-ttl=43800h pki_int +# Generate a CSR for the intermediate CA. This will create a new private key for the intermediate CA and return a CSR that we will sign with the root CA. The CSR is saved in a file called pki_intermediate.csr. vault write -format=json pki_int/intermediate/generate/internal \ common_name="capif Intermediate Authority" \ issuer_name="capif-intermediate" \ | jq -r '.data.csr' > pki_intermediate.csr -# Sign the intermediate CA -vault write -format=json pki/root/sign-intermediate \ - issuer_ref="root-2023" \ +# Sign the intermediate CA with the root CA --> capif_intermediate.cert.pem +vault write -format=json \ + pki/root/sign-intermediate \ + issuer_ref="root-2026" \ csr=@pki_intermediate.csr \ format=pem_bundle ttl="43800h" \ | jq -r '.data.certificate' > capif_intermediate.cert.pem -# Configure the intermediate CA +# vault write pki_int/intermediate/set-signed certificate=@capif_intermediate.cert.pem vault write pki_int/intermediate/set-signed certificate=@capif_intermediate.cert.pem -# Configure the role for the intermediate CA -vault write pki_int/roles/my-ca use_csr_common_name=false require_cn=true use_csr_sans=false allowed_domains=$CAPIF_HOSTNAME allow_any_name=true allow_bare_domains=true allow_glob_domains=true allow_subdomains=true max_ttl=4300h - -# Generate a certificate -openssl genrsa -out ./server.key 2048 - - -COUNTRY="ES" # 2 letter country-code -STATE="Madrid" # state or province name -LOCALITY="Madrid" # Locality Name (e.g. city) -ORGNAME="Telefonica I+D" # Organization Name (eg, company) -ORGUNIT="Innovation" # Organizational Unit Name (eg. section) -COMMONNAME="$CAPIF_HOSTNAME" -EMAIL="inno@tid.es" # certificate's email address -# optional extra details -CHALLENGE="" # challenge password -COMPANY="" # company name - -# DAYS="-days 365" - -# create the certificate request -cat <<__EOF__ | openssl req -new $DAYS -key ./server.key -out ./server.csr -$COUNTRY -$STATE -$LOCALITY -$ORGNAME -$ORGUNIT -$COMMONNAME -$EMAIL -$CHALLENGE -$COMPANY -__EOF__ - - -vault write -format=json pki_int/sign/my-ca format=pem_bundle ttl="43000h" csr=@server.csr common_name="$CAPIF_HOSTNAME" | jq -r '.data.issuing_ca as $issuing_ca | .data.certificate as $certificate | [$issuing_ca, $certificate]' > cert_data.json - -jq -r '.[0]' cert_data.json > root_ca.crt.pem -jq -r '.[1]' cert_data.json > server_certificate.crt.pem +############################################################ +# 3) CONFIGURE SIGNING ROLE +############################################################ -openssl x509 -pubkey -noout -in server_certificate.crt.pem > server_certificate_pub.pem +# Creates a role named my-ca within pki_int. This role defines the rules for issuing certificates. +vault write pki_int/roles/my-ca \ + use_csr_common_name=false \ + require_cn=false \ + use_csr_sans=false \ + allow_any_name=true \ + allow_bare_domains=true \ + allow_glob_domains=true \ + allow_subdomains=true \ + max_ttl=4300h -# Concatenate the root and intermediate CA certificates -cat > certificados_concatenados.crt << EOF -$(cat "root_2023_ca.crt") -$(cat "root_ca.crt.pem") -EOF +# ============================================================ +# 4) CA BUNDLE +# ============================================================ -vault kv put secret/ca ca=@certificados_concatenados.crt +# Save the intermediate and root certificates in a single file (CA bundle) so that nginx can use it as a trust chain. +vault kv put secret/ca ca=@capif_intermediate.cert.pem -vault kv put secret/server_cert cert=@server_certificate.crt.pem +echo "[INFO] CA bundle stored at secret/ca" -vault kv put secret/server_cert/pub pub_key=@server_certificate_pub.pem -vault kv put secret/server_cert/private key=@server.key +# ============================================================ +# OPTIONAL: Create read-only token for CA access +# ============================================================ +# variables for creating a read-only policy and token for the CA POLICY_NAME="my-policy" POLICY_FILE="my-policy.hcl" TOKEN_ID="read-ca-token" -# Create a policy to read the CA +# Create a HCL file with the read-only policy for the CA echo "path \"secret/data/ca\" { capabilities = [\"read\"] }" > "$POLICY_FILE" diff --git a/tests/features/CAPIF Api Invoker Management/capif_api_invoker_managenet.robot b/tests/features/CAPIF Api Invoker Management/capif_api_invoker_managenet.robot index 57005b56f14de5b2ea84665106f3142c7b07c3d9..3052e19447524d5aa45797bbe9d0358e0b8c6240 100644 --- a/tests/features/CAPIF Api Invoker Management/capif_api_invoker_managenet.robot +++ b/tests/features/CAPIF Api Invoker Management/capif_api_invoker_managenet.robot @@ -182,3 +182,58 @@ Update Onboarded Network App Certificate # Check Results Check Response Variable Type And Values ${resp} 200 APIInvokerEnrolmentDetails ... notificationDestination=${new_notification_destination} + +Onboard invoker without supported_features + [Tags] capif_api_invoker_management-8 + # Default Invoker Registration and Onboarding + ${register_user_info}= Register User At Jwt Auth + ... username=${invoker_username} role=${INVOKER_ROLE} + + ${request_body}= Create Onboarding Notification Body + ... http://${CAPIF_CALLBACK_IP}:${CAPIF_CALLBACK_PORT}/netapp_callback + ... ${register_user_info['csr_request']} + ... ${invoker_username} + ... supported_features=${None} + + ${resp}= Post Request Capif + ... ${register_user_info['ccf_onboarding_url']} + ... json=${request_body} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... access_token=${register_user_info['access_token']} + + # Check Results + Check Response Variable Type And Values ${resp} 400 ProblemDetails + ... status=400 + ... title=Bad Request + ... detail=supportedFeatures not present in request + ... cause=supportedFeatures not present + +Update Onboarded Network App without supported_features + [Tags] capif_api_invoker_management-9 + ${new_notification_destination}= Set Variable + ... http://${CAPIF_CALLBACK_IP}:${CAPIF_CALLBACK_PORT}/netapp_new_callback + # Default Invoker Registration and Onboarding + ${register_user_info} ${url} ${request_body}= Invoker Default Onboarding + + Set To Dictionary + ... ${request_body} + ... notificationDestination=${new_notification_destination} + + Remove From Dictionary + ... ${request_body} + ... supportedFeatures + + ${resp}= Put Request Capif + ... ${url.path} + ... ${request_body} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${INVOKER_USERNAME} + + # Check Results + Check Response Variable Type And Values ${resp} 400 ProblemDetails + ... status=400 + ... title=Bad Request + ... detail=supportedFeatures not present in request + ... cause=supportedFeatures not present diff --git a/tests/features/CAPIF Api Provider Management/capif_api_provider_management.robot b/tests/features/CAPIF Api Provider Management/capif_api_provider_management.robot index bda73735c2bd023f1abc3bbfba4c73e40eff31c4..44ba9ffe0e13c141ee3e6556da1bde88976374b8 100644 --- a/tests/features/CAPIF Api Provider Management/capif_api_provider_management.robot +++ b/tests/features/CAPIF Api Provider Management/capif_api_provider_management.robot @@ -203,3 +203,70 @@ Delete Not Registered Api Provider ... title=Not Found ... detail=Not Exist Provider Enrolment Details ... cause=Not found registrations to send this api provider details + +Onboard provider without supported_features + [Tags] capif_api_provider_management-9 + # Default Provider Registration and Onboarding + ${register_user_info}= Register User At Jwt Auth Provider + ... username=${PROVIDER_USERNAME} + + # Create provider Registration Body + ${apf_func_details}= Create Api Provider Function Details + ... ${register_user_info['apf_username']} + ... ${register_user_info['apf_csr_request']} + ... APF + ${aef_func_details}= Create Api Provider Function Details + ... ${register_user_info['aef_username']} + ... ${register_user_info['aef_csr_request']} + ... AEF + ${amf_func_details}= Create Api Provider Function Details + ... ${register_user_info['amf_username']} + ... ${register_user_info['amf_csr_request']} + ... AMF + ${api_prov_funcs}= Create List ${apf_func_details} ${aef_func_details} ${amf_func_details} + + ${request_body}= Create Api Provider Enrolment Details Body + ... ${register_user_info['access_token']} + ... ${api_prov_funcs} + ... suppFeat=${None} + + # Register Provider + ${resp}= Post Request Capif + ... /api-provider-management/v1/registrations + ... json=${request_body} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... access_token=${register_user_info['access_token']} + + # Check Results + Check Response Variable Type And Values ${resp} 400 ProblemDetails + ... status=400 + ... title=Bad Request + ... detail=suppFeat not present in request + ... cause=suppFeat not present + +Update Registered Api Provider + [Tags] capif_api_provider_management-10 + ${register_user_info}= Provider Default Registration + + ${request_body}= Set Variable ${register_user_info['provider_enrollment_details']} + + Set To Dictionary ${request_body} apiProvDomInfo=ROBOT_TESTING_MOD + + Remove From Dictionary + ... ${request_body} + ... suppFeat + + ${resp}= Put Request Capif + ... ${register_user_info['resource_url'].path} + ... json=${request_body} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${AMF_PROVIDER_USERNAME} + + # Check Results + Check Response Variable Type And Values ${resp} 400 ProblemDetails + ... status=400 + ... title=Bad Request + ... detail=suppFeat not present in request + ... cause=suppFeat not present diff --git a/tests/features/Helper/Control Api/__init__.robot b/tests/features/Helper/Control Api/__init__.robot new file mode 100644 index 0000000000000000000000000000000000000000..f9d8bb138da27a8e700e652ea761af091903a8b2 --- /dev/null +++ b/tests/features/Helper/Control Api/__init__.robot @@ -0,0 +1,2 @@ +*** Settings *** +Force Tags api \ No newline at end of file diff --git a/tests/features/Helper/Control Api/api.robot b/tests/features/Helper/Control Api/api.robot new file mode 100644 index 0000000000000000000000000000000000000000..cf7101c9dc9e764fcf4b617d6713ca2d3b9d9df3 --- /dev/null +++ b/tests/features/Helper/Control Api/api.robot @@ -0,0 +1,29 @@ +*** Settings *** +Resource /opt/robot-tests/tests/resources/common.resource +Library /opt/robot-tests/tests/libraries/bodyRequests.py +Library XML +Library String +Resource /opt/robot-tests/tests/resources/common/basicRequests.robot +Resource /opt/robot-tests/tests/resources/common.resource +Resource /opt/robot-tests/tests/resources/common/basicRequests.robot + +Suite Teardown Reset Testing Environment +Test Setup Reset Testing Environment +Test Teardown Reset Testing Environment + + +*** Variables *** +${API_INVOKER_NOT_REGISTERED} not-valid +${SUBSCRIBER_ID_NOT_VALID} not-valid +${SUBSCRIPTION_ID_NOT_VALID} not-valid + + +*** Test Cases *** +Obtain ccfId + [Tags] api_1 smoke + + ${ccfId}= Get Capif Ccf Id + + Log CCF ID obtained: ${ccfId} + Should Match Regexp ${ccfId} ^CCF[a-zA-Z0-9]+ + \ No newline at end of file diff --git a/tests/features/Helper/Visibility Control Api/__init__.robot b/tests/features/Helper/Visibility Control Api/__init__.robot new file mode 100644 index 0000000000000000000000000000000000000000..18227ad26f8ef47f553308f5c0d56a57fd263238 --- /dev/null +++ b/tests/features/Helper/Visibility Control Api/__init__.robot @@ -0,0 +1,2 @@ +*** Settings *** +Force Tags visibility_control \ No newline at end of file diff --git a/tests/features/Helper/Visibility Control Api/visibility_control.robot b/tests/features/Helper/Visibility Control Api/visibility_control.robot new file mode 100644 index 0000000000000000000000000000000000000000..e1436d9d692d6f71b342c1d97bfe749e476de4ff --- /dev/null +++ b/tests/features/Helper/Visibility Control Api/visibility_control.robot @@ -0,0 +1,285 @@ +*** Settings *** +Resource /opt/robot-tests/tests/resources/common.resource +Library /opt/robot-tests/tests/libraries/bodyRequests.py +Library XML +Library String +Resource /opt/robot-tests/tests/resources/common/basicRequests.robot +Resource /opt/robot-tests/tests/resources/common.resource +Resource /opt/robot-tests/tests/resources/common/basicRequests.robot + +Suite Teardown Reset Testing Environment +Test Setup Reset Testing Environment +Test Teardown Reset Testing Environment + + +*** Variables *** +${API_INVOKER_NOT_REGISTERED} not-valid +${SUBSCRIBER_ID_NOT_VALID} not-valid +${SUBSCRIPTION_ID_NOT_VALID} not-valid + + +*** Test Cases *** +Get Visibility Control Rules as Superadmin + [Tags] visibility_control-1 + + ${resp}= Get Request Capif + ... /helper/visibility-control/rules + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${SUPERADMIN_USERNAME} + + Length Should Be ${resp.json()['rules']} 0 + +Create Visibility Control Rule Invalid Dates as Superadmin + [Tags] visibility_control-2 + + ${body}= Create Visibility Control Rule Body Invalid Dates + + ${resp}= Post Request Capif + ... /helper/visibility-control/rules + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${SUPERADMIN_USERNAME} + ... json=${body} + + Status Should Be 400 ${resp} + +Create Visibility Control Rule + [Tags] visibility_control-3 + ${body}= Create Visibility Control Rule Body + + ${resp}= Post Request Capif + ... /helper/visibility-control/rules + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${SUPERADMIN_USERNAME} + ... json=${body} + + ${rule_id}= Set Variable ${resp.json()['ruleId']} + + ${resp}= Get Request Capif + ... /helper/visibility-control/rules + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${SUPERADMIN_USERNAME} + + Length Should Be ${resp.json()['rules']} 1 + + ${resp}= Delete Request Capif + ... /helper/visibility-control/rules/${rule_id} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${SUPERADMIN_USERNAME} + + ${resp}= Get Request Capif + ... /helper/visibility-control/rules + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${SUPERADMIN_USERNAME} + + Length Should Be ${resp.json()['rules']} 0 + + +Get Visibility Control Rule by AMF Provider + [Tags] visibility_control-4 + + ${register_user_info}= Provider Default Registration + + ${resp}= Get Request Capif + ... /helper/visibility-control/rules + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${AMF_PROVIDER_USERNAME} + + Status Should Be 200 ${resp} + +Create Visibility Control Rule by AMF Provider and DELETE by useradmin + [Tags] visibility_control-5 + + ${register_user_info}= Provider Default Registration + + ${body}= Create Visibility Control Rule Body + + ${resp}= Post Request Capif + ... /helper/visibility-control/rules + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${AMF_PROVIDER_USERNAME} + ... json=${body} + + Status Should Be 201 ${resp} + + ${rule_id}= Set Variable ${resp.json()['ruleId']} + + ${resp}= Get Request Capif + ... /helper/visibility-control/rules + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${SUPERADMIN_USERNAME} + + Length Should Be ${resp.json()['rules']} 1 + + ${resp}= Delete Request Capif + ... /helper/visibility-control/rules/${rule_id} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${SUPERADMIN_USERNAME} + + Status Should Be 204 ${resp} + + # Check empty list + ${resp}= Get Request Capif + ... /helper/visibility-control/rules + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${SUPERADMIN_USERNAME} + + Length Should Be ${resp.json()['rules']} 0 + +Create and Delete Visibility Control Rule by AMF Provider + [Tags] visibility_control-6 + + ${register_user_info}= Provider Default Registration + + ${body}= Create Visibility Control Rule Body + + ${resp}= Post Request Capif + ... /helper/visibility-control/rules + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${AMF_PROVIDER_USERNAME} + ... json=${body} + + Status Should Be 201 ${resp} + + ${rule_id}= Set Variable ${resp.json()['ruleId']} + + ${resp}= Get Request Capif + ... /helper/visibility-control/rules + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${AMF_PROVIDER_USERNAME} + + Length Should Be ${resp.json()['rules']} 1 + + ${resp}= Delete Request Capif + ... /helper/visibility-control/rules/${rule_id} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${AMF_PROVIDER_USERNAME} + + Status Should Be 204 ${resp} + + # Check empty list + ${resp}= Get Request Capif + ... /helper/visibility-control/rules + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${AMF_PROVIDER_USERNAME} + + Length Should Be ${resp.json()['rules']} 0 + +Create Update and Delete Visibility Control Rule by AMF Provider + [Tags] visibility_control-7 + + ${register_user_info}= Provider Default Registration + + ${body}= Create Visibility Control Rule Body + + ${resp}= Post Request Capif + ... /helper/visibility-control/rules + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${AMF_PROVIDER_USERNAME} + ... json=${body} + + Status Should Be 201 ${resp} + + ${rule_id}= Set Variable ${resp.json()['ruleId']} + + ${resp}= Get Request Capif + ... /helper/visibility-control/rules + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${AMF_PROVIDER_USERNAME} + + Length Should Be ${resp.json()['rules']} 1 + + ${body}= Create Visibility Control Rule body 2 + + ${resp}= Patch Request Capif + ... /helper/visibility-control/rules/${rule_id} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${AMF_PROVIDER_USERNAME} + ... json=${body} + + Status Should Be 200 ${resp} + + ${resp}= Delete Request Capif + ... /helper/visibility-control/rules/${rule_id} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${AMF_PROVIDER_USERNAME} + + Status Should Be 204 ${resp} + + # Check empty list + ${resp}= Get Request Capif + ... /helper/visibility-control/rules + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${AMF_PROVIDER_USERNAME} + + Length Should Be ${resp.json()['rules']} 0 + +Create and Get Specific Visibility Control Rule + [Tags] visibility_control-8 + + # 1. Prepare the request body + ${body}= Create Visibility Control Rule Body + + # 2. Create a new rule using superadmin + ${resp}= Post Request Capif + ... /helper/visibility-control/rules + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${SUPERADMIN_USERNAME} + ... json=${body} + + # Verify creation was successful (201 Created) + Status Should Be 201 ${resp} + ${rule_id}= Set Variable ${resp.json()['ruleId']} + + # 3. Get the specific rule by its ID + ${resp}= Get Request Capif + ... /helper/visibility-control/rules/${rule_id} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${SUPERADMIN_USERNAME} + + # Validation: Specific GET returns the rule object directly. + # We verify the status is 200 OK and the ruleId matches. + Status Should Be 200 ${resp} + Should Be Equal As Strings ${resp.json()['ruleId']} ${rule_id} + + # 4. Delete the specific rule + ${resp}= Delete Request Capif + ... /helper/visibility-control/rules/${rule_id} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${SUPERADMIN_USERNAME} + + # Verify deletion was successful (204 No Content) + Status Should Be 204 ${resp} + + # 5. Verify the rule no longer exists + ${resp}= Get Request Capif + ... /helper/visibility-control/rules/${rule_id} + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${SUPERADMIN_USERNAME} + + # After deletion, the server must return 404 Not Found. + # This is the correct way to confirm the resource is gone. + Status Should Be 404 ${resp} diff --git a/tests/features/Helper/__init__.robot b/tests/features/Helper/__init__.robot new file mode 100644 index 0000000000000000000000000000000000000000..9be83f5a8eb2d147cffcbbd0439875f9d6ec19f0 --- /dev/null +++ b/tests/features/Helper/__init__.robot @@ -0,0 +1,2 @@ +*** Settings *** +Force Tags helper \ No newline at end of file diff --git a/tests/libraries/api_invoker_management/bodyRequests.py b/tests/libraries/api_invoker_management/bodyRequests.py index 37b9456d03bf96cdf511bc1639ebaf3126ab2777..aebcff7c50f2253dd01b7df3d856f48aaaa1715c 100644 --- a/tests/libraries/api_invoker_management/bodyRequests.py +++ b/tests/libraries/api_invoker_management/bodyRequests.py @@ -1,7 +1,6 @@ -def create_onboarding_notification_body(notification_destination="https://host.docker.internal/netapp_callback", api_invoker_public_key="ApiInvokerPublicKey",api_invoker_information='ROBOT_TESTING', api_invoker_id=None): +def create_onboarding_notification_body(notification_destination="https://host.docker.internal/netapp_callback", api_invoker_public_key="ApiInvokerPublicKey",api_invoker_information='ROBOT_TESTING', api_invoker_id=None, supported_features="0"): data = { "notificationDestination": notification_destination, - "supportedFeatures": "fffffff", "apiInvokerInformation": api_invoker_information, "websockNotifConfig": { "requestWebsocketUri": True, @@ -17,4 +16,7 @@ def create_onboarding_notification_body(notification_destination="https://host.d if api_invoker_id != None: data['apiInvokerId'] = api_invoker_id + if supported_features != None: + data['supportedFeatures'] = supported_features + return (data) diff --git a/tests/libraries/api_provider_management/bodyRequests.py b/tests/libraries/api_provider_management/bodyRequests.py index e024a5b946e2464b5a57202d8642a512a59e27d1..b80330b4d8d43820fc4cc45923118b03b6e752cf 100644 --- a/tests/libraries/api_provider_management/bodyRequests.py +++ b/tests/libraries/api_provider_management/bodyRequests.py @@ -1,12 +1,14 @@ -def create_api_provider_enrolment_details_body(regSec, api_prov_funcs, apiProvDomInfo="ROBOT_TESTING"): +def create_api_provider_enrolment_details_body(regSec, api_prov_funcs, apiProvDomInfo="ROBOT_TESTING", suppFeat="0"): data = { "regSec": regSec, "apiProvFuncs": api_prov_funcs, "apiProvDomInfo": apiProvDomInfo, - "suppFeat": "fffffff", "failReason": "string" } + if suppFeat != None: + data['suppFeat'] = suppFeat + return (data) diff --git a/tests/libraries/bodyRequests.py b/tests/libraries/bodyRequests.py index 450ca5ae2a24503e07a8fe436bf79c46e2796be5..cc909bcdf83cbde05ee0867f9f813f4cb4ca3dc8 100644 --- a/tests/libraries/bodyRequests.py +++ b/tests/libraries/bodyRequests.py @@ -7,3 +7,4 @@ from security_api.bodyRequests import * from api_provider_management.bodyRequests import * from vendor_extensibility.bodyRequests import * from vault_requests.bodyRequests import * +from helper_service.bodyRequests import * diff --git a/tests/libraries/helper_service/bodyRequests.py b/tests/libraries/helper_service/bodyRequests.py new file mode 100644 index 0000000000000000000000000000000000000000..ffa9960321478ec3b13a493eb9e71120e8c8bfd8 --- /dev/null +++ b/tests/libraries/helper_service/bodyRequests.py @@ -0,0 +1,44 @@ +def create_visibility_control_rule_body_invalid_dates(): + return { + "default_access": "ALLOW", + "enabled": True, + "startsAt": "2026-01-23T12:00:00Z", + "endsAt": "2025-01-23T08:00:00Z", + "providerSelector": { + "apiName": ["api-test-error"], + "userName": "AMF_ROBOT_TESTING_PROVIDER" + } + } + + +def create_visibility_control_rule_body(): + return { + "default_access": "ALLOW", + "enabled": True, + "invokerExceptions": { + "apiInvokerId": ["invk-X77"] + }, + "providerSelector": { + "aefId": ["aef-002"], + "apiId": ["apiId-999"], + "apiName": ["api-test-cli"], + "apiProviderId": ["capif-prov-01"], + "userName": "AMF_ROBOT_TESTING_PROVIDER" + } + } + +def create_visibility_control_rule_body_2(): + return { + "default_access": "DENY", + "enabled": True, + "invokerExceptions": { + "apiInvokerId": ["invk-X77"] + }, + "providerSelector": { + "aefId": ["aef-002"], + "apiId": ["apiId-999"], + "apiName": ["api-test-cli"], + "apiProviderId": ["capif-prov-01"], + "userName": "AMF_ROBOT_TESTING_PROVIDER" + } + } \ No newline at end of file diff --git a/tests/resources/common/basicRequests.robot b/tests/resources/common/basicRequests.robot index 2fcd189414190fd1af2e8d42cccfd01720c0484b..e02a9c93e2c54d9be3be1ee1871c20fb48abb3cb 100644 --- a/tests/resources/common/basicRequests.robot +++ b/tests/resources/common/basicRequests.robot @@ -958,7 +958,7 @@ Create Security Context Between invoker and provider Get Number Of Services ${resp}= Get Request Capif - ... /helper/getServices + ... /helper/api/getServices ... server=${CAPIF_HTTPS_URL} ... verify=ca.crt ... username=${SUPERADMIN_USERNAME} @@ -967,3 +967,16 @@ Get Number Of Services ${size}= Get Length ${resp.json()['services']} RETURN ${size} + +Get Capif Ccf Id + ${resp}= Get Request Capif + ... /helper/api/getCcfId + ... server=${CAPIF_HTTPS_URL} + ... verify=ca.crt + ... username=${SUPERADMIN_USERNAME} + + Should Be Equal As Integers ${resp.status_code} 200 + ${ccfId}= Get From Dictionary ${resp.json()} ccf_id + Set Suite Variable ${CCF_ID} ${ccfId} + + RETURN ${ccfId} diff --git a/tests/tasks/Users Management/users.robot b/tests/tasks/Users Management/users.robot index 64991b50efb2638a1495b081c9fc73744ca75dfa..a504f9de3b0c62da92c62231cd088db2a77e4430 100644 --- a/tests/tasks/Users Management/users.robot +++ b/tests/tasks/Users Management/users.robot @@ -99,7 +99,7 @@ Remove Client Users By Prefix ${users_to_remove}= Filter Users By Prefix Username users=${users} prefix=${USERNAME_PREFIX} - Log Dictionary ${users_to_remove} + Log List ${users_to_remove} FOR ${username} IN @{users_to_remove} Log Removing ${username} diff --git a/tools/base_images_scripts/push_base_images_ocf.sh b/tools/base_images_scripts/push_base_images_ocf.sh index 2a9d472e49fa4006646d05e10bd4c3caacf7b596..4bbc12c1cc9d133e50ca80640ddac064f85a0c91 100755 --- a/tools/base_images_scripts/push_base_images_ocf.sh +++ b/tools/base_images_scripts/push_base_images_ocf.sh @@ -10,7 +10,8 @@ BASIC_IMAGES=("python:3-slim-bullseye" "ubuntu:20.04" "redis:7.4.2-alpine" "mongo-express:1.0.0-alpha.4" -"mongo:6.0.2") +"mongo:6.0.2" +"busybox:1.37.0") docker login labs.etsi.org:5050 for basic_image in "${BASIC_IMAGES[@]}"; do diff --git a/tools/compare_versions/README.md b/tools/compare_versions/README.md new file mode 100644 index 0000000000000000000000000000000000000000..9512b1fbaa1f85fe45a3bcaf32b64a64a03081ee --- /dev/null +++ b/tools/compare_versions/README.md @@ -0,0 +1,118 @@ +# CAPIF Services Scripts + +This repository contains two Bash scripts to **generate CAPIF services code** from OpenAPI definitions and to **compare two versions** of the generated services. + +--- + +## 1. `capif_build.sh` + +This script wraps `openapi-generator` to build Python Flask code from the CAPIF service YAML definitions. +It allows generating all services or just one specific service. + +### Requirements +- `bash` (>= 4.0 recommended) +- [`openapi-generator`](https://openapi-generator.tech/) installed and available in `PATH` + +### Usage +```bash +./capif_build.sh --route <5g_repo_path> --output [--service ] +``` + +### Options +- `--route` : Path to the 5G repo containing the CAPIF YAML files. +- `--output`: Path to the folder where the generated code will be stored. +- `--service` *(optional)*: Name of a single YAML file to build (must match one from the CAPIF services list). + If omitted, **all services** will be built. +- `-h, --help`: Show help message. + +### Examples +Generate all CAPIF services: +```bash +./capif_build.sh --route /path/to/5g_repo --output ./old-version +``` + +Generate only one service: +```bash +./capif_build.sh --route /path/to/5g_repo --output ./new-version \ + --service TS29222_CAPIF_Events_API.yaml +``` + +--- + +## 2. `make_diffs.sh` + +This script compares two folders of generated CAPIF services (e.g., `old-version` vs `new-version`). +It produces: +- A `.diff` file per service (unified diff with `diff -ruN`) +- A `.diffstat` file per service (summary of changes per file, using `diffstat` or `git --no-index --stat`) +- A `summary.txt` file listing the results for all services + +### Requirements +- `sh` or `bash` +- `diff` (standard in Unix-like systems) +- Optional: + - `diffstat` → recommended for per-file summaries + - `git` → used as a fallback for summaries if `diffstat` is not available + +### Usage +```bash +./make_diffs.sh --old --new [--out ] [--service ] +``` + +### Options +- `--old` : Path to the folder with the old version. +- `--new` : Path to the folder with the new version. +- `--out` : (Optional) Output folder for diffs. Default: `./diffs`. +- `--service` : (Optional) Compare only one specific service (folder or file at top level). +- `-h, --help`: Show help message. + +### Examples +Compare all services: +```bash +./make_diffs.sh --old ./old-version --new ./new-version +``` + +Compare only one service: +```bash +./make_diffs.sh --old ./old-version --new ./new-version --service TS29222_CAPIF_Events_API +``` + +Save diffs into a custom folder: +```bash +./make_diffs.sh --old ./old-version --new ./new-version --out ./diffs_run2 +``` + +### Output +After running, the output folder will contain: +``` +diffs/ +├── TS29222_CAPIF_Events_API.diff +├── TS29222_CAPIF_Events_API.diffstat +├── TS29222_CAPIF_Auditing_API.diff +├── TS29222_CAPIF_Auditing_API.diffstat +... +└── summary.txt +``` + +--- + +## Typical Workflow +1. Generate services for the **old version**: + ```bash + ./capif_build.sh --route /path/to/5g_repo --output ./old-version + ``` +2. Generate services for the **new version**: + ```bash + ./capif_build.sh --route /path/to/5g_repo --output ./new-version + ``` +3. Compare them: + ```bash + ./make_diffs.sh --old ./old-version --new ./new-version --out ./diffs + ``` +4. Inspect the `.diff` and `.diffstat` files or open them in a diff viewer like `meld`, `kdiff3`, or `colordiff`. + +--- + +## Tips +- For easier inspection, install GUI diff tools like [Meld](https://meldmerge.org/). +- For API-level changes (OpenAPI/Swagger), you may also use tools like [`oasdiff`](https://github.com/Tufin/oasdiff). diff --git a/tools/compare_versions/download_services.sh b/tools/compare_versions/download_services.sh new file mode 100755 index 0000000000000000000000000000000000000000..440d29e497565929f110f05ebe29ce3fbdd9aafc --- /dev/null +++ b/tools/compare_versions/download_services.sh @@ -0,0 +1,100 @@ +#!/usr/bin/env bash +set -euo pipefail + +# List of CAPIF services +SERVICES=( + "TS29222_CAPIF_API_Invoker_Management_API.yaml" + "TS29222_CAPIF_API_Provider_Management_API.yaml" + "TS29222_CAPIF_Access_Control_Policy_API.yaml" + "TS29222_CAPIF_Auditing_API.yaml" + "TS29222_CAPIF_Discover_Service_API.yaml" + "TS29222_CAPIF_Events_API.yaml" + "TS29222_CAPIF_Logging_API_Invocation_API.yaml" + "TS29222_CAPIF_Publish_Service_API.yaml" + "TS29222_CAPIF_Routing_Info_API.yaml" + "TS29222_CAPIF_Security_API.yaml" +) + +usage() { + cat < --output [--service ] + +Options: + --route Path to the 5G repo containing the YAML files. + --output Folder where the generated code will be stored. + --service (Optional) One of the following YAML files: + ${SERVICES[*]} + -h, --help Show this help message. + +Examples: + $(basename "$0") --route /path/5g --output /tmp/capif + $(basename "$0") --route /path/5g --output /tmp/capif --service TS29222_CAPIF_Events_API.yaml +EOF +} + +# Argument parsing (style: --key value) +ROUTE="" +OUTPUT="" +SERVICE="" + +while [[ $# -gt 0 ]]; do + case "$1" in + --route) ROUTE="${2:-}"; shift 2 ;; + --output) OUTPUT="${2:-}"; shift 2 ;; + --service) SERVICE="${2:-}"; shift 2 ;; + -h|--help) usage; exit 0 ;; + *) echo "Unknown argument: $1" >&2; usage; exit 1 ;; + esac +done + +# Basic validations +[[ -z "$ROUTE" ]] && echo "Error: --route is required." >&2 && usage && exit 1 +[[ -z "$OUTPUT" ]] && echo "Error: --output is required." >&2 && usage && exit 1 + +if ! command -v openapi-generator >/dev/null 2>&1; then + echo "Error: 'openapi-generator' is not installed or not in PATH." >&2 + exit 1 +fi + +if [[ ! -d "$ROUTE" ]]; then + echo "Error: the provided route '$ROUTE' does not exist." >&2 + exit 1 +fi + +mkdir -p "$OUTPUT" + +# If a service is specified, validate it +if [[ -n "$SERVICE" ]]; then + valid=false + for s in "${SERVICES[@]}"; do + if [[ "$s" == "$SERVICE" ]]; then + valid=true + break + fi + done + if [[ "$valid" != true ]]; then + echo "Error: the service '$SERVICE' is not valid." >&2 + echo "It must be one of: ${SERVICES[*]}" >&2 + exit 1 + fi + + path="$ROUTE/$SERVICE" + if [[ ! -f "$path" ]]; then + echo "Error: the service '$SERVICE' does not exist in the route '$ROUTE'." >&2 + exit 1 + fi + + base="${SERVICE%.*}" + echo "Downloading and building service: $SERVICE" + openapi-generator generate -i "$path" -g python-flask -o "$OUTPUT/$base" +else + # Process all services + for svc in "${SERVICES[@]}"; do + path="$ROUTE/$svc" + echo "Downloading and building service: $svc" + openapi-generator generate -i "$path" -g python-flask -o "$OUTPUT/${svc%.*}" + done +fi + +echo "All services have been downloaded and built." diff --git a/tools/compare_versions/make_diffs.sh b/tools/compare_versions/make_diffs.sh new file mode 100755 index 0000000000000000000000000000000000000000..5d34f0b2dc154668a80c66320a3c4d5d1771b4f9 --- /dev/null +++ b/tools/compare_versions/make_diffs.sh @@ -0,0 +1,133 @@ +#!/bin/sh +set -eu + +usage() { + cat < --new [--out ] [--service ] + +Options: + --old Path to the folder with the old version (e.g., old-version) + --new Path to the folder with the new version (e.g., new-version) + --out (Optional) Output folder for diffs. Default: ./diffs + --service (Optional) Single top-level service (file or directory name) to compare + -h, --help Show this help + +Output: + - .diff unified diff (-ruN) for the service + - .diffstat summary (diffstat or git --no-index --stat fallback) + - summary.txt run summary +EOF +} + +OLD="" +NEW="" +OUT="diffs" +ONLY_SERVICE="" + +# Parse args +while [ $# -gt 0 ]; do + case "$1" in + --old) OLD=${2:-}; shift 2 ;; + --new) NEW=${2:-}; shift 2 ;; + --out) OUT=${2:-}; shift 2 ;; + --service) ONLY_SERVICE=${2:-}; shift 2 ;; + -h|--help) usage; exit 0 ;; + *) echo "Unknown argument: $1" >&2; usage; exit 1 ;; + esac +done + +[ -n "$OLD" ] || { echo "Error: --old is required." >&2; usage; exit 1; } +[ -n "$NEW" ] || { echo "Error: --new is required." >&2; usage; exit 1; } + +[ -d "$OLD" ] || { echo "Error: '$OLD' is not a directory." >&2; exit 1; } +[ -d "$NEW" ] || { echo "Error: '$NEW' is not a directory." >&2; exit 1; } + +mkdir -p "$OUT" + +SUMMARY_FILE="$OUT/summary.txt" +: > "$SUMMARY_FILE" # overwrite each run + +have_diffstat=0 +command -v diffstat >/dev/null 2>&1 && have_diffstat=1 + +have_git=0 +command -v git >/dev/null 2>&1 && have_git=1 + +# Build service list +if [ -n "$ONLY_SERVICE" ]; then + # Validate existence in at least one side + if [ ! -e "$OLD/$ONLY_SERVICE" ] && [ ! -e "$NEW/$ONLY_SERVICE" ]; then + echo "Error: service '$ONLY_SERVICE' not found in either '$OLD' or '$NEW'." >&2 + exit 1 + fi + SERVICES_LIST=$ONLY_SERVICE +else + tmp="$(mktemp)" + for p in "$OLD"/* "$NEW"/*; do + [ -e "$p" ] || continue + base=$(basename "$p") + printf '%s\n' "$base" >> "$tmp" + done + SERVICES_LIST=$(sort -u "$tmp") + rm -f "$tmp" + + # If nothing found, exit gracefully + if [ -z "$SERVICES_LIST" ]; then + echo "No services found in '$OLD' or '$NEW'. Nothing to diff." + exit 0 + fi +fi + +echo "Generating diffs into '$OUT'..." +echo "$SERVICES_LIST" | while IFS= read -r svc; do + [ -n "$svc" ] || continue + + left="$OLD/$svc" + right="$NEW/$svc" + out_diff="$OUT/${svc}.diff" + out_stat="$OUT/${svc}.diffstat" + + # Clean previous files to ensure overwrite + rm -f "$out_diff" "$out_stat" + + if [ ! -e "$left" ] && [ ! -e "$right" ]; then + echo "WARN: '$svc' missing in both sides; skipping." | tee -a "$SUMMARY_FILE" + continue + fi + + # 0=no changes, 1=diffs, >1=error + if diff -ruN "$left" "$right" >"$out_diff" 2>&1; then + echo "Service '$svc': no differences." | tee -a "$SUMMARY_FILE" + echo "No differences" >"$out_stat" + else + code=$? + if [ $code -eq 1 ]; then + echo "Service '$svc': differences found -> $(basename "$out_diff")" | tee -a "$SUMMARY_FILE" + if [ $have_diffstat -eq 1 ]; then + if ! diffstat "$out_diff" >"$out_stat" 2>/dev/null; then + echo "Failed to generate diffstat from diff file." >"$out_stat" + fi + elif [ $have_git -eq 1 ] && [ -e "$left" ] && [ -e "$right" ]; then + if ! git -c color.ui=never diff --no-index --stat -- "$left" "$right" >"$out_stat" 2>/dev/null; then + echo "Failed to generate stat with git --no-index." >"$out_stat" + fi + else + { + echo "diffstat and git not available." + echo "Install 'diffstat' for per-file summaries, e.g.:" + echo " - Debian/Ubuntu: sudo apt-get install diffstat" + echo " - macOS (brew): brew install diffstat" + echo " - Fedora/RHEL: sudo dnf install diffstat" + } >"$out_stat" + fi + else + echo "Service '$svc': diff error (exit $code) -> $(basename "$out_diff")" | tee -a "$SUMMARY_FILE" + echo "Diff error (exit $code). See $(basename "$out_diff") for details." >"$out_stat" + fi + fi +done + +echo +echo "Done. Diff files are in: $OUT" +echo "Summary: $SUMMARY_FILE" diff --git a/tools/open_api_script/generate_all_capif_apis.sh b/tools/open_api_script/generate_all_capif_apis.sh index 0b5393c9e85444beac33c4b1f7ada8cb0788f508..79c62810ce189f38f4464b7d50a519822c707c2a 100755 --- a/tools/open_api_script/generate_all_capif_apis.sh +++ b/tools/open_api_script/generate_all_capif_apis.sh @@ -1,14 +1,91 @@ #!/bin/bash +# This script generates all CAPIF APIs defined in the 3GPP TS 29222 series. +# This script must setup APIS_FOLDER variable to point to the folder where +# all the OpenAPI files are stored. (them must be placed under openapi-generator). Copy them to that folder +# before running this script. +# OPEN_API_GENERATOR_FOLDER variable must point to the openapi-generator folder + +# Steps to run this script: +# 1. Install Docker +# 2. Clone openapi-generator from https://github.com/OpenAPITools/openapi-generator +# 3. Copy all OpenAPI files to a folder inside the openapi-generator folder. +# 4. Run this script with the desired options. + +# Mostrar ayuda +show_help() { + echo "Usage: $0 [options]" + echo "" + echo "Options:" + echo " -a Folder containing OpenAPI files (default: APIs)" + echo " -c Name of the output project folder (default: CAPIF-generated-new)" + echo " -g Path to openapi-generator folder (default: /path/to/openapi-generator)" + echo " -h Show this help message" + echo "" + echo "Steps to run this script:" + echo " 1. Install Docker" + echo " 2. Clone openapi-generator from https://github.com/OpenAPITools/openapi-generator" + echo " 3. Copy all CAPIF API files to a folder inside the openapi-generator folder." + echo " 4. Run this script with the desired options." + echo "" + echo "Example:" + echo " $0 -a APIs -c MyProject -g /path/to/openapi-generator" + exit 0 +} + +# Parámetros por defecto +APIS_FOLDER=APIs +COMPOSITE_PROJECT=CAPIF-latest +OPEN_API_GENERATOR_FOLDER=/path/to/openapi-generator + +# Leer parámetros +while getopts ":a:c:g:h" opt; do + case $opt in + a) + APIS_FOLDER="$OPTARG" + ;; + c) + COMPOSITE_PROJECT="$OPTARG" + ;; + g) + OPEN_API_GENERATOR_FOLDER="$OPTARG" + ;; + h) + show_help + ;; + \?) + echo "Invalid option: -$OPTARG" >&2 + show_help + ;; + :) + echo "Option -$OPTARG requires an argument." >&2 + show_help + ;; + esac +done + +# Local variables ENDPOINTS=() SERVICE_NAMES=() -COMPOSITE_PROJECT=CAPIF-composite-test2 -OUTPUT_HOST_BASE_DIRECTORY=out/CAPIF-composite-test2 -OUTPUT_DOCKER_BASE_DIRECTORY=/gen/$OUTPUT_HOST_BASE_DIRECTORY +OUTPUT_HOST_BASE_DIRECTORY=out/$COMPOSITE_PROJECT DOCKER_COMPOSE_FILENAME=$OUTPUT_HOST_BASE_DIRECTORY/docker-compose-test.yml NGINX_CONF_FILE=$OUTPUT_HOST_BASE_DIRECTORY/nginx.conf +# Change to openapi-generator directory (limitation at run-in-docker.sh script) +cd $OPEN_API_GENERATOR_FOLDER + +# Validar directorios +if [ ! -d "$APIS_FOLDER" ]; then + echo "APIs folder '$APIS_FOLDER' does not exist." + exit 1 +fi +if [ ! -d "$OPEN_API_GENERATOR_FOLDER" ]; then + echo "OpenAPI generator folder '$OPEN_API_GENERATOR_FOLDER' does not exist." + exit 1 +fi + echo "docker compose file: $DOCKER_COMPOSE_FILENAME" +# Create output folder mkdir -p $OUTPUT_HOST_BASE_DIRECTORY # rm $DOCKER_COMPOSE_FILENAME || true @@ -20,17 +97,16 @@ function createPythonServer { SWAGGER_FILE=$1 API_NAME=$(basename -s .yaml $SWAGGER_FILE) ENDPOINT=$(awk '/- url: /{ print $3 }' $SWAGGER_FILE|awk -F / '{ print $2}') - OUTPUT=$OUTPUT_DOCKER_BASE_DIRECTORY/$API_NAME/ + OUTPUT=$OUTPUT_HOST_BASE_DIRECTORY/$API_NAME/ echo "SWAGGER_FILE: $SWAGGER_FILE" echo "API_NAME: $API_NAME" echo "ENDPOINT: $ENDPOINT" echo "OUTPUT DIRECTORY: $OUTPUT" ENDPOINTS+=($ENDPOINT) SERVICE_NAME=$(echo $ENDPOINT | sed 's/-/_/g') - # SERVICE_NAMES+=($SERVICE_NAME) - ./run-in-docker.sh generate -i $SWAGGER_FILE \ + $OPEN_API_GENERATOR_FOLDER/run-in-docker.sh generate -i $SWAGGER_FILE \ -g python-flask \ - -o $OUTPUT \ + -o /gen/$OUTPUT \ --package-name=$SERVICE_NAME cat >> $DOCKER_COMPOSE_FILENAME << EOF $ENDPOINT: @@ -40,8 +116,9 @@ function createPythonServer { EOF } - -CAPIF_FILES=$(ls capif|awk '/TS29222/{ print "capif/"$0 }') +echo "Generating services for APIs in $APIS_FOLDER" +CAPIF_FILES=$(ls $APIS_FOLDER|awk -v dir="$APIS_FOLDER" '/TS29222/{ print dir "/"$0 }') +echo "CAPIF_FILES: $CAPIF_FILES" for CAPIF_FILE in ${CAPIF_FILES[*]} do createPythonServer $CAPIF_FILE @@ -90,3 +167,4 @@ cat >> $NGINX_CONF_FILE << EOF } EOF +echo "Check all generated services under $OPEN_API_GENERATOR_FOLDER/$OUTPUT_HOST_BASE_DIRECTORY folder" \ No newline at end of file diff --git a/tools/robot/basicRequirements.txt b/tools/robot/basicRequirements.txt index 2f6ea98a11f13f7960afdfb32f71dd1ea43ddfc5..d6b316fa906fe0e2effe9d9e6d9cf06ce2e62439 100644 --- a/tools/robot/basicRequirements.txt +++ b/tools/robot/basicRequirements.txt @@ -55,7 +55,7 @@ PyGithub == 1.56 PyJWT == 2.6.0 pymongo == 4.7.3 PyNaCl == 1.5.0 -pyOpenSSL == 24.1.0 +pyOpenSSL == 25.3.0 pyparsing == 3.0.9 PySocks == 1.7.1 pytest == 6.2.4