<commit_before>FORMAT: 1A
HOST: *

# Orchestrator

Component to expose an API to automatise provisioning in all the IoT Platform modules.

# Group Orchestrator

All requests can be performed providing a 'x-auth-token' header instead of X_USER / X_PASSWORD payload fields


## Services query [/v1.0/service]
### Listado de Services [GET]

+ Request (application/json)

            {
                "DOMAIN_NAME":"default_admin_domain",
                "SERVICE_ADMIN_USER":"cloud_admin",
                "SERVICE_ADMIN_PASSWORD": "password",
            }

+ Response 200 (application/json)

    + Body

            {
                "domains": [
                    {
                        "enabled": true,
                        "id": "f7a5b8e303ec43e8a912fe26fa79dc02",
                        "name": "defaultservice",
                        "description": "defaultservice"
                    },
                    {
                        "enabled": true,
                        "id": "f7a5b8e303ec43e8a912fe26fa79dc03",
                        "name": "defaultservice2",
                        "description": "defaultservice2"
                    }
                ]
            }

### Create Service [POST]
+ Request (application/json)

            {
                "DOMAIN_NAME":"admin_domain",
                "DOMAIN_ADMIN_USER":"cloud_admin",
                "DOMAIN_ADMIN_PASSWORD": "password",
                "NEW_SERVICE_NAME":"defaultservice",
                "NEW_SERVICE_DESCRIPTION":"defaultservice desc",
                "NEW_SERVICE_ADMIN_USER":"adm1",
                "NEW_SERVICE_ADMIN_PASSWORD":"password",
                "NEW_SERVICE_ADMIN_EMAIL":"<EMAIL>",
            }

       Required: ["NEW_SERVICE_NAME", "NEW_SERVICE_ADMIN_USER",  "NEW_SERVICE_ADMIN_PASSWORD"]

+ Response 201 (application/json)

    + Body

            {
             "id" : 0000
            }

## Service manager [/v1.0/service/{serviceId}]
### Get data [GET]
+ Parameters
    + serviceId (required, `string`) ... Service Id

+ Request (application/json)

            {
                "SERVICE_NAME":"defaultservice",
                "SERVICE_ADMIN_USER":"adm1",
                "SERVICE_ADMIN_PASSWORD":"password",
            }
+ Response 200 (application/json)

    + Body

            {
                "enabled": true,
                "id": "f7a5b8e303ec43e8a912fe26fa79dc02",
                "name": "defaultservice",
                "description": "defaultservice"
            }

## Sub-services in service [/v1.0/service/{serviceId}/subservice]
### listado de subservicio [GET]
+ Parameters
    + serviceId (required, `string`) ... Service Id


+ Response 200 (application/json)

    + Body

            {
              "projects": [
                {
                  "description": "defaultservice Subservicio Electricidad",
                  "id": "<KEY>",
                  "domain_id": "f7a5b8e303ec43e8a912fe26fa79dc02",
                  "name": "Electricidad"
                },
                {
                  "description": "defaultservice Subservicio Basuras",
                  "id": "<KEY>",
                  "domain_id": "f7a5b8e303ec43e8a912fe26fa79dc03",
                  "name": "Basuras"
                },
                {
                  "description": "defaultservice Subservicio Jardines",
                  "id": "c6851f8ef57c4b91b567ab62ca3d0aec",
                  "domain_id": "f7a5b8e303ec43e8a912fe26fa79dc04",
                  "name": "Jardines"
                }
              ]
            }

### edicion de subservicio [PUT]

+ Request (application/json)

            {
                "SERVICE_NAME":"defaultservice",
                "SERVICE_ADMIN_USER":"adm1",
                "SERVICE_ADMIN_PASSWORD":"password",
                "SUBSERVICE_NAME":"Electricidad",
                "NEW_SUBSERVICE_DESCRIPTION":"electricidad new desc",
            }


+ Response 201 (application/json)

    + Body

            {
                   "id" : 0000
            }

