npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@itentialopensource/create-project

v2.0.3-2022.1.2

Published

[Deprecated] Template for creating new artifacts

Downloads

15

Readme

Deprecation Notice

This Pre-Built has been deprecated as of 04-15-2024 and will be end of life on 04-15-2025. The capabilities of this Pre-Built have been replaced by the GitLab REST

Create GitLab Project

Table of Contents

Overview

The Create GitLab Project pre-built consists of an Operations Manager automation which can be used to create a project in GitLab if it doesn't already exists, with or without using a custom template.

The Create GitLab Project workflow serves as an entry point for Operations Manager automation to run the use cases described above. The running path of the workflow depends on the operation selected by the user. The user is provided with an option to select either "Creating Project With Template" or "Creating Project Without Template" trigger and use the JSON form to input data.

Supported IAP Versions

Itential pre-builts are built and tested on particular versions of IAP. In addition, pre-builts that work with devices are often dependent on certain orchestration systems (e.g. NSO and IAG). As such, these pre-builts will have dependencies on these other systems. This version of the Create Gitlab Project pre-built has been tested with:

  • IAP 2022.1.x

Getting Started

These instructions will help you get a copy of the pre-built in your IAP instance for testing in your environment. Reading this section is also helpful for deployments as it provides you with pertinent information on prerequisites and capabilities.

Prerequisites

Users must satisfy the following prerequisites to install and run this pre-built:

  • Itential Automation Platform
    • ^2022.1.x

Capabilities

  • Performs the create project operation if the project does not exist in the specified group ID.
  • Select either create project with template or create project without template option in the automation to get corresponding JSON forms to input the data.
  • If Template Name is not provided or does not exist in the Template GroupID - Dropdown to select the template to use for the new project in the specified Template GroupID.
  • Select either verbose or non-verbose options in the input JSON Form for viewing the details.

How to Install

To install the Pre-Built:

  • Verify you are running a supported version of the Itential Automation Platform (IAP) as listed above in the Prerequisites section in order to install the Pre-Built.
  • The Pre-Built can be installed from within App-Admin_Essential. Simply search for the name of your desired Pre-Built and click the install button.

Testing

While Itential tests this pre-built and its capabilities, it is often the case the customer environments offer their own unique circumstances. Therefore, it is our recommendation that you deploy this pre-built into a development/testing environment in which you can test the pre-built.

Using this Pre-Built

The main requirements to use this Pre-built are:

  1. Running instance of the Itential OpenSource adapter-gitlab, which can be found in adapter-gitlab

The pre-built can be run using Operations Manager automation Create GitLab Project Automation. Use the following steps to complete the form:

  1. Select the appropriate manual trigger to either "Create Project With Template" or "Create Project Without Template".
  2. Select the appropriate adapter-gitlab instance from the dropdown.
  3. Input the Group ID of the group that is needed to perform the create project operation. The new project will be created inside the specified Group ID.
  4. Input the desired New Project Name and Project Description to perform the create operation.
  5. If "Create Project With Template" trigger is selected. Enter the Template Group Id and optionally enter the Template Name to select the template for the new project.
  6. If Template Name is not provided or is not a match to what's available, a form work task will let you choose from the templates that are available in the Template Group Id specified in the form.
  7. Select either verbose or non-verbose option for the performed operation details.

Requires: New Project Name, Project Description, Group Id, Template Name and Template Group Id.

Note: All fields are mandatory for the "Create Project With Template" form except for the Template Name. For the "Create Project without Template" all fields are mandatory.

Input Schema

Example input formData:

{
    "formData": {
      "options": {
        "verbose": false
      },
      "gitlabAdapterName": "gitlab",
      "groupId": "65990124",
      "newProjectName": "Create a Project Using Prebuilt Template Via IAP",
      "projectDescription": "Create a Project Using Prebuilt Template Via IAP",
      "templateGroupId": "56922778",
      "templateName": "Inventory Report Template"
    }
}

The following table details the property keys of the input object.

