SOL003 - VNF Lifecycle Operation Granting interface

Default

grantsGrantIdGet

Grant Lifecycle Operation The GET method retrieves information about a specific grant by reading an individual grant resource.


/grants/{grantId}

Usage and SDK Samples

curl -X GET "https://localhost/grant/v1/grants/{grantId}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.DefaultApi;

import java.io.File;
import java.util.*;

public class DefaultApiExample {

    public static void main(String[] args) {
        
        DefaultApi apiInstance = new DefaultApi();
        String grantId = grantId_example; // String | Identifier of the grant. This identifier can be retrieved from the resource referenced by the "Location" HTTP header in the response to a POST request granting a new VNF lifecycle operation. It can also be retrieved from the "id" attribute in the payload body of that response.

        String accept = accept_example; // String | Content-Types that are acceptable for the response. Reference: IETF RFC 7231

        String authorization = authorization_example; // String | The authorization token for the request. Reference: IETF RFC 7235

        try {
            apiInstance.grantsGrantIdGet(grantId, accept, authorization);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#grantsGrantIdGet");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.DefaultApi;

public class DefaultApiExample {

    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        String grantId = grantId_example; // String | Identifier of the grant. This identifier can be retrieved from the resource referenced by the "Location" HTTP header in the response to a POST request granting a new VNF lifecycle operation. It can also be retrieved from the "id" attribute in the payload body of that response.

        String accept = accept_example; // String | Content-Types that are acceptable for the response. Reference: IETF RFC 7231

        String authorization = authorization_example; // String | The authorization token for the request. Reference: IETF RFC 7235

        try {
            apiInstance.grantsGrantIdGet(grantId, accept, authorization);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#grantsGrantIdGet");
            e.printStackTrace();
        }
    }
}
String *grantId = grantId_example; // Identifier of the grant. This identifier can be retrieved from the resource referenced by the "Location" HTTP header in the response to a POST request granting a new VNF lifecycle operation. It can also be retrieved from the "id" attribute in the payload body of that response.

String *accept = accept_example; // Content-Types that are acceptable for the response. Reference: IETF RFC 7231

String *authorization = authorization_example; // The authorization token for the request. Reference: IETF RFC 7235
 (optional)

DefaultApi *apiInstance = [[DefaultApi alloc] init];

[apiInstance grantsGrantIdGetWith:grantId
    accept:accept
    authorization:authorization
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var Sol003VnfLifecycleOperationGrantingInterface = require('sol003___vnf_lifecycle_operation_granting_interface');

var api = new Sol003VnfLifecycleOperationGrantingInterface.DefaultApi()

var grantId = grantId_example; // {String} Identifier of the grant. This identifier can be retrieved from the resource referenced by the "Location" HTTP header in the response to a POST request granting a new VNF lifecycle operation. It can also be retrieved from the "id" attribute in the payload body of that response.


var accept = accept_example; // {String} Content-Types that are acceptable for the response. Reference: IETF RFC 7231


var opts = { 
  'authorization': authorization_example // {String} The authorization token for the request. Reference: IETF RFC 7235

};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.grantsGrantIdGet(grantId, accept, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class grantsGrantIdGetExample
    {
        public void main()
        {
            
            var apiInstance = new DefaultApi();
            var grantId = grantId_example;  // String | Identifier of the grant. This identifier can be retrieved from the resource referenced by the "Location" HTTP header in the response to a POST request granting a new VNF lifecycle operation. It can also be retrieved from the "id" attribute in the payload body of that response.

            var accept = accept_example;  // String | Content-Types that are acceptable for the response. Reference: IETF RFC 7231

            var authorization = authorization_example;  // String | The authorization token for the request. Reference: IETF RFC 7235
 (optional) 

            try
            {
                apiInstance.grantsGrantIdGet(grantId, accept, authorization);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling DefaultApi.grantsGrantIdGet: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\DefaultApi();
$grantId = grantId_example; // String | Identifier of the grant. This identifier can be retrieved from the resource referenced by the "Location" HTTP header in the response to a POST request granting a new VNF lifecycle operation. It can also be retrieved from the "id" attribute in the payload body of that response.

$accept = accept_example; // String | Content-Types that are acceptable for the response. Reference: IETF RFC 7231

$authorization = authorization_example; // String | The authorization token for the request. Reference: IETF RFC 7235


try {
    $api_instance->grantsGrantIdGet($grantId, $accept, $authorization);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->grantsGrantIdGet: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::DefaultApi;

my $api_instance = WWW::SwaggerClient::DefaultApi->new();
my $grantId = grantId_example; # String | Identifier of the grant. This identifier can be retrieved from the resource referenced by the "Location" HTTP header in the response to a POST request granting a new VNF lifecycle operation. It can also be retrieved from the "id" attribute in the payload body of that response.

my $accept = accept_example; # String | Content-Types that are acceptable for the response. Reference: IETF RFC 7231

my $authorization = authorization_example; # String | The authorization token for the request. Reference: IETF RFC 7235


eval { 
    $api_instance->grantsGrantIdGet(grantId => $grantId, accept => $accept, authorization => $authorization);
};
if ($@) {
    warn "Exception when calling DefaultApi->grantsGrantIdGet: $@\n";
}
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.DefaultApi()
grantId = grantId_example # String | Identifier of the grant. This identifier can be retrieved from the resource referenced by the "Location" HTTP header in the response to a POST request granting a new VNF lifecycle operation. It can also be retrieved from the "id" attribute in the payload body of that response.

accept = accept_example # String | Content-Types that are acceptable for the response. Reference: IETF RFC 7231

authorization = authorization_example # String | The authorization token for the request. Reference: IETF RFC 7235
 (optional)

try: 
    api_instance.grants_grant_id_get(grantId, accept, authorization=authorization)
except ApiException as e:
    print("Exception when calling DefaultApi->grantsGrantIdGet: %s\n" % e)

Parameters

Path parameters
Name Description
grantId*
String
Identifier of the grant. This identifier can be retrieved from the resource referenced by the "Location" HTTP header in the response to a POST request granting a new VNF lifecycle operation. It can also be retrieved from the "id" attribute in the payload body of that response.
Required
Header parameters
Name Description
Accept*
String
Content-Types that are acceptable for the response. Reference: IETF RFC 7231
Required
Authorization
String
The authorization token for the request. Reference: IETF RFC 7235

Responses

Status: 501 - Not implemented in Dublin, only synchronous grant request supported.


grantsPost

Grant Lifecycle Operation The POST method requests a grant for a particular VNF lifecycle operation.


/grants

Usage and SDK Samples

curl -X POST "https://localhost/grant/v1/grants"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.DefaultApi;

import java.io.File;
import java.util.*;

public class DefaultApiExample {

    public static void main(String[] args) {
        
        DefaultApi apiInstance = new DefaultApi();
        GrantRequest grantRequest = ; // GrantRequest | 
        String accept = accept_example; // String | Content-Types that are acceptable for the response. Reference: IETF RFC 7231

        String contentType = contentType_example; // String | The MIME type of the body of the request. Reference: IETF RFC 7231

        String authorization = authorization_example; // String | The authorization token for the request. Reference: IETF RFC 7235

        try {
            inline_response_201 result = apiInstance.grantsPost(grantRequest, accept, contentType, authorization);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#grantsPost");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.DefaultApi;

public class DefaultApiExample {

    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        GrantRequest grantRequest = ; // GrantRequest | 
        String accept = accept_example; // String | Content-Types that are acceptable for the response. Reference: IETF RFC 7231

        String contentType = contentType_example; // String | The MIME type of the body of the request. Reference: IETF RFC 7231

        String authorization = authorization_example; // String | The authorization token for the request. Reference: IETF RFC 7235

        try {
            inline_response_201 result = apiInstance.grantsPost(grantRequest, accept, contentType, authorization);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#grantsPost");
            e.printStackTrace();
        }
    }
}
GrantRequest *grantRequest = ; // 
String *accept = accept_example; // Content-Types that are acceptable for the response. Reference: IETF RFC 7231

String *contentType = contentType_example; // The MIME type of the body of the request. Reference: IETF RFC 7231

String *authorization = authorization_example; // The authorization token for the request. Reference: IETF RFC 7235
 (optional)

DefaultApi *apiInstance = [[DefaultApi alloc] init];

[apiInstance grantsPostWith:grantRequest
    accept:accept
    contentType:contentType
    authorization:authorization
              completionHandler: ^(inline_response_201 output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var Sol003VnfLifecycleOperationGrantingInterface = require('sol003___vnf_lifecycle_operation_granting_interface');

var api = new Sol003VnfLifecycleOperationGrantingInterface.DefaultApi()

var grantRequest = ; // {GrantRequest} 

var accept = accept_example; // {String} Content-Types that are acceptable for the response. Reference: IETF RFC 7231


var contentType = contentType_example; // {String} The MIME type of the body of the request. Reference: IETF RFC 7231


var opts = { 
  'authorization': authorization_example // {String} The authorization token for the request. Reference: IETF RFC 7235

};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.grantsPost(grantRequest, accept, contentType, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class grantsPostExample
    {
        public void main()
        {
            
            var apiInstance = new DefaultApi();
            var grantRequest = new GrantRequest(); // GrantRequest | 
            var accept = accept_example;  // String | Content-Types that are acceptable for the response. Reference: IETF RFC 7231

            var contentType = contentType_example;  // String | The MIME type of the body of the request. Reference: IETF RFC 7231

            var authorization = authorization_example;  // String | The authorization token for the request. Reference: IETF RFC 7235
 (optional) 

            try
            {
                inline_response_201 result = apiInstance.grantsPost(grantRequest, accept, contentType, authorization);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling DefaultApi.grantsPost: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\DefaultApi();
$grantRequest = ; // GrantRequest | 
$accept = accept_example; // String | Content-Types that are acceptable for the response. Reference: IETF RFC 7231

$contentType = contentType_example; // String | The MIME type of the body of the request. Reference: IETF RFC 7231

$authorization = authorization_example; // String | The authorization token for the request. Reference: IETF RFC 7235


try {
    $result = $api_instance->grantsPost($grantRequest, $accept, $contentType, $authorization);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->grantsPost: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::DefaultApi;

my $api_instance = WWW::SwaggerClient::DefaultApi->new();
my $grantRequest = WWW::SwaggerClient::Object::GrantRequest->new(); # GrantRequest | 
my $accept = accept_example; # String | Content-Types that are acceptable for the response. Reference: IETF RFC 7231

my $contentType = contentType_example; # String | The MIME type of the body of the request. Reference: IETF RFC 7231

my $authorization = authorization_example; # String | The authorization token for the request. Reference: IETF RFC 7235


eval { 
    my $result = $api_instance->grantsPost(grantRequest => $grantRequest, accept => $accept, contentType => $contentType, authorization => $authorization);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling DefaultApi->grantsPost: $@\n";
}
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.DefaultApi()
grantRequest =  # GrantRequest | 
accept = accept_example # String | Content-Types that are acceptable for the response. Reference: IETF RFC 7231

contentType = contentType_example # String | The MIME type of the body of the request. Reference: IETF RFC 7231

authorization = authorization_example # String | The authorization token for the request. Reference: IETF RFC 7235
 (optional)

try: 
    api_response = api_instance.grants_post(grantRequest, accept, contentType, authorization=authorization)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->grantsPost: %s\n" % e)

Parameters

Header parameters
Name Description
Accept*
String
Content-Types that are acceptable for the response. Reference: IETF RFC 7231
Required
Content-Type*
String
The MIME type of the body of the request. Reference: IETF RFC 7231
Required
Authorization
String
The authorization token for the request. Reference: IETF RFC 7235
Body parameters
Name Description
grantRequest *

Responses

Status: 201 - Created The grant was created successfully (synchronous mode). A representation of the created "Individual grant" resource shall be returned in the response body. The HTTP response shall include a "Location" HTTP header that indicates the URI of the "Individual grant" resource just created.

Name Type Format Description
Content-Type String The MIME type of the body of the response.
Location String url The resource URI of the created VNF instance
WWW-Authenticate String Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.

Status: 202 - Accepted The request was accepted for processing, but the processing has not been completed. It is expected to take some time to create the grant (asynchronous mode). The response body shall be empty. The HTTP response shall include a "Location" HTTP header that indicates the URI of the "Individual grant" resource that will be created once the granting decision has been made.

Name Type Format Description
Location String url The resource URI of the created VNF instance
WWW-Authenticate String Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.

Status: 400 - Bad Request If the request is malformed or syntactically incorrect (e.g. if the request URI contains incorrect query parameters or a syntactically incorrect payload body), the API producer shall respond with this response code. The "ProblemDetails" structure shall be provided, and should include in the "detail" attribute more information about the source of the problem. --- If the request contains a malformed access token, the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided. --- If there is an application error related to the client's input that cannot be easily mapped to any other HTTP response code ("catch all error"), the API producer shall respond with this response code.The "ProblemDetails" structure shall be provided, and shall include in the "detail" attribute more information about the source of the problem.

Name Type Format Description
Content-Type String The MIME type of the body of the response.
WWW-Authenticate String Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.

Status: 401 - Unauthorized If the request contains no access token even though one is required, or if the request contains an authorization token that is invalid (e.g. expired or revoked), the API producer should respond with this response. The details of the error shall be returned in the WWW-Authenticate HTTP header, as defined in IETF RFC 6750 and IETF RFC 7235. The ProblemDetails structure may be provided.

Name Type Format Description
Content-Type String The MIME type of the body of the response.
WWW-Authenticate String Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.

Status: 403 - Forbidden The grant was rejected. A ProblemDetails structure shall be included in the response to provide more details about the rejection in the "details" attribute.

Name Type Format Description
Content-Type String The MIME type of the body of the response.
WWW-Authenticate String Challenge if the corresponding HTTP request has not provided authorization, or error details if the corresponding HTTP request has provided an invalid authorization token.

Status: 404 - Not Found If the API producer did not find a current representation for the resource addressed by the URI passed in the request, or is not willing to disclose that one exists, it shall respond with this response code. The "ProblemDetails" structure may be provided, including in the "detail" attribute information about the source of the problem, e.g. a wrong resource URI variable.

Name Type Format Description
Content-Type String The MIME type of the body of the response.

Status: 405 - Method Not Allowed If a particular HTTP method is not supported for a particular resource, the API producer shall respond with this response code. The "ProblemDetails" structure may be omitted in that case.

Name Type Format Description
Content-Type String The MIME type of the body of the response.

Status: 406 - Not Acceptable If the "Accept" HTTP header does not contain at least one name of a content type that is acceptable to the API producer, the API producer shall respond with this response code. The "ProblemDetails" structure may be omitted in that case.

Name Type Format Description
Content-Type String The MIME type of the body of the response.

Status: 416 - Requested Range Not Satisfiable This code is returned if the requested byte range in the Range HTTP header is not present in the requested resource.

Name Type Format Description
Content-Type String The MIME type of the body of the response.

Status: 422 - Unprocessable Entity If the payload body of a request contains syntactically correct data (e.g. well-formed JSON) but the data cannot be processed (e.g. because it fails validation against a schema), the API producer shall respond with this response code. The "ProblemDetails" structure shall be provided, and should include in the "detail" attribute more information about the source of the problem. NOTE 2: This error response code is only applicable for methods that have a request body.

Name Type Format Description
Content-Type String The MIME type of the body of the response.

Status: 500 - Internal Server Error If there is an application error not related to the client's input that cannot be easily mapped to any other HTTP response code ("catch all error"), the API producer shall respond withthis response code. The "ProblemDetails" structure shall be provided, and shall include in the "detail" attribute more information about the source of the problem.

Name Type Format Description
Content-Type String The MIME type of the body of the response.

Status: 503 - Service Unavailable If the API producer encounters an internal overload situation of itself or of a system it relies on, it should respond with this response code, following the provisions in IETF RFC 7231 [13] for the use of the "Retry-After" HTTP header and for the alternative to refuse the connection. The "ProblemDetails" structure may be omitted.

Name Type Format Description
Content-Type String The MIME type of the body of the response.