### Create SubService [POST]
+ Parameters
    + serviceId (required, `string`) ... Service Id

+ Request (application/json)

            {
                "SERVICE_NAME":"defaultservice",
                "SERVICE_ADMIN_USER":"adm1",
                "SERVICE_ADMIN_PASSWORD":"password",
                "NEW_SUBSERVICE_NAME":"Electricidad",
                "NEW_SUBSERVICE_DESCRIPTION":"electricidad desc",
            }

       Required: ["NEW_SUBSERVICE_NAME" ]

+ Response 201 (application/json)

            {
                 "id" : 0000
            }

## Sub-service of service [/v1.0/service/{serviceId}/subservice/{subserviceId}]
### listado de subservicio [GET]
+ Response 200 (application/json)

    + Body

            {
                'description': 'electricidad',
                'domain_id': '06b9a460f5c343b3bc8b43f8533f7ab4',
                'id': '1119023a10064570a2a3de0b5b286500',
                'name': '/Electricidad'}
            }



## Register IoTA device in a Sub-service of service [/v1.0/service/{serviceId}/subservice/{subserviceId}/register_device/]
### registar dispositivo en IoTA [POST]
+ Parameters
    + serviceId (required, `string`) ... Service
    + subserviceId (required, `string`) ... SubService
<commit_msg>fix modify service and subservice<commit_after>FORMAT: 1A
HOST: orchestrator_host:8084

# Orchestrator

Component to expose an API to automatise provisioning in all the IoT Platform modules.

# Group Orchestrator

All requests can be performed providing a 'x-auth-token' header instead of X_USER / X_PASSWORD payload fields


## Services query [/v1.0/service]
### Listado de Services [GET]

+ Request (application/json)

            {
                "DOMAIN_NAME":"default_admin_domain",
                "SERVICE_ADMIN_USER":"cloud_admin",
                "SERVICE_ADMIN_PASSWORD": "password",
            }

+ Response 200 (application/json)

    + Body

            {
                "domains": [
                    {
                        "enabled": true,
                        "id": "f7a5b8e303ec43e8a912fe26fa79dc02",
                        "name": "defaultservice",
                        "description": "defaultservice"
                    },
                    {
                        "enabled": true,
                        "id": "f7a5b8e303ec43e8a912fe26fa79dc03",
                        "name": "defaultservice2",
                        "description": "defaultservice2"
                    }
                ]
            }

### Create Service [POST]
+ Request (application/json)

            {
                "DOMAIN_NAME":"admin_domain",
                "DOMAIN_ADMIN_USER":"cloud_admin",
                "DOMAIN_ADMIN_PASSWORD": "password",
                "NEW_SERVICE_NAME":"defaultservice",
                "NEW_SERVICE_DESCRIPTION":"defaultservice desc",
                "NEW_SERVICE_ADMIN_USER":"adm1",
                "NEW_SERVICE_ADMIN_PASSWORD":"password",
                "NEW_SERVICE_ADMIN_EMAIL":"<EMAIL>",
            }

       Required: ["NEW_SERVICE_NAME", "NEW_SERVICE_ADMIN_USER",  "NEW_SERVICE_ADMIN_PASSWORD"]

+ Response 201 (application/json)

    + Body

            {
             "id" : 0000
            }

## Service manager [/v1.0/service/{serviceId}]
### Get data [GET]
+ Parameters
    + serviceId (required, `string`) ... Service Id

+ Request (application/json)

            {
                "SERVICE_NAME":"defaultservice",
                "SERVICE_ADMIN_USER":"adm1",
                "SERVICE_ADMIN_PASSWORD":"password",
            }
+ Response 200 (application/json)

    + Body

            {
                "enabled": true,
                "id": "f7a5b8e303ec43e8a912fe26fa79dc02",
                "name": "defaultservice",
                "description": "defaultservice"
            }


### Delete a Service [DELETE]
+ Parameters
    + serviceId (required, `string`) ... Service Id