| key | type | required | description | |-------------------------------|---------|----------|--------------------------| | formData.groupId | string | yes | group id for new project | | formData.newProjectName | string | yes | new project name | | formData.projectDescription | string | yes | new project description | | formData.templateGroupId | string | no | template group Id | | formData.templateName | string | no | template name | | formData.gitlabAdapterName | string | yes | adapter id | | formData.options | object | yes | additional options | | formData.options.verbose | boolean | yes | verbose |

Output Schema

The ReturnStatus job variable returned from the run automation Create GitLab Project Automation reports the success or failure of the create operation performed.

Example output of successful create project operation:

    "ReturnStatus": {
      "status": "SUCCESS",
      "message": "Project Created Successfully",
      "errors": [],
      "response": {
        "create_new_project": {
          "icode": "AD.201",
          "response": {
            "pathParam": "create-a-project-using-prebuilt-template-via-iap",
            "createdAt": "2023-04-19T17:19:38.388Z",
            "id": 45319156,
            "description": "Create a Project Using Prebuilt Template Via IAP Test",
            "name": "Create a Project Using Prebuilt Template Via IAP Test",
            "last_activity_at": "2023-04-19T17:19:38.388Z",
            "archived": false
          },
          "headers": {
            "date": "Wed, 19 Apr 2023 17:19:40 GMT",
          },
          "metrics": {
            "code": 201,
          }
        }
      },
      "group_id": "65990124",
      "template_id": "56922778",
      "project_id": 45319156
    }

The following table details the property keys of the output object.

| key | type | description | |------------------------------------------|--------|---------------------------| | ReturnStatus | object | job variable | | ReturnStatus.response | object | response | | ReturnStatus.response.create_new_project | object | operation details | | ReturnStatus.status | string | status | | ReturnStatus.message | string | operation message | | ReturnStatus.group_id | string | group id | | ReturnStatus.template_id | string | templates group id | | ReturnStatus.project_id | string | new project id | | ReturnStatus.errors | array | error details and message | | ReturnStatus.errors.error_details | object | error details | | ReturnStatus.errors.message | string | error message |

Success Example - Successful Create Project With Template Operation

Example input for a successful create operation:

{
    "formData": {
      "options": {
        "verbose": false
      },
      "gitlabAdapterName": "gitlab",
      "groupId": "65990124",
      "newProjectName": "Create a Project Using Prebuilt Template Via IAP Test",
      "projectDescription": "Create a Project Using Prebuilt Template Via IAP Test",
      "templateGroupId": "56922778",
      "templateName": "Inventory Report Template"
    }
}

Example output for successful create operation:

    "ReturnStatus": {
      "status": "SUCCESS",
      "message": "Project Created Successfully",
      "errors": [],
      "response": {
        "create_new_project": {
          "icode": "AD.201",
          "response": {
            "createdAt": "2023-04-19T17:19:38.388Z",
            "id": 45319156,
            "description": "Create a Project Using Prebuilt Template Via IAP Test",
            "name": "Create a Project Using Prebuilt Template Via IAP Test",
          },
          "headers": {
            "date": "Wed, 19 Apr 2023 17:19:40 GMT",
          },
          "metrics": {
            "code": 201,
            "timeouts": 0,
          }
        }
      },
      "group_id": "65990124",
      "template_id": "56922778",
      "project_id": 45319156
    }

Failure Example 1 - Invalid Template Group ID

This example has the key template group id value as 56922777 which is not a valid template group id which causes the pre-built to throw an error.

Input:

{
    "formData": {
      "options": {
        "verbose": false
      },
      "gitlabAdapterName": "gitlab",
      "groupId": "65990124",
      "newProjectName": "Create a Project Using Prebuilt Template Via IAP 2",
      "projectDescription": "Create a Project Using Prebuilt Template Via IAP 2",
      "templateGroupId": "56922777"
    }
}      

