API Service¶
-
class
ApiService()¶ exported from
src/app/api/api.serviceService to interact with the mico api.
-
ApiService.canonizeStreamUrl(streamURL)¶ Canonize a resource url.
(Remove schema, host, port, api path prefix and leading/trailing slashes.)
Arguments: - streamURL (string) – resource url
Returns: string –
-
ApiService.deleteAllApplicationVersions(shortName)¶ delete all versions of an application uses: DELETE application/{shortName}
Arguments: - shortName (string) – shortName of the application versions to be deleted
Returns: Observable –
-
ApiService.deleteAllServiceVersions(shortName)¶ delete all versions of a service uses: DELETE services/{shortName}
Arguments: - shortName (string) – shortName of the service versions to be deleted
Returns: Observable –
-
ApiService.deleteApplication(shortName, version)¶ Deletes a specific application version uses: DELETE applications/{shortName}/{version}
Arguments: - shortName (string) – shortName of the application
- version (string) – version of the application
Returns: Observable –
-
ApiService.deleteApplicationKafkaFaasConnector(applicationShortName, applicationVersion, instanceId)¶ Deletes an includes relationship from an application to a service uses: DELETE applications/{applicationShortName}/{applicationVersion}/kafka-faas-connector/{instanceId}
Arguments: - applicationShortName (string) – the applications shortName
- applicationVersion (string) – the applications version
- instanceId (string) – the kafka faas connector instance id
Returns: Observable –
-
ApiService.deleteApplicationServices(applicationShortName, applicationVersion, serviceShortName)¶ Deletes an includes relationship from an application to a service uses: DELETE applications/{shortName}/{version}/services
Arguments: - applicationShortName (string) – the applications shortName
- applicationVersion (string) – the applications version
- serviceShortName (any) – the services shortName
Returns: Observable –
-
ApiService.deleteService(shortName, version)¶ Arguments: - shortName (any) –
- version (any) –
Returns: Observable –
-
ApiService.deleteServiceDependee(serviceShortName, serviceVersion, dependeeShortName, dependeeVersion)¶ deletes a depends on relation of a service uses: DELETE services/{shortName}/{version}/dependees
Arguments: - serviceShortName (string) – shortName of the depending service
- serviceVersion (string) – version of the depending service
- dependeeShortName (string) – shortName of the depended service
- dependeeVersion (string) – version of the depended service
Returns: Observable –
-
ApiService.deleteServiceInterface(shortName, version, serviceInterfaceName)¶ Deletes a service interface uses: DELETE services/{shortName}/{version}/interfaces/{serviceInterfaceName}
Arguments: - shortName (string) – the services shortName
- version (string) – the services version
- serviceInterfaceName (string) – the interfaces name
Returns: Observable –
-
ApiService.getApplication(shortName, version)¶ get an application based on its shortName and version uses: GET applications/{shortName}/{version}
Arguments: - shortName (string) – of the application
- version (string) – of the application
Returns: Observable –
-
ApiService.getApplicationDeploymentStatus(applicationShortName, applicationVersion)¶ Returns the deployment status of a specified application uses: GET applications/{applicationShortName}/{applicationVersion}/deploymentStatus
Arguments: - applicationShortName (string) – shortName of the application
- applicationVersion (string) – version of the application
Returns: Observable –
-
ApiService.getApplicationKafkaFaasConnector(applicationShortName, applicationVersion, instanceId)¶ Get an existing kafka faas connector deployment info uses: GET applications/{applicationShortName}/{applicationVersion}/kafka-faas-connector/{instanceId}
Arguments: - applicationShortName (string) – the applications shortName
- applicationVersion (string) – the applications version
- instanceId (string) – the kafka faas connector instance id this gets a specific instance
Returns: Observable –
-
ApiService.getApplicationStatus(shortName, version)¶ returns runtime information (status) about a specific application and its services uses GET applications/{shortName}/{version}/status
Arguments: - shortName (string) – the applications shortName
- version (string) – the applications version
Returns: Observable –
-
ApiService.getApplicationVersions(shortName)¶ Get all versions of an application based on its shortName uses: GET application/{shortName}
Arguments: - shortName (string) – the shortName of the applicaton
Returns: Observable –
-
ApiService.getApplications()¶ Get application list uses: GET application
Returns: Observable –
-
ApiService.getJobStatus(applicationShortName, applicationVersion)¶ retrieves the status of a deployment uses: GET jobs/{applicationShortName}/{applicationVersion}/status
Arguments: - applicationShortName (string) – shortName of the application
- applicationVersion (string) – version of the application
Returns: Observable –
-
ApiService.getModelDefinitions()¶ Returns: Observable –
-
ApiService.getOpenFaaSFunctions()¶ Retrieves the function list of the OpenFaaS Portal from the backend.
Returns: Observable –
-
ApiService.getOpenFaaSIp()¶ Retrieves the IP address of the OpenFaaS Portal from the backend.
Returns: Observable –
-
ApiService.getService(shortName, version)¶ Get a specific version of a service uses: GET services/{shortName}/{version}
Arguments: - shortName (any) – unique short name of the service
- version (any) – service version to be returned
Returns: Observable –
-
ApiService.getServiceDependees(shortName, version)¶ Get all services a specific service depends on. uses: GET services/{shortName}/{version}/dependees
Arguments: - shortName (any) – unique short name of the service
- version (any) – service version to be returned
Returns: Observable –
-
ApiService.getServiceDependencyGraph(shortName, version)¶ Get full dependency graph of service uses: GET services/{shortName}/{version}/dependencyGraph
Arguments: - shortName (any) – unique short name of the service
- version (any) – service version to be returned
Returns: Observable –
-
ApiService.getServiceDependers(shortName, version)¶ Get all services depending on a specific service uses: GET services/{shortName}/{version}/dependers
Arguments: - shortName (any) – unique short name of the service
- version (any) – service version to be returned
Returns: Observable –
-
ApiService.getServiceDeploymentInformation(applicationShortName, applicationVersion, serviceShortName)¶ Returns the deployment information of an applications included service uses: GET applications/{applicationShortName}/{applicationVersion}/deploymentInformation/{serviceShortName}
Arguments: - applicationShortName (string) – shortName of the application
- applicationVersion (string) – version of the application
- serviceShortName (any) – shortName of the service
Returns: Observable –
-
ApiService.getServiceInterfacePublicIp(serviceShortName, serviceVersion, instanceId, interfaceShortName)¶ Gets the public IP of a deployed service uses: services/{shortName}/{version}/interaces/{interfaceName}/publicIP
Arguments: - serviceShortName (string) – shortName of the service
- serviceVersion (string) – version of the service
- instanceId (string) – the instance id of the service deployment information
- interfaceShortName (string) – name of the serviceInterface
Returns: Observable –
-
ApiService.getServiceInterfaces(shortName, version)¶ get all service interfaces of a specified service uses: GET services/{shortName}/{version}/interfaces
Arguments: - shortName (any) – shortName of the service
- version (any) – version of the service
Returns: Observable –
-
ApiService.getServiceStatus(shortName, version)¶ returns runtime information (status) about a specific service uses GET services/{shortName}/{version}/status
Arguments: - shortName (string) – the services shortName
- version (string) – the services version
Returns: Observable –
-
ApiService.getServiceVersions(shortName)¶ Get all versions of a service based on its shortName uses: GET services/{shortName}
Arguments: - shortName (any) – the serices shortName
Returns: Observable –
-
ApiService.getServiceVersionsViaGithub(url)¶ takes an url to a github repository and returns the available versions of the repository. uses: GET services/import/github
Arguments: - url (string) – url to the github repository
Returns: Observable –
-
ApiService.getServiceYamlConfig(shortName, version)¶ Get a yaml string containing a services kubeconfig uses: GET services/{shortName}/{version}/yaml
Arguments: - shortName (string) – unique short name of the service
- version (string) – service version
Returns: Observable –
-
ApiService.getServices()¶ Get a list of all services uses: GET services
Returns: Observable –
-
ApiService.getStreamSource(streamURL, defaultSubject)¶ Fetch the stream source for the given resource url.
Arguments: - streamURL (string) – resource url
- defaultSubject (<TODO>) – function to create a new streamSource if needed (default: BehaviourSubject)
Returns: Subject –
-
ApiService.getTopics()¶ Get all known used kafka topics from the backend.
Returns: Observable –
-
ApiService.new ApiService(rest, snackBar)¶ Arguments: - rest (src/app/api/api-base-function.service.ApiBaseFunctionService) –
- snackBar (MatSnackBar) –
Returns: src/app/api/api.service.ApiService –
-
ApiService.pollDeploymentJobStatus(applicationShortName, applicationVersion)¶ Polls the deployment job of a given application and provides feedback if the deployment failed/ was successful. Also stops polling after 10 minutes
Arguments: - applicationShortName (string) – applicationShortName of the application to be polled
- applicationVersion (string) – applicationVersion of the application to be polled
Returns: Subscription –
-
ApiService.pollServiceInterfacePublicIp(serviceShortName, serviceVersion, instanceId, interfaceName)¶ Polls the public ip of a services interface until a public ip is available. Also ends the polling after 3 minutes.
Arguments: - serviceShortName (string) – serviceShortName of the interface to be polled
- serviceVersion (string) – serviceVersion of the interface to be polled
- instanceId (string) – the instance id of the service deployment information
- interfaceName (string) – interfaceName of the interface to be polled
Returns: Subscription –
-
ApiService.polling¶ type: Map
-
ApiService.postApplication(data)¶ Creates a new application uses: POST applications
Arguments: - data (any) – object holding the applications information
Returns: Observable –
-
ApiService.postApplicationDeployCommand(shortName, version)¶ commands the mico-core application to deploy an application uses: POST applications/{shortName}/{version}/deploy
Arguments: - shortName (string) – the applications shortName
- version (string) – the applications version
Returns: Observable –
-
ApiService.postApplicationKafkaFaasConnector(applicationShortName, applicationVersion, connectorVersion, instanceId)¶ Adds a new kafka faas connector to the application or update an existing one uses: POST applications/{applicationShortName}/{applicationVersion}/kafka-faas-connector[/{instanceId}]?version={kafkaFaasConnectorVersion}
Arguments: - applicationShortName (string) – the applications shortName
- applicationVersion (string) – the applications version
- connectorVersion (string) – the kafka faas connector version if omitted latest version is used
- instanceId (string) – the kafka faas connector instance id if present this updates a specific instance to this version instead of adding a new instance
Returns: Observable –
-
ApiService.postApplicationServices(applicationShortName, applicationVersion, serviceShortName, serviceVersion)¶ Adds an includes relationship from an appliction to a service uses: POST applications/{applicationShortName}/{applicationVersion}/services/{serviceShortName}/{serviceVersion}
Arguments: - applicationShortName (string) – the applications shortName
- applicationVersion (string) – the applications version
- serviceShortName (string) – the services shortName
- serviceVersion (string) – the services version
Returns: Observable –
-
ApiService.postApplicationUndeployCommand(shortName, version)¶ commands the mico-core application to undeploy an application uses: POST applications/{shortName}/{version}/undeploy
Arguments: - shortName (string) – the applications shortName
- version (string) – the applications version
Returns: Observable –
-
ApiService.postService(data)¶ Creates a new service uses: POST services
Arguments: - data (any) – object holding the services information
Returns: Observable –
-
ApiService.postServiceDependee(serviceShortName, serviceVersion, dependee)¶ Adds a depends on relation from a service to an other service (dependee) uses: POST services/{shortName}/{version}/dependees
Arguments: - serviceShortName (any) – shortName of the depending service
- serviceVersion (any) – version of the depending service
- dependee (any) – object holding the dependee
Returns: Observable –
-
ApiService.postServiceInterface(shortName, version, data)¶ Adds a new service interface to a service uses: POST services/{shortName}/{version}/interfaces
Arguments: - shortName (any) – shortName of the service
- version (any) – version of the service
- data (any) – object holding the interfaces information
Returns: Observable –
-
ApiService.postServiceViaGithub(url, version)¶ crawls a specific version from a github repository uses: POST services/import/github
Arguments: - url (string) – url to the github repository
- version (string) – version to be crawled
Returns: Observable –
-
ApiService.promoteApplication(shortName, version, newVersion)¶ Creates a new application version from an existing application uses: POST applications/{shortName}/{version}/promote
Arguments: - shortName (any) – shortName of the application
- version (any) – version of the application
- newVersion (string) – the new version of the application
Returns: Observable –
-
ApiService.promoteService(shortName, version, newVersion)¶ Creates a new service version from an existing service uses: POST services/{shortName}/{version}/promote
Arguments: - shortName (any) – shortName of the service
- version (any) – version of the service
- newVersion (string) – the new version of the service
Returns: Observable –
-
ApiService.putApplication(shortName, version, data)¶ Updates an existing application uses: PUT applications/{shortName}/{version}
Arguments: - shortName (any) – shortName of the application
- version (any) – version of the application
- data (any) – object holding the updated application information
Returns: Observable –
-
ApiService.putApplicationKafkaFaasConnector(applicationShortName, applicationVersion, instanceId, data)¶ Updates the deployment information of a kafka faas connector instance. uses: PUT applications/{applicationShortName}/{applicationVersion}/kafka-faas-connector/{instanceId}
Arguments: - applicationShortName (string) – shortName of the application
- applicationVersion (string) – version of the application
- instanceId (string) – instance id of the kafka faas connector
- data (any) – object holding the updated deployment information
Returns: Observable –
-
ApiService.putService(shortName, version, data)¶ Updates a services information uses: PUT service/{shortName}/{version}
Arguments: - shortName (any) – the services shortName
- version (any) – the services version
- data (any) – object holding the services updated version
Returns: Observable –
-
ApiService.putServiceDeploymentInformation(applicationShortName, applicationVersion, serviceShortName, data)¶ Updates the deployment information of an applications service uses: PUT applications/{applicationShortName}/{applicationVersion}/deploymentInformation/{serviceShortName}
Arguments: - applicationShortName (string) – shortName of the application
- applicationVersion (string) – version of the application
- serviceShortName (any) – shortName of the service
- data (any) – object holding the updated deployment information
Returns: Observable –
-
ApiService.putServiceInterface(shortName, version, serviceInterfaceName, serviceData)¶ Updates a service interface uses: PUT services/{shortName}/{version}/interfaces/{serviceInterfaceName}
Arguments: - shortName (string) – the services shortName
- version (string) – the services version
- serviceInterfaceName (string) – the interfaces name
- serviceData (any) –
Returns: Observable –
-
ApiService.rest¶ type: src/app/api/api-base-function.service.ApiBaseFunctionService
-
ApiService.snackBar¶ type: MatSnackBar
-
ApiService.startApplicationStatusPolling(applicationShortName, applicationVersion)¶ Starts the polling for ‘pollApplicationStatus’. Only one subscriptions is returned at a time, to avoid multiple polling of the same information. Otherwise ‘undefined’ is returned.
Arguments: - applicationShortName (string) – shortName of the application
- applicationVersion (string) – version of the application
Returns: Subscription –
-
ApiService.streams¶ type: Map
-