+ Request (application/json)

            {
                "SERVICE_NAME":"defaultservice",
                "SERVICE_ADMIN_USER":"adm1",
                "SERVICE_ADMIN_PASSWORD":"password",
            }

+ Response 204

## Sub-services in service [/v1.0/service/{serviceId}/subservice]
### List subservices [GET]
+ Parameters
    + serviceId (required, `string`) ... Service Id

+ Response 200 (application/json)

    + Body

            {
              "projects": [
                {
                  "description": "defaultservice Subservicio Electricidad",
                  "id": "c6851f8ef57c4b91b567ab62ca3d0aea",
                  "domain_id": "f7a5b8e303ec43e8a912fe26fa79dc02",
                  "name": "Electricidad"
                },
                {
                  "description": "defaultservice Subservicio Basuras",
                  "id": "c6851f8ef57c4b91b567ab62ca3d0aeb",
                  "domain_id": "f7a5b8e303ec43e8a912fe26fa79dc03",
                  "name": "Basuras"
                },
                {
                  "description": "defaultservice Subservicio Jardines",
                  "id": "c6851f8ef57c4b91b567ab62ca3d0aec",
                  "domain_id": "f7a5b8e303ec43e8a912fe26fa79dc04",
                  "name": "Jardines"
                }
              ]
            }



### Create SubService [POST]
+ Parameters
    + serviceId (required, `string`) ... Service Id

+ Request (application/json)

            {
                "SERVICE_NAME":"defaultservice",
                "SERVICE_ADMIN_USER":"adm1",
                "SERVICE_ADMIN_PASSWORD":"password",
                "NEW_SUBSERVICE_NAME":"Electricidad",
                "NEW_SUBSERVICE_DESCRIPTION":"electricidad desc",
            }

       Required: ["NEW_SUBSERVICE_NAME" ]

+ Response 201 (application/json)

            {
                 "id" : 0000
            }

## Sub-service of service [/v1.0/service/{serviceId}/subservice/{subserviceId}]
### List of SubServices [GET]
+ Parameters
    + serviceId (required, `string`) ... Service Id
    + subserviceId (required, `string`) ... Service Id

+ Response 200 (application/json)
    + Body

            {
                'description': 'electricidad',
                'domain_id': '06b9a460f5c343b3bc8b43f8533f7ab4',
                'id': '1119023a10064570a2a3de0b5b286500',
                'name': '/Electricidad'}
            }

### Modify SubService [PUT]
+ Parameters
    + serviceId (required, `string`) ... Service Id
    + subserviceId (required, `string`) ... Service Id

+ Request (application/json)

            {
                "SERVICE_NAME":"defaultservice",
                "SERVICE_ADMIN_USER":"adm1",
                "SERVICE_ADMIN_PASSWORD":"password",
                "SUBSERVICE_NAME":"Electricidad",
                "NEW_SUBSERVICE_DESCRIPTION":"electricidad new desc",
            }


+ Response 200 (application/json)

    + Body

            {
                   "id" : 0000
            }


### Delete a SubService [DELETE]
+ Parameters
    + serviceId (required, `string`) ... Service Id
    + subserviceId (required, `string`) ... SubService Id
+ Request (application/json)

            {
                "SERVICE_NAME":"defaultservice",
                "SUBSERVICE_NAME":"defaultservice",
                "SERVICE_ADMIN_USER":"adm1",
                "SERVICE_ADMIN_PASSWORD":"password",
            }

+ Response 204


## Register IoTA device in a Sub-service of service [/v1.0/service/{serviceId}/subservice/{subserviceId}/register_device/]
### registar dispositivo en IoTA [POST]
+ Parameters
    + serviceId (required, `string`) ... Service
    + subserviceId (required, `string`) ... SubService

{'fraction_non_alphanumeric': 0.11385542168674699, 'fraction_numerical': 0.041824440619621345, 'mean_word_length': 1.6850739371534196, 'pattern_counts': {'":': 107, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2788520', 'n_tokens_mistral': 3667, 'n_tokens_neox': 3252, 'n_words': 581}