Output:

    "ReturnStatus": {
      "status": "FAILED",
      "message": "Get list of templates task failed.",
      "errors": [
        {
          "message": "Get list of templates task failed.",
          "error_details": {
            "icode": "AD.500",
            "IAPerror": {
              "origin": "Gitlab for Tools-connectorRest-handleEndResponse",
              "displayString": "Error 404 received on request",
              "recommendation": "Verify the request is accurate via debug logs and postman",
              "code": 404,
              "raw_response": {
                "status": "success",
                "code": 404,
                "headers": {
                  "date": "Wed, 19 Apr 2023 18:42:03 GMT",
                  "content-type": "application/json",
                },
                "response": "{\"message\":\"404 Group Not Found\"}",
              }
            },
            "metrics": {
              "code": 404,
            },
            "response": {
              "message": "404 Group Not Found"
            }
          }
        }
      ],
      "response": {
        "get_list_of_templates": {
          "icode": "AD.500",
          "IAPerror": {
            "origin": "gitlab-connectorRest-handleEndResponse",
            "displayString": "Error 404 received on request",
            "recommendation": "Verify the request is accurate via debug logs and postman",
            "code": 404,
            "raw_response": {
              "status": "success",
              "code": 404,
              "response": "{\"message\":\"404 Group Not Found\"}",
              }
            }
          }
        }
      },
      "group_id": "65990124",
      "template_id": "56922777"
    }

Failure Example 2 - Connection Refused Error

This is an example for the connection refused error which could be due to adapter connection issues.

Input:

{
    "formData": {
      "options": {
        "verbose": false
      },
      "gitlabAdapterName": "gitlab",
      "groupId": "133",
      "newProjectName": "Create a Project Using Prebuilt Template Via IAP 3",
      "projectDescription": "Create a Project Using Prebuilt Template Via IAP 3"
      }
}

Output:

    "ReturnStatus": {
      "status": "FAILED",
      "message": "Error getting the list of projects in the group.",
      "errors": [
        {
          "message": "Error getting the list of projects in the group.",
          "error_details": {
            "icode": "AD.500",
            "IAPerror": {
              "origin": "gitlab-connectorRest-handleEndResponse",
              "displayString": "Error -1 received on request",
              "recommendation": "Verify the request is accurate via debug logs and postman",
              "code": -1,
              "raw_response": {
                "status": "failure",
                "code": -1,
                "message": {
                  "errno": -111,
                  "code": "ECONNREFUSED",
                  "syscall": "connect",
                  "address": "172.20.100.62",
                  "port": 443
                },
              }
            },
            "metrics": {
              "code": -1,
            }
          }
        }
      ],
      "response": {
        "get_list_of_projects": {
          "icode": "AD.500",
          "IAPerror": {
            "origin": "gitlab-connectorRest-handleEndResponse",
            "displayString": "Error -1 received on request",
            "recommendation": "Verify the request is accurate via debug logs and postman",
            "code": -1,
            "raw_response": {
              "status": "failure",
              "code": -1,
              "message": {
                "errno": -111,
            }
          },
          "metrics": {
            "code": -1,
          }
        }
      },
      "group_id": "133"
    }

The following table details the property keys of the ReturnStatus object.

| key | type | description | |------------------------------------------|--------|---------------------------| | ReturnStatus | object | job variable | | ReturnStatus.response | object | response | | ReturnStatus.response.create_new_project | object | operation details | | ReturnStatus.status | string | status | | ReturnStatus.message | string | operation message | | ReturnStatus.group_id | string | group id | | ReturnStatus.template_id | string | templates group id | | ReturnStatus.project_id | string | new project id | | ReturnStatus.errors | array | error details and message | | ReturnStatus.errors.error_details | object | error details | | ReturnStatus.errors.message | string | error message |

Additional Information

Please use your Itential Customer Success account if you need support when using this pre-built.

Helpful Links:

  • GitLab Wikipedia: https://en.wikipedia.org/wiki/GitLab
  • GitLab Adapter: https://gitlab.com/itentialopensource/adapters/devops-netops/adapter-gitlab
  • GitLab Homepage: https://gitlab.com/