diff options
Diffstat (limited to 'docs')
18 files changed, 2175 insertions, 4 deletions
diff --git a/docs/api/swagger/swagger.html b/docs/api/swagger/swagger.html index 5d7c963a8a..514c2bdda2 100644 --- a/docs/api/swagger/swagger.html +++ b/docs/api/swagger/swagger.html @@ -843,11 +843,191 @@ margin-bottom: 20px; }, "description" : "This describes the subnet capabilities that can be queried" }; + defs["RetrievingWorkflowResponse"] = { + "type" : "object", + "properties" : { + "workflowSpecificationList" : { + "type" : "array", + "description" : "List of Workflow specification data", + "items" : { + "$ref" : "#/definitions/WorkflowSpecification" + } + } + }, + "description" : "Response body of fetching workflows using resource target" +}; + defs["ServiceLevelWorkflowExecution"] = { + "type" : "object", + "properties" : { + "requestInfo" : { + "$ref" : "#/definitions/ServiceLevelWorkflowExecution_requestInfo" + }, + "modelInfo" : { + "$ref" : "#/definitions/ServiceLevelWorkflowExecution_modelInfo" + }, + "requestParameters" : { + "$ref" : "#/definitions/ServiceLevelWorkflowExecution_requestParameters" + }, + "subscriberInfo" : { + "$ref" : "#/definitions/ServiceLevelWorkflowExecution_subscriberInfo" + }, + "project" : { + "$ref" : "#/definitions/ServiceLevelWorkflowExecution_project" + }, + "owningEntity" : { + "$ref" : "#/definitions/ServiceLevelWorkflowExecution_owningEntity" + } + }, + "description" : "This describes the request body of service level custom workflow execution" +}; + defs["ServiceLevelWorkflowExecution_modelInfo"] = { + "type" : "object", + "properties" : { + "modelType" : { + "type" : "string", + "description" : "Type of the model to be executed" + }, + "modelInvariantUuid" : { + "type" : "string", + "description" : "Model invariant id corresponding to the service" + }, + "modelUuid" : { + "type" : "string", + "description" : "Model uuid corresponding to the service" + }, + "modelVersionId" : { + "type" : "string", + "description" : "Model version of the service instance" + }, + "modelName" : { + "type" : "string", + "description" : "Name of the service" + }, + "modelVersion" : { + "type" : "string", + "description" : "Version of the service instance" + } + }, + "description" : "Parameters related to the service model" +}; + defs["ServiceLevelWorkflowExecution_owningEntity"] = { + "type" : "object", + "properties" : { + "owningEntityId" : { + "type" : "string", + "description" : "Id of the owning Entity" + }, + "owningEntityName" : { + "type" : "string", + "description" : "Name of the owning Entity" + } + }, + "description" : "Object describes the entity details" +}; + defs["ServiceLevelWorkflowExecution_project"] = { + "type" : "object", + "properties" : { + "projectName" : { + "type" : "string", + "description" : "Name of the target project" + } + }, + "description" : "Information about the target project name" +}; + defs["ServiceLevelWorkflowExecution_requestInfo"] = { + "type" : "object", + "properties" : { + "source" : { + "type" : "string", + "description" : "Name of the sender" + }, + "suppressRollback" : { + "type" : "boolean", + "description" : "Enable/disable rollback suppression" + }, + "requestorId" : { + "type" : "string", + "description" : "Id of the sender" + } + }, + "description" : "Request object contains source information" +}; + defs["ServiceLevelWorkflowExecution_requestParameters"] = { + "type" : "object", + "properties" : { + "subscriptionServiceType" : { + "type" : "string", + "description" : "Type of service subscription" + } + }, + "description" : "User parameter object" +}; + defs["ServiceLevelWorkflowExecution_subscriberInfo"] = { + "type" : "object", + "properties" : { + "globalSubscriberId" : { + "type" : "string", + "description" : "Id of the subscriber sending the request" + } + }, + "description" : "Subscriber id information" +}; defs["SubnetTypes"] = { "type" : "string", "description" : "This describes allowed subnet types", "enum" : [ "AN", "AN_NF", "CN", "TN_FH", "TN_MH", "TN_BH" ] }; + defs["WorkflowSpecification"] = { + "type" : "object", + "properties" : { + "artifactInfo" : { + "$ref" : "#/definitions/WorkflowSpecification_artifactInfo" + } + }, + "description" : "This describes workflow specification object" +}; + defs["WorkflowSpecification_artifactInfo"] = { + "type" : "object", + "properties" : { + "artifactType" : { + "type" : "string", + "description" : "Type of the artifact to be queried" + }, + "artifactUuid" : { + "type" : "string", + "description" : "UUID of the artifact" + }, + "artifactName" : { + "type" : "string", + "description" : "Name of the artifact" + }, + "artifactVersion" : { + "type" : "string", + "description" : "Artifact's Version" + }, + "artifactDescription" : { + "type" : "string", + "description" : "" + }, + "workflowName" : { + "type" : "string", + "description" : "Name of the workflow fetched for the resource type" + }, + "operationName" : { + "type" : "string", + "description" : "Mapped operation name of the corresponding workflow" + }, + "workflowSource" : { + "type" : "string", + "description" : "" + }, + "workflowResourceTarget" : { + "type" : "string", + "description" : "Type of Resource mapped against the workflow" + } + }, + "description" : "Attributes related to artifact information " +}; </script> <div class="container-fluid"> @@ -930,6 +1110,10 @@ margin-bottom: 20px; <li data-group="OnapsoinfracloudResourcesRequests" data-name="unlockOrchestrationRequestForReqId" class=""> <a href="#api-OnapsoinfracloudResourcesRequests-unlockOrchestrationRequestForReqId">unlockOrchestrationRequestForReqId</a> </li> + <li class="nav-header" data-group="OnapsoinfrainstanceManagement"><a href="#api-OnapsoinfrainstanceManagement">API Methods - OnapsoinfrainstanceManagement</a></li> + <li data-group="OnapsoinfrainstanceManagement" data-name="executeServiceLevelCustomWorkflow" class=""> + <a href="#api-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow">executeServiceLevelCustomWorkflow</a> + </li> <li class="nav-header" data-group="OnapsoinframodelDistributions"><a href="#api-OnapsoinframodelDistributions">API Methods - OnapsoinframodelDistributions</a></li> <li data-group="OnapsoinframodelDistributions" data-name="updateModelDistributionStatus" class=""> <a href="#api-OnapsoinframodelDistributions-updateModelDistributionStatus">updateModelDistributionStatus</a> @@ -1067,6 +1251,10 @@ margin-bottom: 20px; <li data-group="Onapsoinfratasks" data-name="queryFilters" class=""> <a href="#api-Onapsoinfratasks-queryFilters">queryFilters</a> </li> + <li class="nav-header" data-group="OnapsoinfraworkflowSpecifications"><a href="#api-OnapsoinfraworkflowSpecifications">API Methods - OnapsoinfraworkflowSpecifications</a></li> + <li data-group="OnapsoinfraworkflowSpecifications" data-name="queryWorkflowSpecifications" class=""> + <a href="#api-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications">queryWorkflowSpecifications</a> + </li> </ul> </nav> </div> @@ -1449,7 +1637,7 @@ $(document).ready(function() { <article id="api-E2eServiceInstances-compareModelwithTargetVersion-0" data-group="User" data-name="compareModelwithTargetVersion" data-version="0"> <div class="pull-left"> <h1>compareModelwithTargetVersion</h1> - <p>Find added and deleted resources of target model for the e2eserviceInstance on a given serviceId </p> + <p>Find added and deleted resources of target model for the e2eserviceInstance on a given serviceId</p> </div> <div class="pull-right"></div> <div class="clearfix"></div> @@ -1536,7 +1724,7 @@ String *body = body_example; // (optional) E2eServiceInstancesApi *apiInstance = [[E2eServiceInstancesApi alloc] init]; -// Find added and deleted resources of target model for the e2eserviceInstance on a given serviceId +// Find added and deleted resources of target model for the e2eserviceInstance on a given serviceId [apiInstance compareModelwithTargetVersionWith:serviceId version:version body:body @@ -1596,7 +1784,7 @@ namespace Example try { - // Find added and deleted resources of target model for the e2eserviceInstance on a given serviceId + // Find added and deleted resources of target model for the e2eserviceInstance on a given serviceId apiInstance.compareModelwithTargetVersion(serviceId, version, body); } catch (Exception e) @@ -1658,7 +1846,7 @@ version = version_example # String | body = body_example # String | (optional) try: - # Find added and deleted resources of target model for the e2eserviceInstance on a given serviceId + # Find added and deleted resources of target model for the e2eserviceInstance on a given serviceId api_instance.compare_modelwith_target_version(serviceId, version, body=body) except ApiException as e: print("Exception when calling E2eServiceInstancesApi->compareModelwithTargetVersion: %s\n" % e)</code></pre> @@ -7385,6 +7573,366 @@ $(document).ready(function() { </div> <hr> </section> + <section id="api-OnapsoinfrainstanceManagement"> + <h1>OnapsoinfrainstanceManagement</h1> + <div id="api-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow"> + <article id="api-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0" data-group="User" data-name="executeServiceLevelCustomWorkflow" data-version="0"> + <div class="pull-left"> + <h1>executeServiceLevelCustomWorkflow</h1> + <p>Executing service level custom workflow</p> + </div> + <div class="pull-right"></div> + <div class="clearfix"></div> + <p></p> + <p class="marked"></p> + <p></p> + <br /> + <pre class="prettyprint language-html prettyprinted" data-type="post"><code><span class="pln">/onap/so/infra/instanceManagement/{version}/serviceInstances/{serviceInstanceId}/workflows/{workflow_UUID}</span></code></pre> + <p> + <h3>Usage and SDK Samples</h3> + </p> + <ul class="nav nav-tabs nav-tabs-examples"> + <li class="active"><a href="#examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-curl">Curl</a></li> + <li class=""><a href="#examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-java">Java</a></li> + <li class=""><a href="#examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-android">Android</a></li> + <!--<li class=""><a href="#examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-groovy">Groovy</a></li>--> + <li class=""><a href="#examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-objc">Obj-C</a></li> + <li class=""><a href="#examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-javascript">JavaScript</a></li> + <!--<li class=""><a href="#examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-angular">Angular</a></li>--> + <li class=""><a href="#examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-csharp">C#</a></li> + <li class=""><a href="#examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-php">PHP</a></li> + <li class=""><a href="#examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-perl">Perl</a></li> + <li class=""><a href="#examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-python">Python</a></li> + </ul> + + <div class="tab-content"> + <div class="tab-pane active" id="examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-curl"> + <pre class="prettyprint"><code class="language-bsh">curl -X POST "http://localhost/onap/so/infra/instanceManagement/{version}/serviceInstances/{serviceInstanceId}/workflows/{workflow_UUID}"</code></pre> + </div> + <div class="tab-pane" id="examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-java"> + <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; +import io.swagger.client.auth.*; +import io.swagger.client.model.*; +import io.swagger.client.api.OnapsoinfrainstanceManagementApi; + +import java.io.File; +import java.util.*; + +public class OnapsoinfrainstanceManagementApiExample { + + public static void main(String[] args) { + + OnapsoinfrainstanceManagementApi apiInstance = new OnapsoinfrainstanceManagementApi(); + String version = version_example; // String | + String serviceInstanceId = serviceInstanceId_example; // String | + String workflowUUID = workflowUUID_example; // String | + ServiceLevelWorkflowExecution body = ; // ServiceLevelWorkflowExecution | + try { + apiInstance.executeServiceLevelCustomWorkflow(version, serviceInstanceId, workflowUUID, body); + } catch (ApiException e) { + System.err.println("Exception when calling OnapsoinfrainstanceManagementApi#executeServiceLevelCustomWorkflow"); + e.printStackTrace(); + } + } +}</code></pre> + </div> + + <div class="tab-pane" id="examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-android"> + <pre class="prettyprint"><code class="language-java">import io.swagger.client.api.OnapsoinfrainstanceManagementApi; + +public class OnapsoinfrainstanceManagementApiExample { + + public static void main(String[] args) { + OnapsoinfrainstanceManagementApi apiInstance = new OnapsoinfrainstanceManagementApi(); + String version = version_example; // String | + String serviceInstanceId = serviceInstanceId_example; // String | + String workflowUUID = workflowUUID_example; // String | + ServiceLevelWorkflowExecution body = ; // ServiceLevelWorkflowExecution | + try { + apiInstance.executeServiceLevelCustomWorkflow(version, serviceInstanceId, workflowUUID, body); + } catch (ApiException e) { + System.err.println("Exception when calling OnapsoinfrainstanceManagementApi#executeServiceLevelCustomWorkflow"); + e.printStackTrace(); + } + } +}</code></pre> + </div> + <!-- + <div class="tab-pane" id="examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-groovy"> + <pre class="prettyprint language-json prettyprinted" data-type="json"><code>Coming Soon!</code></pre> + </div> --> + <div class="tab-pane" id="examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-objc"> + <pre class="prettyprint"><code class="language-cpp">String *version = version_example; // +String *serviceInstanceId = serviceInstanceId_example; // +String *workflowUUID = workflowUUID_example; // +ServiceLevelWorkflowExecution *body = ; // (optional) + +OnapsoinfrainstanceManagementApi *apiInstance = [[OnapsoinfrainstanceManagementApi alloc] init]; + +// Executing service level custom workflow +[apiInstance executeServiceLevelCustomWorkflowWith:version + serviceInstanceId:serviceInstanceId + workflowUUID:workflowUUID + body:body + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error: %@", error); + } + }]; +</code></pre> + </div> + + <div class="tab-pane" id="examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-javascript"> + <pre class="prettyprint"><code class="language-js">var SoGuilinApIs = require('so_guilin_ap_is'); + +var api = new SoGuilinApIs.OnapsoinfrainstanceManagementApi() + +var version = version_example; // {String} + +var serviceInstanceId = serviceInstanceId_example; // {String} + +var workflowUUID = workflowUUID_example; // {String} + +var opts = { + 'body': // {ServiceLevelWorkflowExecution} +}; + +var callback = function(error, data, response) { + if (error) { + console.error(error); + } else { + console.log('API called successfully.'); + } +}; +api.executeServiceLevelCustomWorkflow(version, serviceInstanceId, workflowUUID, opts, callback); +</code></pre> + </div> + + <!--<div class="tab-pane" id="examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-angular"> + <pre class="prettyprint language-json prettyprinted" data-type="json"><code>Coming Soon!</code></pre> + </div>--> + <div class="tab-pane" id="examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-csharp"> + <pre class="prettyprint"><code class="language-cs">using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class executeServiceLevelCustomWorkflowExample + { + public void main() + { + + var apiInstance = new OnapsoinfrainstanceManagementApi(); + var version = version_example; // String | + var serviceInstanceId = serviceInstanceId_example; // String | + var workflowUUID = workflowUUID_example; // String | + var body = new ServiceLevelWorkflowExecution(); // ServiceLevelWorkflowExecution | (optional) + + try + { + // Executing service level custom workflow + apiInstance.executeServiceLevelCustomWorkflow(version, serviceInstanceId, workflowUUID, body); + } + catch (Exception e) + { + Debug.Print("Exception when calling OnapsoinfrainstanceManagementApi.executeServiceLevelCustomWorkflow: " + e.Message ); + } + } + } +} +</code></pre> + </div> + + <div class="tab-pane" id="examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-php"> + <pre class="prettyprint"><code class="language-php"><?php +require_once(__DIR__ . '/vendor/autoload.php'); + +$api_instance = new Swagger\Client\Api\OnapsoinfrainstanceManagementApi(); +$version = version_example; // String | +$serviceInstanceId = serviceInstanceId_example; // String | +$workflowUUID = workflowUUID_example; // String | +$body = ; // ServiceLevelWorkflowExecution | + +try { + $api_instance->executeServiceLevelCustomWorkflow($version, $serviceInstanceId, $workflowUUID, $body); +} catch (Exception $e) { + echo 'Exception when calling OnapsoinfrainstanceManagementApi->executeServiceLevelCustomWorkflow: ', $e->getMessage(), PHP_EOL; +} +?></code></pre> + </div> + + <div class="tab-pane" id="examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-perl"> + <pre class="prettyprint"><code class="language-perl">use Data::Dumper; +use WWW::SwaggerClient::Configuration; +use WWW::SwaggerClient::OnapsoinfrainstanceManagementApi; + +my $api_instance = WWW::SwaggerClient::OnapsoinfrainstanceManagementApi->new(); +my $version = version_example; # String | +my $serviceInstanceId = serviceInstanceId_example; # String | +my $workflowUUID = workflowUUID_example; # String | +my $body = WWW::SwaggerClient::Object::ServiceLevelWorkflowExecution->new(); # ServiceLevelWorkflowExecution | + +eval { + $api_instance->executeServiceLevelCustomWorkflow(version => $version, serviceInstanceId => $serviceInstanceId, workflowUUID => $workflowUUID, body => $body); +}; +if ($@) { + warn "Exception when calling OnapsoinfrainstanceManagementApi->executeServiceLevelCustomWorkflow: $@\n"; +}</code></pre> + </div> + + <div class="tab-pane" id="examples-OnapsoinfrainstanceManagement-executeServiceLevelCustomWorkflow-0-python"> + <pre class="prettyprint"><code class="language-python">from __future__ import print_statement +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.OnapsoinfrainstanceManagementApi() +version = version_example # String | +serviceInstanceId = serviceInstanceId_example # String | +workflowUUID = workflowUUID_example # String | +body = # ServiceLevelWorkflowExecution | (optional) + +try: + # Executing service level custom workflow + api_instance.execute_service_level_custom_workflow(version, serviceInstanceId, workflowUUID, body=body) +except ApiException as e: + print("Exception when calling OnapsoinfrainstanceManagementApi->executeServiceLevelCustomWorkflow: %s\n" % e)</code></pre> + </div> + </div> + + <h2>Parameters</h2> + + <div class="methodsubtabletitle">Path parameters</div> + <table id="methodsubtable"> + <tr> + <th width="150px">Name</th> + <th>Description</th> + </tr> + <tr><td style="width:150px;">version*</td> +<td> + + + <div id="d2e199_executeServiceLevelCustomWorkflow_version"> + <div class="json-schema-view"> + <div class="primitive"> + <span class="type"> + String + </span> + + </div> + <div class="inner required"> + Required + </div> + </div> + </div> +</td> +</tr> + + <tr><td style="width:150px;">serviceInstanceId*</td> +<td> + + + <div id="d2e199_executeServiceLevelCustomWorkflow_serviceInstanceId"> + <div class="json-schema-view"> + <div class="primitive"> + <span class="type"> + String + </span> + + </div> + <div class="inner required"> + Required + </div> + </div> + </div> +</td> +</tr> + + <tr><td style="width:150px;">workflow_UUID*</td> +<td> + + + <div id="d2e199_executeServiceLevelCustomWorkflow_workflowUUID"> + <div class="json-schema-view"> + <div class="primitive"> + <span class="type"> + String + </span> + + </div> + <div class="inner required"> + Required + </div> + </div> + </div> +</td> +</tr> + + </table> + + + <div class="methodsubtabletitle">Body parameters</div> + <table id="methodsubtable"> + <tr> + <th width="150px">Name</th> + <th>Description</th> + </tr> + <tr><td style="width:150px;">body </td> +<td> + + +<script> +$(document).ready(function() { + var schemaWrapper = { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/ServiceLevelWorkflowExecution" + } +}; + var schema = schemaWrapper.schema; + if (schema.$ref != null) { + schema = defsParser.$refs.get(schema.$ref); + } else { + schemaWrapper.definitions = Object.assign({}, defs); + $RefParser.dereference(schemaWrapper).catch(function(err) { + console.log(err); + }); + } + + var view = new JSONSchemaView(schema,2,{isBodyParam: true}); + var result = $('#d2e199_executeServiceLevelCustomWorkflow_body'); + result.empty(); + result.append(view.render()); +}); +</script> +<div id="d2e199_executeServiceLevelCustomWorkflow_body"></div> +</td> +</tr> + + </table> + + + + <h2>Responses</h2> + <h3> Status: default - successful operation </h3> + + <ul class="nav nav-tabs nav-tabs-examples" > + </ul> + + <div class="tab-content" style='margin-bottom: 10px;'> + </div> + + </article> + </div> + <hr> + </section> <section id="api-OnapsoinframodelDistributions"> <h1>OnapsoinframodelDistributions</h1> <div id="api-OnapsoinframodelDistributions-updateModelDistributionStatus"> @@ -22297,6 +22845,333 @@ except ApiException as e: </div> <hr> </section> + <section id="api-OnapsoinfraworkflowSpecifications"> + <h1>OnapsoinfraworkflowSpecifications</h1> + <div id="api-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications"> + <article id="api-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0" data-group="User" data-name="queryWorkflowSpecifications" data-version="0"> + <div class="pull-left"> + <h1>queryWorkflowSpecifications</h1> + <p>Retrieve Workflow details based on the filter criteria</p> + </div> + <div class="pull-right"></div> + <div class="clearfix"></div> + <p></p> + <p class="marked"></p> + <p></p> + <br /> + <pre class="prettyprint language-html prettyprinted" data-type="get"><code><span class="pln">/onap/so/infra/workflowSpecifications/{version}/workflows</span></code></pre> + <p> + <h3>Usage and SDK Samples</h3> + </p> + <ul class="nav nav-tabs nav-tabs-examples"> + <li class="active"><a href="#examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-curl">Curl</a></li> + <li class=""><a href="#examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-java">Java</a></li> + <li class=""><a href="#examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-android">Android</a></li> + <!--<li class=""><a href="#examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-groovy">Groovy</a></li>--> + <li class=""><a href="#examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-objc">Obj-C</a></li> + <li class=""><a href="#examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-javascript">JavaScript</a></li> + <!--<li class=""><a href="#examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-angular">Angular</a></li>--> + <li class=""><a href="#examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-csharp">C#</a></li> + <li class=""><a href="#examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-php">PHP</a></li> + <li class=""><a href="#examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-perl">Perl</a></li> + <li class=""><a href="#examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-python">Python</a></li> + </ul> + + <div class="tab-content"> + <div class="tab-pane active" id="examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-curl"> + <pre class="prettyprint"><code class="language-bsh">curl -X GET "http://localhost/onap/so/infra/workflowSpecifications/{version}/workflows?resourceTarget="</code></pre> + </div> + <div class="tab-pane" id="examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-java"> + <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; +import io.swagger.client.auth.*; +import io.swagger.client.model.*; +import io.swagger.client.api.OnapsoinfraworkflowSpecificationsApi; + +import java.io.File; +import java.util.*; + +public class OnapsoinfraworkflowSpecificationsApiExample { + + public static void main(String[] args) { + + OnapsoinfraworkflowSpecificationsApi apiInstance = new OnapsoinfraworkflowSpecificationsApi(); + String version = version_example; // String | + String resourceTarget = resourceTarget_example; // String | + try { + RetrievingWorkflowResponse result = apiInstance.queryWorkflowSpecifications(version, resourceTarget); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling OnapsoinfraworkflowSpecificationsApi#queryWorkflowSpecifications"); + e.printStackTrace(); + } + } +}</code></pre> + </div> + + <div class="tab-pane" id="examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-android"> + <pre class="prettyprint"><code class="language-java">import io.swagger.client.api.OnapsoinfraworkflowSpecificationsApi; + +public class OnapsoinfraworkflowSpecificationsApiExample { + + public static void main(String[] args) { + OnapsoinfraworkflowSpecificationsApi apiInstance = new OnapsoinfraworkflowSpecificationsApi(); + String version = version_example; // String | + String resourceTarget = resourceTarget_example; // String | + try { + RetrievingWorkflowResponse result = apiInstance.queryWorkflowSpecifications(version, resourceTarget); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling OnapsoinfraworkflowSpecificationsApi#queryWorkflowSpecifications"); + e.printStackTrace(); + } + } +}</code></pre> + </div> + <!-- + <div class="tab-pane" id="examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-groovy"> + <pre class="prettyprint language-json prettyprinted" data-type="json"><code>Coming Soon!</code></pre> + </div> --> + <div class="tab-pane" id="examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-objc"> + <pre class="prettyprint"><code class="language-cpp">String *version = version_example; // +String *resourceTarget = resourceTarget_example; // (optional) + +OnapsoinfraworkflowSpecificationsApi *apiInstance = [[OnapsoinfraworkflowSpecificationsApi alloc] init]; + +// Retrieve Workflow details based on the filter criteria +[apiInstance queryWorkflowSpecificationsWith:version + resourceTarget:resourceTarget + completionHandler: ^(RetrievingWorkflowResponse output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error: %@", error); + } + }]; +</code></pre> + </div> + + <div class="tab-pane" id="examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-javascript"> + <pre class="prettyprint"><code class="language-js">var SoGuilinApIs = require('so_guilin_ap_is'); + +var api = new SoGuilinApIs.OnapsoinfraworkflowSpecificationsApi() + +var version = version_example; // {String} + +var opts = { + 'resourceTarget': resourceTarget_example // {String} +}; + +var callback = function(error, data, response) { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}; +api.queryWorkflowSpecifications(version, opts, callback); +</code></pre> + </div> + + <!--<div class="tab-pane" id="examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-angular"> + <pre class="prettyprint language-json prettyprinted" data-type="json"><code>Coming Soon!</code></pre> + </div>--> + <div class="tab-pane" id="examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-csharp"> + <pre class="prettyprint"><code class="language-cs">using System; +using System.Diagnostics; +using IO.Swagger.Api; +using IO.Swagger.Client; +using IO.Swagger.Model; + +namespace Example +{ + public class queryWorkflowSpecificationsExample + { + public void main() + { + + var apiInstance = new OnapsoinfraworkflowSpecificationsApi(); + var version = version_example; // String | + var resourceTarget = resourceTarget_example; // String | (optional) + + try + { + // Retrieve Workflow details based on the filter criteria + RetrievingWorkflowResponse result = apiInstance.queryWorkflowSpecifications(version, resourceTarget); + Debug.WriteLine(result); + } + catch (Exception e) + { + Debug.Print("Exception when calling OnapsoinfraworkflowSpecificationsApi.queryWorkflowSpecifications: " + e.Message ); + } + } + } +} +</code></pre> + </div> + + <div class="tab-pane" id="examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-php"> + <pre class="prettyprint"><code class="language-php"><?php +require_once(__DIR__ . '/vendor/autoload.php'); + +$api_instance = new Swagger\Client\Api\OnapsoinfraworkflowSpecificationsApi(); +$version = version_example; // String | +$resourceTarget = resourceTarget_example; // String | + +try { + $result = $api_instance->queryWorkflowSpecifications($version, $resourceTarget); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OnapsoinfraworkflowSpecificationsApi->queryWorkflowSpecifications: ', $e->getMessage(), PHP_EOL; +} +?></code></pre> + </div> + + <div class="tab-pane" id="examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-perl"> + <pre class="prettyprint"><code class="language-perl">use Data::Dumper; +use WWW::SwaggerClient::Configuration; +use WWW::SwaggerClient::OnapsoinfraworkflowSpecificationsApi; + +my $api_instance = WWW::SwaggerClient::OnapsoinfraworkflowSpecificationsApi->new(); +my $version = version_example; # String | +my $resourceTarget = resourceTarget_example; # String | + +eval { + my $result = $api_instance->queryWorkflowSpecifications(version => $version, resourceTarget => $resourceTarget); + print Dumper($result); +}; +if ($@) { + warn "Exception when calling OnapsoinfraworkflowSpecificationsApi->queryWorkflowSpecifications: $@\n"; +}</code></pre> + </div> + + <div class="tab-pane" id="examples-OnapsoinfraworkflowSpecifications-queryWorkflowSpecifications-0-python"> + <pre class="prettyprint"><code class="language-python">from __future__ import print_statement +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.OnapsoinfraworkflowSpecificationsApi() +version = version_example # String | +resourceTarget = resourceTarget_example # String | (optional) + +try: + # Retrieve Workflow details based on the filter criteria + api_response = api_instance.query_workflow_specifications(version, resourceTarget=resourceTarget) + pprint(api_response) +except ApiException as e: + print("Exception when calling OnapsoinfraworkflowSpecificationsApi->queryWorkflowSpecifications: %s\n" % e)</code></pre> + </div> + </div> + + <h2>Parameters</h2> + + <div class="methodsubtabletitle">Path parameters</div> + <table id="methodsubtable"> + <tr> + <th width="150px">Name</th> + <th>Description</th> + </tr> + <tr><td style="width:150px;">version*</td> +<td> + + + <div id="d2e199_queryWorkflowSpecifications_version"> + <div class="json-schema-view"> + <div class="primitive"> + <span class="type"> + String + </span> + + </div> + <div class="inner required"> + Required + </div> + </div> + </div> +</td> +</tr> + + </table> + + + + + <div class="methodsubtabletitle">Query parameters</div> + <table id="methodsubtable"> + <tr> + <th width="150px">Name</th> + <th>Description</th> + </tr> + <tr><td style="width:150px;">resourceTarget</td> +<td> + + + <div id="d2e199_queryWorkflowSpecifications_resourceTarget"> + <div class="json-schema-view"> + <div class="primitive"> + <span class="type"> + String + </span> + + </div> + </div> + </div> +</td> +</tr> + + </table> + + <h2>Responses</h2> + <h3> Status: default - List of workflow specifications on successful operation </h3> + + <ul class="nav nav-tabs nav-tabs-examples" > + <li class="active"> + <a data-toggle="tab" href="#responses-queryWorkflowSpecifications-default-schema">Schema</a> + </li> + + </ul> + + <div class="tab-content" style='margin-bottom: 10px;'> + <div class="tab-pane active" id="responses-queryWorkflowSpecifications-default-schema"> + <div id='responses-queryWorkflowSpecifications-default-schema-default' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;"> + <script> + $(document).ready(function() { + var schemaWrapper = { + "description" : "List of workflow specifications on successful operation", + "schema" : { + "$ref" : "#/definitions/RetrievingWorkflowResponse" + } +}; + var schema = schemaWrapper.schema; + if (schema.$ref != null) { + schema = defsParser.$refs.get(schema.$ref); + } else { + schemaWrapper.definitions = defs; + $RefParser.dereference(schemaWrapper).catch(function(err) { + console.log(err); + }); + } + + //console.log(JSON.stringify(schema)); + var view = new JSONSchemaView(schema, 3); + $('#responses-queryWorkflowSpecifications-default-schema-data').val(stringify(schema)); + var result = $('#responses-queryWorkflowSpecifications-default-schema-default'); + result.empty(); + result.append(view.render()); + }); + </script> + </div> + <input id='responses-queryWorkflowSpecifications-default-schema-data' type='hidden' value=''></input> + </div> + </div> + + </article> + </div> + <hr> + </section> </div> <div id="footer"> <div id="api-_footer"> diff --git a/docs/developer_info/Cxf_Logging.rst b/docs/developer_info/Cxf_Logging.rst new file mode 100644 index 0000000000..ea2bbf56ce --- /dev/null +++ b/docs/developer_info/Cxf_Logging.rst @@ -0,0 +1,210 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 +.. Copyright 2020 Huawei Technologies Co., Ltd. + +CXF-logging: +============= +It is a logging framework from SO. Here basically we are having 2 interceptors which extends AbstractSoapInterceptor. + +SOAPLoggingInInterceptor: ++++++++++++++++++++++++++++ + +* This interceptor is responsible for Capturing requestId , client ip address , invocation id, service name, instance id, entry timestamp , log timestamp, Elapsed time for each request and update the MDC logger with staus In-progress. + +SOAPLoggingOutInterceptor: +++++++++++++++++++++++++++++ +* This interceptor is responsible for log timestamp , elapsed time for each request and checks for if there is any exception update the MDC loggers with 500 response code otherwise update the status as completed. + + +cxf-logging Used By below components of SO: +++++++++++++++++++++++++++++++++++++++++++++ +The cxf-logging framework is used by below components of so. + +mso-openstack-adapter. +mso-requests-db-adapter. +mso-sdnc-adapter. +mso-infrastructure-bpmn. + +cxf-logging dependency for using in other components: +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + + <dependency> + <groupId>org.onap.so</groupId> + <artifactId>cxf-logging</artifactId> + <version>${project.version}</version> + + </dependency> + +pom.xml: ++++++++++ +<?xml version="1.0"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + + <modelVersion>4.0.0</modelVersion> + <parent> + + <groupId>org.onap.so</groupId> + <artifactId>so</artifactId> + <version>1.6.0-SNAPSHOT</version> + + </parent> + <name>CXFLogging</name> + <description>Common CXF Logging Classes</description> + <dependencies> + + <dependency> + + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-rs-client</artifactId> + <version>${cxf.version}</version> + + </dependency> + + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-bindings-soap</artifactId> + <version>${cxf.version}</version> + + </dependency> + + <dependency> + + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-transports-http</artifactId> + <version>${cxf.version}</version> + + </dependency> + + <dependency> + + <groupId>javax.servlet</groupId> + <artifactId>javax.servlet-api</artifactId> + + </dependency> + + <dependency> + + <groupId>org.slf4j</groupId> + <artifactId>slf4j-ext</artifactId> + + </dependency> + + <dependency> + + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + + </dependency> + + </dependencies> + + <build> + <resources> + <resource> + <directory>src/main/resources</directory> + <filtering>true</filtering> + + </resource> + + <resource> + + <directory>src/main/java</directory> + + <includes> + + <include>*.java</include> + + </includes> + + </resource> + + </resources> + + </build> + + <artifactId>cxf-logging</artifactId> + +</project> + +Configuration file: +++++++++++++++++++++ +Here we can do configure the logger properties for the cxf-logging. + +<configuration> + + <property name="p_tim" value="%d{"yyyy-MM-dd'T'HH:mm:ss.SSSXXX", UTC}"/> + + <property name="p_lvl" value="%level"/> + + <property name="p_log" value="%logger"/> + + <property name="p_mdc" value="%replace(%replace(%mdc){'\t','\\\\t'}){'\n', '\\\\n'}"/> + + <property name="p_msg" value="%replace(%replace(%msg){'\t', '\\\\t'}){'\n','\\\\n'}"/> + + <property name="p_exc" value="%replace(%replace(%rootException){'\t', '\\\\t'}){'\n','\\\\n'}"/> + + <property name="p_mak" value="%replace(%replace(%marker){'\t', '\\\\t'}){'\n','\\\\n'}"/> + + <property name="p_thr" value="%thread"/> + + <property name="pattern" value="%nopexception${p_tim}\t${p_thr}\t${p_lvl}\t${p_log}\t${p_mdc}\t${p_msg}\t${p_exc}\t${p_mak}\t%n"/> + + <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> + + <encoder> + + <pattern>${pattern}</pattern> + + </encoder> + + </appender> + + <appender name="test" + class="org.onap.so.utils.TestAppender" /> + + <logger name="com.att.ecomp.audit" level="info" additivity="false"> + + <appender-ref ref="STDOUT" /> + + </logger> + + <logger name="com.att.eelf.metrics" level="info" additivity="false"> + + <appender-ref ref="STDOUT" /> + + </logger> + + <logger name="com.att.eelf.error" level="WARN" additivity="false"> + + <appender-ref ref="STDOUT" /> + + </logger> + + <logger name="org.onap" level="${so.log.level:-DEBUG}" additivity="false"> + <appender-ref ref="STDOUT" /> + + <appender-ref ref="test" /> + + </logger> + + <logger name="org.flywaydb" level="DEBUG" additivity="false"> + <appender-ref ref="STDOUT" /> + + </logger> + + <logger name="ch.vorburger" level="WARN" additivity="false"> + <appender-ref ref="STDOUT" /> + + </logger> + + <root level="WARN"> + <appender-ref ref="STDOUT" /> + <appender-ref ref="test" /> + + </root> + +</configuration> + diff --git a/docs/developer_info/Mso_Openstack_Adapter.rst b/docs/developer_info/Mso_Openstack_Adapter.rst new file mode 100644 index 0000000000..a8ca362537 --- /dev/null +++ b/docs/developer_info/Mso_Openstack_Adapter.rst @@ -0,0 +1,796 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 +.. Copyright 2020 Huawei Technologies Co., Ltd. + +MSO-OPENSTACK-ADAPTER : +======================= + +.. contents:: :depth: 3 + +Cloud site operations +++++++++++++++++++++++ +* Here we have 3 api's createCloudRegion, updateCloudRegion, deleteCloudRegion. + +1.Create Cloud site/Cloud region: + +Path: /v1/cloud-region + +Method Type: POST + +Request Body: +************* +{ + "id": "MTN13", + "regionId": "mtn13", + "cloudVersion": "3.0", + "clli": "MDT13", + "platform": "testFlatform", + "orchestrator": "testOrchestrator", + "cloudifyId": "mtn13", + "cloudOwner": "testCloudOwner", + + "identityService": { + "identityUrl": "testUrl", + "msoId": "admin", + "msoPass": "admin", + "projectDomainName": "testDomain", + "userDomainName": "testDomain", + "adminTenant": "test", + "memberRole": "test", + "tenantMetadata": "test", + "identityServerType": "test", + "identityAuthenticationType": "test", + "lastUpdatedBy": "test", + "created": "date", + "updated": "date" + + }, + + "identityServiceId": "123", + "lastUpdatedBy": "test", + "created": "test", + "updated": "test", + "supportFabric": "true", + "uri": "test" + +} + +* In this api we can create cloud region and cloud site and saving in catalog db and in AAI. + +* This api requires cloud-region-id and cloudSite as inputs. + +* In createCloudRegion two steps are there. + +* CreateRegionInCatalogDb(cloudSite) :- here we are creating cloud region in catalogdb if it is not exists in db(cloud_sites). + +* CreateCloudRegionInAAI(cloudSite) :- mapping cloudSite into cloudregion , this cloudregion we are creating in AAI and create CloudRegion NetworkTechnology Relationship. + +2.Delete Cloud site: + +* Path:/v1/cloud-region/{cloud-region-id}/{cloud-owner} + +* Here we can delete Cloud site by cloud region id + +3.Update Cloud site: + +* Path:/v1/cloud-region/{cloud-region-id}/{cloud-owner} + +* Here we can update Cloud site by cloud region id + +Create Tenant in Cloud: +++++++++++++++++++++++++ + +Path: http://host:port/vnfs/rest/v1/tenants + +Method Type: POST + +Request Body: +************* + +{ +"cloudSiteId": "DAN", +"tenantName":"RAA_1", +"failIfExists": true, +"msoRequest": { +"requestId": "ra1", +"serviceInstanceId":"sa1" +} +} + +RESPONSE: +********** + +{ + +"cloudSiteId": "DAN", +"tenantId": "128e10b9996d43a7874f19bbc4eb6749", +"tenantCreated": true, +"tenantRollback": { +"tenantId": "128e10b9996d43a7874f19bbc4eb6749", +"cloudId": "DAN", // RAA? cloudId instead of cloudSiteId +"tenantCreated": true, +"msoRequest": { +"requestId": "ra1", +"serviceInstanceId": "sa1" + +} +} +} + +Code Flow: + +* Call to MSO createTenant adapter then call to catalog db for cloud site info and from cloud site get IdentityServerType. +* based on Cloud IdentityServerType it returns ORM or KEYSTONE Utils +* Query for a tenant with the specified name in the given cloud. If the tenant exists, return an MsoTenant object. If not, return null. +* Create a tenant with the specified name in the given cloud. If the tenant already exists, an Exception will be thrown. The MSO User will also be added to the "member" list of the new tenant to perform subsequent Nova/Heat commands in the tenant. If the MSO User association fails, the entire transaction will be rolled back. + +TaskServices +++++++++++++++ +**1. CreateInventory** + +Flow Diagram: + +.. image :: ../images/InventoryCreate.png + +Code Flow: + +* Get cloud site using cloud region id from catalog db. + +* Instantiate heat bridge client by passing required values. + +* Authenticate heat bridge client. + +* If authentication is success we are getting all stack resources(openstack servers. servers contains openstack images and flavours.) + +* From stack resources we are getting osServers/ compute resources. + +* CreatePserversAndPinterfacesIfNotPresentInAai --Transform Openstack Server object to AAI Pserver object. create pserver in AAI if it is not exist. and get openstackresource id's / ports -- transform ports to pinterface Object in AAI. + +* After extract osimages and os flavours from osservers. + +* After that transform osimages to AAI images and osflavours to AAI flavors and add to AAI. + +* Create Vservers in AAI and make relationships to AAI image, AAI flavor, AAI pserver, vf-module. + +* Add Vservers and Linterfaces to AAI--Transform port to Linterface and for that port Get Ip addresses and updateLInterfaceIps and updateLInterfaceVlan. + +* Finally update AAI. + +**2. AuditCreateStack** + +Flow Diagram: + +.. image :: ../images/InventoryAddAudit.png + +Code Flow: + +* First we are capturing entry timestamp, MSO REQUESTID, Servicename/topic name,partnername as openstack adapter, invocation id is generating one random uuid. + +* After that getting auditInventory details from externalTask object + +* From auditInventory object we are getting cloud region,clowd owner,tenant id, heatstack name.these details we are passing to get AAIObjectAuditList. + +* Use cloudRegion, tenantId, heatStackName to get resources from Heat client. + +* To get resources we need heat client it means getting keystone url and token. + +* Get keystone url based on server type(keystone/keystonev3) + +* From resources object we are getting novaResources and resource groups and neutronPortDetails. + +* Create VserverSet by passing resources, novaResources, neutronPortDetails and setting up servers with ports to Set of Servers. + +* From resource groups we are getting Link(stackLink) from that link we are extracting resource path .if path is present we are Fetching nested Resource Stack Information. + +* audit all vservers,l-interfaces and sub l-interfaces. and checking in these vservers , l-interfaces and sub interfaces are existed or not in AAI. + +* If AAIObjectAuditList is present then we are setting audit type as create and Heat stack name to AAIObjectAuditList. + +* If Audit create success putting in variable to complete external task other wise sending exception. + +* If retrycount=1 sending error as retrycount exhausted. + +**3. AuditQueryStack** + +Flow Diagram: + +.. image :: ../images/InventoryQueryAudit.png + + +Code Flow: + +* Get AuditInventory details from external task. + +* Get AAIObjectAuditList from auditHeatStack by passing these parametersauditInventory.getCloudRegion(),auditInventory.getCloudOwner(), auditInventory.getTenantId(), auditInventory.getHeatStackName(). + +* Fetching Top Level Stack Information.i.e get all the heat model resources. + +* From heat model resources get all OS::Nova::Servers and OS::Heat::ResourceGroups and neutronPortDetails. + +* Once u got all the stack info u create vserverset and add that vserverset to AAIObjectAuditList. + +* After add AAIObjectAuditList to requestdb if it is not exist in requestdb. + +* If it is success complete the external task. + +**4. AuditDeleteStack** + +Flow Diagram: + +.. image :: ../images/InventoryDeleteAudit.png + +Code Flow: + +* Get AuditInventory details from external task + +* GetStackDataFromRequestDb usiing AuditInventory details. + +* Get RequestProcessingData from requestdb using auditInventory.getVfModuleId(),auditInventory.getHeatStackName(), "AuditStackData". + +* From RequestProcessingData get AAIObjectAuditList. + +* If AAIObjectAuditList is empty check vservers is exist or not in AAI and set that result as setDoesObjectExist(true/false). + +* Else Auditing Vservers based on vf module relationships--i.e based on genericVnfId and vfModuleName get all the vservers and create AAIObject and set setDoesObjectExist(true) and set that object to list. + +* After that set audit type as delete and heatstackname and check that audit create success or not. + +* If it is success complete the external task. + +**5. DeleteInventory** + +Flow Diagram: + +.. image :: ../images/DeleteInventory.png + + +Code Flow: + +* Get CloudInformation from external task. + +* First get CloudSite details from catalog db by using regionid. + +* From CloudSite get CloudIdentity details. + +* Create a heatbridgeclient. and authenticate the heatbridge. + +* After that delete the VFmodule data using vnfid and vf moduleid. + +* Once delete success complete the external task. + +**6. StackService** + +Flow Diagram: + +.. image :: ../images/OpenstackAdapterInvoke.png + + +Code Flow: + +* From external task getting openstackAdapterTaskRequest and adding to string(xmlRequest). + +* From xmlrequest we are getting requestType. + +1. If requestType is createVolumeGroupRequest then we are creating volume group. + +* Marshalling xmlRequest to CreateVolumeGroupRequest. + +* From CreateVolumeGroupRequest getting completeVnfVfModuleType. + +* After that we are creating vf module by passing required paremeters. + +* If request type Start with X then we are orchestrating a VNF - *NOT* a module! + +* RequestType start with Volume then then we are sending true as volume request. + +* Creating a VnfRollback object by passing required parameters. + +* If nestedStackId is not null we are getting nested heat stack(stack information). + +* If nested heat stack is not null we are getting that output and storing into nestedVolumeOutputs object. + +* If nestedBaseStackId is not null we are getting nestedBaseHeatStack information and setting output to nestedBaseHeatStack. + +* If modelCustomizationUuid is available then with that mcu we are getting VFModuleCustomization(vfmc); + +* If we get VFModuleCustomization then we are extracting VfModule. + +* If vf version is not null then we will get vnfresource by passing vnftype and vnfversion. + +* By here - we would have either a vf or vnfResource. + +* If vf module is not null we are geting vnfresource from vf and from this vnfresource we are getting minversionvnf and maxversionvnf. + +* If minversionvnf and maxversionvnf are not null we are checking cloudConfig is null or not, if cloudConfig is not null then we are getting cloud site intormation by passing cloud site id. once we get the cloud site details we are getting min and max cloud site versions. + +* By the time we get here - heatTemplateId and heatEnvtId should be populated (or null) + +* If it is old way we will get heatTemplate directly. else if vf module is not null then +* If it is a volume request then we will get volumeheattemplate and volumeheatenvironment. +* If it is not a volume request then we will get ModuleHeatTemplate and HeatEnvironment. + +* Once we get heat templates we are getting nestedtemplates. + +* Also add the files: for any get_files associated with this vnf_resource_id + +* Add ability to turn on adding get_files with volume requests (by property). + +* If it is not a volume request get heat files from vf module. + +* CheckRequiredParameters in MsoVnfAdapterImpl.CHECK_REQD_PARAMS. + +* Parse envt entries to see if reqd parameter is there (before used a simple grep + +* Only submit to openstack the parameters in the envt that are in the heat template + +* Convert what we got as inputs (Map<String, String>) to a Map<String, Object> - where the object matches the param type identified in the template This will also not copy over params that aren't identified in the template + +* Now simply add the outputs as we received them - no need to convert to string + +* Add in the volume stack outputs if applicable + +* Get all heat template parameters and add to list. + +* Check for missing parameters null or not.if no missing parameters we can proceed for next step. + +* Next create stack with all required values. + +* After creating add heat stackname to vfrollback and copy heatstack outputs to outputs value. so now vf module is created successfully. + +* After sending the response to create volume group.once it is created that response we are setting to VolumeGroup response object. + +2. If requestType is createVfModuleRequest then we are creating VfModule. + +* Marshalling xmlRequest to CreateVolumeGroupRequest. + +* From CreateVolumeGroupRequest getting completeVnfVfModuleType. + +* After that we are creating vf module by passing required paremeters. + +* If request type Start with X then we are orchestrating a VNF - *NOT* a module! + +* RequestType start with Volume then then we are sending true as volume request. + +* Creating a VnfRollback object by passing required parameters. + +* If nestedStackId is not null we are getting nested heat stack(stack information). + +* If nested heat stack is not null we are getting that output and storing into nestedVolumeOutputs object. + +* If nestedBaseStackId is not null we are getting nestedBaseHeatStack information and setting output to nestedBaseHeatStack. + +* If modelCustomizationUuid is available then with that mcu we are getting VFModuleCustomization(vfmc); + +* If we get VFModuleCustomization then we are extracting VfModule. + +* If vf version is not null then we will get vnfresource by passing vnftype and vnfversion. + +* By here - we would have either a vf or vnfResource. + +* If vf module is not null we are geting vnfresource from vf and from this vnfresource we are getting minversionvnf and maxversionvnf. + +* If minversionvnf and maxversionvnf are not null we are checking cloudConfig is null or not, if cloudConfig is not null then we are getting cloud site intormation by passing cloud site id. once we get the cloud site details we are getting min and max cloud site versions. + +* By the time we get here - heatTemplateId and heatEnvtId should be populated (or null) + +* If it is old way we will get heatTemplate directly. else if vf module is not null then + +* If it is a volume request then we will get volumeheattemplate and volumeheatenvironment. + +* If it is not a volume request then we will get ModuleHeatTemplate and HeatEnvironment. + +* Once we get heat templates we are getting nestedtemplates. + +* Also add the files: for any get_files associated with this vnf_resource_id + +* Add ability to turn on adding get_files with volume requests (by property). + +* If it is not a volume request get heat files from vf module. + +* CheckRequiredParameters in MsoVnfAdapterImpl.CHECK_REQD_PARAMS. + +* Parse envt entries to see if reqd parameter is there (before used a simple grep + +* Only submit to openstack the parameters in the envt that are in the heat template + +* Convert what we got as inputs (Map<String, String>) to a Map<String, Object> - where the object matches the param type identified in the template This will also not copy over params that aren't identified in the template + +* Now simply add the outputs as we received them - no need to convert to string + +* Add in the volume stack outputs if applicable + +* Get all heat template parameters and add to list. + +* Check for missing parameters null or not.if no missing parameters we can proceed for next step. + +* Next create stack with all required values. + +* After creating add heat stackname to vfrollback and copy heatstack outputs to outputs value. so now vf module is created successfully. + +3. If requestType is deleteVfModuleRequest then we are deleting VfModule . + +* Get stackinfo using msoHeatUtils by passing cloudSiteId, cloudOwner, tenantId, vnfName parameters. + +* After that using modelCustomizationUuid we are getting VFModuleCustomizaiton--VFModule--heattemplate. + +* After that we are callling msoHeatUtils.deleteStack to delete StackInfo once it deletes we are updating status as deleted using msoHeatUtils.updateResourceStatus. + +4. If requestType is deleteVolumeGroupRequest then we are deleting volume group. + +* Making DeleteVolumeGroupRequest by Unmarshalling xml request. + +* Getting stack information by passing stackName, cloudSiteId, tenantId. + +* If current stack is null then we confirm that heat status not found. + +* If current stack is not null then we are deleting the stack. + +* Once volumegroup is deleted we are setting the response to perticular response class. + +5. If requestType is createNetworkRequest then we are creating network. + +* Making CreateNetworkRequest by Unmarshalling xmlrequest. + +* Check request is contrailRequest or not if it is contrailRequest we are setting shared,external,routeTargets,fqdns,routeTable values else we are setting physicalNetworkName and vlans. + +* Now all the above required values we are passing to create network. + +* Build a default NetworkRollback object (if no actions performed). + +* Getting the cloud site by passing cloudsite id. + +* After we are doing a network check and Retrieve the Network Resource definition. + +* If modelCustomizationUuid null and networkType is not null based on networkType we are getting Network Resource. + +* If modelCustomizationUuid not null then based on modelCustomizationUuid we are getting NetworkResourceCustomization and from that we are getting Network Resource. + +* If NetworkResourceCustomization is null then based on modelCustomizationUuid we are getting CollectionNetworkResourceCustomization and from that we are getting Network Resource. + +* Even though Network Resource is null we are sending error Unable to get network resource with NetworkType. + +* From the network resource we are extracting mode and network type. + +* All Networks are orchestrated via HEAT or Neutron if it is other than that we are sending error. + +* After that we are checking network resorce min and max versions with cloud site version if version is not supported throwing error. + +* After that validating the network parameters that if any parameter is missing. + +* Once we Retrieve the Network Resource we are getting heat template and NetworkType from that. + +* From the heat template we are getting template and checking that template contains os3nw if it is contains making flag is true. + +* First, look up to see if the Network already exists (by name).For HEAT orchestration of networks, the stack name will always match the network name + +* If stack is already exist with the network name throw an error. + +* After that from stackinfo get network id and network fqdn and get outputs from Stackinfo. + +* After that get subnetIdMap based on one subnet_id output or multiples subnet_%aaid% outputs from Stackinfo outputs. + +* After that update the updateResourceStatus as exits in requestdb. + +* Now we are Ready to deploy the new Network and Build the common set of HEAT template parameters + +* Validate (and update) the input parameters against the DB definition + +* Shouldn't happen unless DB config is wrong, since all networks use same inputs and inputs were already validated. + +* If subnets are not null and template is os3template then mergesubnetsAIC3. + +* If subnets are not null and template is not os3template then merge subnets. + +* If policyFqdns are not null & os3template true then mergePolicyRefs. + +* After that deploy the network stack-- create stack and once stack is created save into stackinfo. + +* For Heat-based orchestration, the MSO-tracked network ID is the heat stack, and the neutronNetworkId is the network UUID returned in stack outputs. + +* After update the resource status like network created successfully. + +* After set response to CreateNetworkResponse object. + + +6. If requestType is deleteNetworkRequest then we are deleting network. + +* Form a DeleteNetworkRequest by unmarshlling Xml request. + +* check for mandatory fields networkId, cloudSiteId, tenantId. + +* If it is there Retrieve the Network Resource definition. + +* After that get networkResource.from networkResource get heat template. + +* After that delete stackinfo udpate resource status as deleted. + +7. If requestType is updateNetworkRequest then we are updating Network. + +* Make UpdateNetworkRequest by unmarshalling xmlRequest. + +* Check the params contains key shared and external if it is contains get that shared and external keys. + +* Check the request is ContrailRequest or not, if it is ContrailRequest then get routeTargets , fqdns, routeTable from the actual request. + +* If it is not ContrailRequest then get the ProviderVlanNetwork details like physicalNetworkName and vlans. + +* Params to update network-req.getCloudSiteId(), req.getTenantId(), req.getNetworkType(),req.getModelCustomizationUuid(), req.getNetworkStackId(), req.getNetworkName(), physicalNetworkName,vlans, routeTargets, shared, external, req.getSubnets(), fqdns, routeTable, req.getMsoRequest(), subnetIdMap, networkRollback. + +* Update Network adapter with Network using networkName, networkType,cloudSiteId, tenantId. + +* Capture execution time for metrics. + +* Build a default rollback object (no actions performed) + +* Get cloud site details from catalog db using cloud site id. + +* If cloud site is not present send the error message like CloudSite does not exist in MSO Configuration. + +* Getting the cloud site by passing cloudsite id. + +* After we are doing a network check and Retrieve the Network Resource definition. + +* If modelCustomizationUuid null and networkType is not null based on networkType we are getting Network Resource. + +* If modelCustomizationUuid not null then based on modelCustomizationUuid we are getting NetworkResourceCustomization and from that we are getting Network Resource. + +* If NetworkResourceCustomization is null then based on modelCustomizationUuid we are getting CollectionNetworkResourceCustomization and from that we are getting Network Resource. + +* Even though Network Resource is null we are sending error Unable to get network resource with NetworkType. + +* From the network resource we are extracting mode and network type. + +* All Networks are orchestrated via HEAT or Neutron if it is other than that we are sending error. + +* After that we are checking network resorce min and max versions with cloud site version if version is not supported throwing error. + +* After that validating the network parameters that if any parameter is missing. + +* Once we Retrieve the Network Resource we are getting heat template and NetworkType from that. + +* Use an MsoNeutronUtils for all Neutron commands + +* If Orchestaration mode is NEUTRON Verify that the Network exists and For Neutron-based orchestration, the networkId is the Neutron Network UUID. + +* Get NetworkInfo from cloud site using networkId, tenantId, cloudSiteId as params. + +* If NetworkInfo is null then throw the error message as Network is does not exist. + +* Update the network in cloud site which is in catalog db using cloudSiteId,tenantId,networkId, neutronNetworkType, physicalNetworkName, vlans as params. + +* Add the network ID and previously queried vlans to the rollback object. + +* Save previous parameters such as NetworkName,PhysicalNetwork,Vlans to the NetworkRollback. + +* If Orchestaration mode is HEAT then First, look up to see that the Network already exists. For Heat-based orchestration, the networkId is the network Stack ID. + +* Get StackInfo by querystack using cloudSiteId, CLOUD_OWNER, tenantId, networkName. + +* If StackInfo is null throw error as Network not found else continue the flow. + +* Get the previous parameters such as previousNetworkName and previousPhysicalNetwork for rollback from StackInfo. + +* Get the previous vlans from the heat params and Update Stack with Previous VLANS. + +* Now we are Ready to deploy the updated Network via Heat. + +* Get the HeatTemplate from NetworkResource and now we got HEAT Template from DB. + +* Now get the OS::ContrailV2::VirtualNetwork property from property file , if template contains os3nw set flag as true. + +* Build the common set of HEAT template parameters such as neutronNetworkType, networkName, physicalNetworkName, vlans, routeTargets, shared, external, os3template. + +* Validate and update the input parameters against the DB definition and Shouldn't happen unless DB config is wrong, since all networks use same inputs. + +* If subnets are not null and template is os3template then mergesubnetsAIC3. + +* If subnets are not null and template is not os3template then merge subnets. + +* If policyFqdns are not null & os3template true then mergePolicyRefs. + +* If routeTableFqdns are not null os3template not null then mergeRouteTableRefs using routeTableFqdns, stackParams as params. + +* Get outputs from StackInfo and if key is contains subnet and os3template not null then one subnet output expected else multiples subnet outputs allowed. + +* Reach this point if createStack is successful.Populate remaining rollback info and response parameters and save previous parameters. + +* Now Network successfully updated via HEAT. + +8. If requestType is rollbackNetworkRequest then we are doing rollbackNetwork. + +* Make RollbackNetworkRequest by unmarshalling xmlRequest. + +* Get NetworkRollback from RollbackNetworkRequest. + +* If pollForCompletion is null then set flag as true. + +* Get the elements of the VnfRollback object for easier access. + +* ROLLBACK Network using networkId, cloudSiteId, tenantId. + +* If NetworkCreated then use tenantId, CLOUD_OWNER, cloudSiteId, networkId, pollForCompletion, timeoutMinutes params to delete stack. + +* Once deletion is success set the response to RollbackNetworkResponse. + +* Once task stack service is success set the status completed for the external task. + + +**7. PollService** + +Flow Diagram: + +.. image :: ../images/OpenstackAdapterPoller.png + + +Code Flow: + +* Get openstackAdapterTaskRequest as xmlRequest from the the external task. + +* Get requestType from the xmlRequest. + +1. If request type is createVolumeGroupRequest then Execute External Task Rollback Service for Create Volume Group. + +* Create CreateVolumeGroupRequest by unmarshalling xmlRequest. + +* Use CloudSiteId, CloudOwner, TenantId,VolumeGroupName, MsoRequest ,pollStackStatus as params to delete vnf. + +* Call to openstack to delete vnf if it is success nothing to return if it is failure return failure exception. + +* Once it is success set the boolean flags pollRollbackStatus and status as true. + +2. If request type is createVfModuleRequest then Execute External Task Rollback Service for Create Vf Module. + +* Create CreateVfModuleRequest by unmarshalling xmlRequest. + +* Use CloudSiteId, CloudOwner, TenantId,VfModuleName, VnfId, VfModuleId, ModelCustomizationUuid,MsoRequest ,Holder as params to delete vf module. + +* Call to openstack to get the stack outputs. + +* If modelCustomizationUuid is not null then use as a param to get the VfModuleCustomization and from VfModuleCustomization get the vf module details. + +* Use tenantId, cloudOwner, cloudSiteId, vnfName, pollForCompletion, timeoutMinutes as params to delete the stack .once it is success update the resources. + +* Once it is success set the boolean flags pollRollbackStatus and status as true. + +3. If requestType is deleteVfModuleRequest then Execute External Task Poll Service for Delete Vf Module. + +* Create DeleteVfModuleRequest by unmarshalling xmlRequest. + +* Get stackId from external task by using that get Stack. + +* Get pollingFrequency from properties file and calculate no.of polling attempts. + +* Using cloudSiteId, tenantId get Heatclient and once you got heatclient querystack to get the Stack object. + +* If Stack object is not null update the stack status in requestdb and it returns Stack object. + +* If Stack object is not null check the status is DELETE_COMPLETE then Stack Deletion completed successfully. + + +4. If requestType is deleteVolumeGroupRequest then Execute Execute External Task Poll Service for Delete Volume Group. + +* Create DeleteVfModuleRequest by unmarshalling xmlRequest. + +* Get stackId from external task by using that get Stack. + +* Get pollingFrequency from properties file and calculate no.of polling attempts. + +* Using cloudSiteId, tenantId get Heatclient and once you got heatclient querystack to get the Stack object. + +* If Stack object is not null update the stack status in requestdb and it returns Stack object. + +* If Stack object is not null check the status is DELETE_COMPLETE then Stack Deletion completed successfully. + +5. If requestType is deleteNetworkRequest then Execute External Task Poll Service for Delete Network. + +* Create DeleteVfModuleRequest by unmarshalling xmlRequest. + +* Get stackId from external task by using that get Stack. + +* Get pollingFrequency from properties file and calculate no.of polling attempts. + +* Using cloudSiteId, tenantId get Heatclient and once you got heatclient querystack to get the Stack object. + +* If Stack object is not null update the stack status in requestdb and it returns Stack object. + +* If Stack object is not null check the status is DELETE_COMPLETE then Stack Deletion completed successfully. + +6. If requestType is createNetworkRequest then get the PollRollbackStatus from the external task. + +* If pollRollbackStatus is true then Execute External Task Poll Service for Rollback Create Network. + +* Get stackId from external task by using that get Stack. + +* Get pollingFrequency from properties file and calculate no.of polling attempts. + +* Using cloudSiteId, tenantId get Heatclient and once you got heatclient querystack to get the Stack object. + +* If Stack object is not null update the stack status in requestdb and it returns Stack object. + +* If Stack object is not null check the status is DELETE_COMPLETE then Stack Deletion completed successfully. + +* If pollRollbackStatus is false then Execute External Task Poll Service for Create Network. + +* Get stackId from external task by using that get Stack. + +* Get pollingFrequency from properties file and calculate no.of polling attempts. + +* Using cloudSiteId, tenantId get Heatclient and once you got heatclient querystack to get the Stack object. + +* If Stack object is not null update the stack status in requestdb and it returns Stack object. + +* If Stack object is not null check the status is CREATE_COMPLETE then Stack Creation completed successfully. + +7. If requestType is createNetworkRequest then Execute External Task Rollback Service for Create Network. + +* Get stackId from external task by using that get Stack. + +* Get pollingFrequency from properties file and calculate no.of polling attempts. + +* Using cloudSiteId, tenantId get Heatclient and once you got heatclient querystack to get the Stack object. + +* If Stack object is not null update the stack status in requestdb and it returns Stack object. + +* If Stack object is not null check the status is UPDATE_COMPLETE then Stack Updation completed successfully. + +* Once task stack service is success set the status completed for the external task. + +**8. RollbackService** + +Flow Diagram: + +.. image :: ../images/OpenstackAdapterRollback.png + + +Code Flow: + +* Get openstackAdapterTaskRequest as xmlRequest from the the external task. + +* Get requestType from the xmlRequest. + +1. If request type is createVolumeGroupRequest then Execute External Task Rollback Service for Create Volume Group. + +* Making DeleteVolumeGroupRequest by Unmarshalling xml request. + +* Getting stack information by passing stackName, cloudSiteId, tenantId. + +* If current stack is null then we confirm that heat status not found. + +* If current stack is not null then we are deleting the stack. + +* Once volumegroup is deleted we are setting the response to perticular response class. + +2. If request type is createVfModuleRequest then Execute External Task Rollback Service for Create Vf Module. + +* Get stackinfo using msoHeatUtils by passing cloudSiteId, cloudOwner, tenantId, vnfName parameters. + +* After that using modelCustomizationUuid we are getting VFModuleCustomizaiton--VFModule--heattemplate. + +* After that we are callling msoHeatUtils.deleteStack to delete StackInfo once it deletes we are updating status as deleted using msoHeatUtils.updateResourceStatus. + +* Once it is success set the boolean flags pollRollbackStatus and status as true. + +3. If request type is createNetworkRequest then Execute External Task Rollback Service for Create Network. + +* Form a DeleteNetworkRequest by unmarshlling Xml request. + +* Check for mandatory fields networkId, cloudSiteId, tenantId. + +* If it is there Retrieve the Network Resource definition. + +* After that get networkResource.from networkResource get heat template. + +* After that delete stackinfo udpate resource status as deleted. + +* Once task stack service is success set the status completed for the external task. + + + + + + + + + + + diff --git a/docs/developer_info/developer_information.rst b/docs/developer_info/developer_information.rst index 570861345c..a060da60b0 100644 --- a/docs/developer_info/developer_information.rst +++ b/docs/developer_info/developer_information.rst @@ -20,5 +20,7 @@ SO Developer Information BPMN_Subprocess_Process_Flows.rst BPMN_Project_Deployment_Strategy.rst BPMN-INFRA_Workflow_Understanding.rst + Mso_Openstack_Adapter.rst + Cxf_Logging.rst instantiate/index.rst FAQs.rst diff --git a/docs/developer_info/mso_adapter_restinterface.rst b/docs/developer_info/mso_adapter_restinterface.rst new file mode 100644 index 0000000000..49a9cadba4 --- /dev/null +++ b/docs/developer_info/mso_adapter_restinterface.rst @@ -0,0 +1,288 @@ +Mso-adapters-rest-interface +--------------------------- +.. image:: ../images/module_structure.png + +It mainly contains the payload that is provided to different rest calls in SO + +Network +-------- +# 1. Network contain beans( classes with multiple attributes and thier setters and getters) and their corresponding mappers which will be used by the network adapter of SO. Contrail networking is used for cloud network automation + +Beans +----- + # a. ContrailPolicyRef : this class has following attribute + private ContrailPolicyRefSeq seq; + + Usage: adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java- while creating network in openstack, network stack is created depending on stackParams. So if pFqdns(FQDN address object is used in order to use DNS names in firewall policies) are there in the inputrequest to createNetwork, then mergePolicyRefs method is called, where for each input pFqdns, a new ContrailPolicyRef is created and appended to a list. Then this is added as value to stackParams with policy_refsdata as key. + + # b. ContrailPolicyRefSeq : Attributes are + private String major; + + private String minor ; + + Usage: adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java- As this is an attribute to the ContrailPolicyRef explained above. So when a new ContrailPolicyRef() is created in mergePolicyRefs method, correspondingly a new ContrailPolicyRefSeq should be created. + + # c. ContrailSubnet – Its a subnetwork having attributes + private ContrailSubnetIp subnet = new ContrailSubnetIp(); + + private String defaultGateway; + + private String subnetName; + + private Boolean enableDhcp(dynamic host config); + + private Boolean addrFromStart = true; + + private List<ContrailSubnetPool> allocationPools = new ArrayList<>(); + + private ContrailSubnetHostRoutes hostRoutes = new ContrailSubnetHostRoutes(); + + Usage : adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java- While creating network mergeSubnetsAIC3 is called if a list of subnets are present. The subnets are mapped to ContrailSubnet using ContrailSubnetMapper, and then are added to the heat template and stackparams which are used for network creation in openstack. + + # d. ContrailSubnetHostRoute : This is an attribute defined in contrailsubnet and has following attributes + private String prefix; + + private String nextHop; + + Usage : This is an attribute of ContrailSubnetHostRoutes , which is used within the contrailSubnet and thus is used in network creation and updation. + + # e. ContrailSubnetHostRoutes : This class is used to store an list of ContrailSubnetHostRoute + + private List<ContrailSubnetHostRoute> hostRoutes = new ArrayList<>(); + + Usage : attribute of contrailSubnet + + # f. ContrailSubnetIp : attributes are + private String ipPrefix; + + private String ipPrefixLen; + + This class is used to store the cidr value , which is used as a interrouting table, taking as ipaddress/total no . Eg : 10.0.0.0/24 means starting ip is 10.0.0.0, and total no of ip address possible here is 256 (2^(32-24)), the last address being 10.0.0.255. + + Usage : important attribute of contrailSubnet + + # g. ContrailSubnetPool : attributes are starting and ending ip address of the subnet + private String start; + + private String end; + + Usage: a list of ContrailSubnetPool forms an important attribute of contrailSubnet + +Mappers +------- + + # a. ContrailSubnetMapper : It is used to map the inputsubnet to a contrailSubnet + public ContrailSubnetMapper(Subnet inputSubnet) { + this.inputSubnet = inputSubnet; + + } + + The map method within is used for the mapping. Here first a contrailSubnet is created, and depending on whether the subnet has name or id, the contrailSubnet’s name is initialized, then if it has cidr , then a contrailSubnetIp is created, and is added into it, which is then added to contrailSubnet created before. Depending on whether input has allocationpool or hostroutes, these are casted into ContrailSubnetPool and ContrailSubnetHostRoute using ContrailSubnetPoolMapper and ContrailSubnetPoolMapper respectively. + + Usage: adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java :The subnets are mapped to ContrailSubnet using ContrailSubnetMapper, and then are added to the heat template and stackparams which are used for network creation + + # b. ContrailSubnetPoolMapper : It is used to map the pool within the subnets to contrailSubnetPool. Used within contrailSubnetMapper. Here, the particular pool is added only if it has both the start and end ip address. + + # c. ContrailSubnetHostRoute : It is used to map the host routes within the subnets to contrailSubnetHostRoute. Used within contrailSubnetMapper. Here, the particular host route is added if either of the next hop or ip prefix is defined. + +Network request +--------------- + +#2. Network request : It contains the payloads for different types of network requests + + # a. ContrailNetwork : + private String shared = "false"; + + private String external = "false"; + + private List<RouteTarget> routeTargets; + + private List<String> policyFqdns; + + private List<String> routeTableFqdns; + + Usage: contrailNetwork is an important attribute of CreateNetworkRequest, So is to be used where all the request to createNetwork is required. + + # 1. adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/StackService.java : Here the input to createNetwork requires contrailNetwork parameter, so here it checks whether contrailNetwork is already present, if not a new is created. + + # 2.bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapper.java : Here in createNetworkRequestMapper, createNetworkRequest is formed where in buildContrailNetwork, a new contrailNetwork is created and initialized. This request is used to create a network and set the corresponding execution variable + + # b. CreateNetworkError: It extends NetworkExceptionResponse. And is used when an error occurs during network creation + + # c. NetworkExceptionResponse : it extends NetworkResponseCommon. Attributes are + private String message; + + private MsoExceptionCategory category; + + private Boolean rolledBack; + + # d. NetworkResponseCommon: Attribute is + private String messageId; + + # e. CreateNetworkRequest: extends NetworkRequestCommon + private String cloudSiteId; + + private String tenantId; + + private String networkId; + + private String networkName; + + private String networkType; + + private String networkTypeVersion; + + private String modelCustomizationUuid; + + private String networkTechnology = "NEUTRON"; + + private List<Subnet> subnets; + + private ProviderVlanNetwork providerVlanNetwork; + + private ContrailNetwork contrailNetwork; + + private Boolean failIfExists = false; + + private Boolean backout = true; + + private Map<String, String> networkParams = new HashMap<>(); + + private MsoRequest msoRequest = new MsoRequest(); + + private boolean contrailRequest; + + Usage : + #1) bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIQueryTasks.java: Here in getNetworkVpnBinding, where VPN Binding data from AAI result is extracted. There in routeTargets is got, and is updated in the execution variable(“createNetworkRequest”). + + #2)bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterCreateTasks.java – Here in createnetwork returns a CreateNetworkRequest which is updated in execution variable(“networkAdapterRequest”) + + #3)bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CreateNetwork.java - + Here in createnetwork returns a CreateNetworkRequest which is updated in execution variable(“createNetworkRequest”) + + #4) bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/NetworkAdapterClientImpl.java -Here createNetwork request is processed as a restclient post process with CreateNetworkRequest as input. + + # f. CreateNetworkResponse : extends NetworkResponseCommon + private String networkId; + + private String neutronNetworkId; + + private String networkStackId; + + private String networkFqdn; + + private Boolean networkCreated; + + private Map<String, String> subnetMap; + + private NetworkRollback rollback = new NetworkRollback(); + + Usage: + #1)bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java :here after the network is created, the l3 network is updated with those parameters which come from execution variable("createNetworkResponse") + + #2)bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterCreateTasks.java – depending on variable networkCreated of response, networkAdapterCreateRollback is set to true. + + #3)bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/NetworkAdapterClientImpl.java -Here createNetwork request is processed as a restclient post process with CreateNetworkRequest as input and CreateNetworkResponse as output + + # g.DeleteNetworkError : extends NetworkExceptionResponse + + # h. DeleteNetworkRequest:extends NetworkRequestCommon + private String cloudSiteId; + + private String tenantId; + + private String networkId; + + private String networkStackId; + + private String networkType; + + private String modelCustomizationUuid; + + private MsoRequest msoRequest = new MsoRequest(); + + Usage: + #1)bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterDeleteTasks.java – deleteNetworkRequestMapper returns a DeleteNetworkRequest, which is set to the execution variable(“networkAdapterRequest”) + + #2)bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/NetworkAdapterClientImpl.java - Here deleteNetwork request is processed as a restclient delete process with DeleteNetworkRequest as input. + + #3)bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapper.java – Here the deleteNetworkRequestMapper forms DeleteNetworkRequest object + + Similarly others are also implemented and used + +.. image:: ../images/nwrest.png + +Sdnc request +------------ + +#3. Sdnc request -These are required by the mso-sdnc-adapter + + # a. RequestInformation – This is an important parameter of SDNCServiceRequest. Thud is used during the conversion of SDNCServiceRequest to XMLstring. + + # b. ServiceInformation – This stores the important information like serviceId, servicetype and SubscriberName. Its parameter of SDNCServiceRequest. + + # c. SDNCErrorCommon – it extends SDNCResponseCommon . + + Usage : adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestConnector.java – catching exception if any happens during request creation and a new SDNCErrorCommon is created. + + # d. SDNCRequestCommon – SDNCServiceRequest extends SDNCRequestCommon. It has some attributes like bpNotificationUrl(Endpoint on which BPMN can receive notifications from the SDNC adapter), bpTimeout ans sdncrequestId. + + # e. SDNCServiceRequest + Usage: adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestTask.java – Here the runRequest is happening, where we are posting this request using a restclient call with SDNCServiceRequest as input. + + # f. SDNCServiceResponse and SDNCServiceError + Usage:adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestTask.java – Here if the above runRequest returns a 2xx response code then a corresponding SDNCServiceResponse is created and returned or else SDNCServiceError is created and returned + +Tenant request +--------------- + +#4. These provide classes to be used by the so-adapters.tenant. + +The operator of a cloud can present unchangeable networks to the users, or give users the option to create, delete, connect and generally manipulate networks. The latter type of networks is called “tenant networks”. + +Used in adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tenant/TenantAdapterRest.java + +The implementation and usage is similiar to the above classes + +.. image:: ../images/tenantrest.png + +VDU +--- + +#5. Vdu – these are used for the deployment and management of (cloud-agnostic) VDU . The abstract classes for instantiation of vdu, query vdu, delete vdu, update vdu are defined in here. + +These are implemented in adapters/mso-adapter-utils/src/main/java/org/onap/so/cloudify/utils/MsoCloudifyUtils.java and adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java + +Vnfrest +------- + +#6. Vnfrest – These are used to manage vnfs and vgs. +These are used in the project similiar to networkrest +Foreg : Usage of DeleteVfModuleRequest: + +1)bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterDeleteTasks.java – Here in deleteVfModuleRequestMapper creates a new DeleteVfModuleRequest, and is set to the execution variable(“VNFREST_REQUEST” ) and “deleteVfModuleRequest” execution variable is set true + +2)bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/VnfAdapterClientImpl.java - Here a delete rest request is send + +.. image:: ../images/vnfrest.png + + +OPENSTACK +--------- +Openstack is classified into beans, exceptions, and mappers + +MAPPERS +------- + # 1) JAXBContext: It is used to convert a object to xml(marshalling) and to convert xml to object (unmarshalling) . These marshalling and unmarshalling are overriden in the map adapters in mappers. + + # 2)NetworkInfoMapper – used to Capture the data from a Neutron Network object and cast it into a networkInfo( present in beans of openstack). Here in vlan information is located depending on network.getProviderNetworkType() , and if not then the segments within the network is iterated and is checked for the same. + Usage: It is used in adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoNeutronUtils.java , where on createNetwork, queryNetwork and updateNetwork , the network is mapped by NetworkInfoMapper into networkInfo and returned. + + # 3) StackInfoMapper – used to Capture the data from a Stack object and cast it into a stackInfo( present in beans of openstack). + Usage: It is used in adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils , where all createStack, queryStack, updateStack, deleteStack is done, a new instance of stackInfo is returned + +Exceptions +---------- +These are set of msoexceptions provided, and would be used depending on what exception needs to be handled + +.. image:: ../images/msoexception.png diff --git a/docs/images/DeleteInventory.png b/docs/images/DeleteInventory.png Binary files differnew file mode 100644 index 0000000000..0fd6629db8 --- /dev/null +++ b/docs/images/DeleteInventory.png diff --git a/docs/images/InventoryAddAudit.png b/docs/images/InventoryAddAudit.png Binary files differnew file mode 100644 index 0000000000..9e61c15804 --- /dev/null +++ b/docs/images/InventoryAddAudit.png diff --git a/docs/images/InventoryCreate.png b/docs/images/InventoryCreate.png Binary files differnew file mode 100644 index 0000000000..7df732f1d1 --- /dev/null +++ b/docs/images/InventoryCreate.png diff --git a/docs/images/InventoryDeleteAudit.png b/docs/images/InventoryDeleteAudit.png Binary files differnew file mode 100644 index 0000000000..f2f08bf52b --- /dev/null +++ b/docs/images/InventoryDeleteAudit.png diff --git a/docs/images/InventoryQueryAudit.png b/docs/images/InventoryQueryAudit.png Binary files differnew file mode 100644 index 0000000000..34f6cad128 --- /dev/null +++ b/docs/images/InventoryQueryAudit.png diff --git a/docs/images/OpenstackAdapterInvoke.png b/docs/images/OpenstackAdapterInvoke.png Binary files differnew file mode 100644 index 0000000000..998c4721b0 --- /dev/null +++ b/docs/images/OpenstackAdapterInvoke.png diff --git a/docs/images/OpenstackAdapterPoller.png b/docs/images/OpenstackAdapterPoller.png Binary files differnew file mode 100644 index 0000000000..e95bede9a2 --- /dev/null +++ b/docs/images/OpenstackAdapterPoller.png diff --git a/docs/images/OpenstackAdapterRollback.png b/docs/images/OpenstackAdapterRollback.png Binary files differnew file mode 100644 index 0000000000..1e554263b0 --- /dev/null +++ b/docs/images/OpenstackAdapterRollback.png diff --git a/docs/images/module_structure.png b/docs/images/module_structure.png Binary files differnew file mode 100644 index 0000000000..c25441bd8e --- /dev/null +++ b/docs/images/module_structure.png diff --git a/docs/images/msoexception.png b/docs/images/msoexception.png Binary files differnew file mode 100644 index 0000000000..b9d2dfd5da --- /dev/null +++ b/docs/images/msoexception.png diff --git a/docs/images/nwrest.png b/docs/images/nwrest.png Binary files differnew file mode 100644 index 0000000000..58b66d59e0 --- /dev/null +++ b/docs/images/nwrest.png diff --git a/docs/images/tenantrest.png b/docs/images/tenantrest.png Binary files differnew file mode 100644 index 0000000000..ec1c77e61b --- /dev/null +++ b/docs/images/tenantrest.png diff --git a/docs/images/vnfrest.png b/docs/images/vnfrest.png Binary files differnew file mode 100644 index 0000000000..f61720708d --- /dev/null +++ b/docs/images/vnfrest.png |