Exemplo n.º 1
0
from pnc_cli.swagger_client import ProductsApi
from pnc_cli.swagger_client import ProductversionsApi
from pnc_cli.swagger_client import ProjectsApi
from pnc_cli.swagger_client import RunningbuildrecordsApi
import pnc_cli.user_config as uc
import requests

api_client = uc.user.get_api_client()

# BuildConfigurations
configs_api = BuildconfigurationsApi(api_client)
sets_api = BuildconfigurationsetsApi(api_client)

envs_api = EnvironmentsApi(api_client)

projects_api = ProjectsApi(api_client)

# Product related APIs
products_api = ProductsApi(api_client)
versions_api = ProductversionsApi(api_client)
milestones_api = ProductmilestonesApi(api_client)
releases_api = ProductreleasesApi(api_client)

# Build Configuration Set Records
bcsr_api = BuildconfigsetrecordsApi(api_client)

# Build Records
records_api = BuildrecordsApi(api_client)
license_api = LicensesApi(api_client)

# Licenses API
Exemplo n.º 2
0
from argh import arg

import logging
import pnc_cli.cli_types as types
from pnc_cli import swagger_client
from pnc_cli import utils
from pnc_cli.swagger_client import BpmApi
from pnc_cli.swagger_client import EnvironmentsApi
from pnc_cli.swagger_client import ProjectsApi
import pnc_cli.user_config as uc

projects_api = ProjectsApi(uc.user.get_api_client())
bpm_api = BpmApi(uc.user.get_api_client())
envs_api = EnvironmentsApi(uc.user.get_api_client())


def create_build_conf_object(**kwargs):
    created_build_configuration = swagger_client.BpmBuildConfigurationCreationRest(
    )
    for key, value in kwargs.items():
        setattr(created_build_configuration, str(key), value)
    return created_build_configuration


@arg("name",
     help="Name for the new BuildConfiguration.",
     type=types.unique_bc_name)
# allow specifying project by name?
@arg("project_id",
     help="ID of the Project to associate the BuildConfiguration with.",
     type=types.existing_project_id)
Exemplo n.º 3
0
 def projects(self):
     if not self._projects:
         self._projects = ProjectsApi(self.user.get_api_client())
     return self._projects