getSolFunctionPackageDescriptor method

Future<GetSolFunctionPackageDescriptorOutput> getSolFunctionPackageDescriptor({
  1. required DescriptorContentType accept,
  2. required String vnfPkgId,
})

Gets a function package descriptor in a function package.

A function package descriptor is a .yaml file in a function package that uses the TOSCA standard to describe how the network function in the function package should run on your network.

A function package is a .zip file in CSAR (Cloud Service Archive) format that contains a network function (an ETSI standard telecommunication application) and function package descriptor that uses the TOSCA standard to describe how the network functions should run on your network.

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter accept : Indicates which content types, expressed as MIME types, the client is able to understand.

Parameter vnfPkgId : ID of the function package.

Implementation

Future<GetSolFunctionPackageDescriptorOutput>
    getSolFunctionPackageDescriptor({
  required DescriptorContentType accept,
  required String vnfPkgId,
}) async {
  final headers = <String, String>{
    'Accept': accept.value,
  };
  final response = await _protocol.sendRaw(
    payload: null,
    method: 'GET',
    requestUri:
        '/sol/vnfpkgm/v1/vnf_packages/${Uri.encodeComponent(vnfPkgId)}/vnfd',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
  return GetSolFunctionPackageDescriptorOutput(
    vnfd: await response.stream.toBytes(),
    contentType: _s
        .extractHeaderStringValue(response.headers, 'Content-Type')
        ?.let(DescriptorContentType.fromString),
  );
}