getSolFunctionPackageContent method

Future<GetSolFunctionPackageContentOutput> getSolFunctionPackageContent({
  1. required PackageContentType accept,
  2. required String vnfPkgId,
})

Gets the contents of a function package.

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 : The format of the package that you want to download from the function packages.

Parameter vnfPkgId : ID of the function package.

Implementation

Future<GetSolFunctionPackageContentOutput> getSolFunctionPackageContent({
  required PackageContentType 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)}/package_content',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
  return GetSolFunctionPackageContentOutput(
    packageContent: await response.stream.toBytes(),
    contentType: _s
        .extractHeaderStringValue(response.headers, 'Content-Type')
        ?.let(PackageContentType.fromString),
  );
}