Skip to content

Celerium/Celerium.ITGlue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Celerium.ITGlue
Celerium.ITGlue

Az_Pipeline GitHub_Pages

PoshGallery_Version PoshGallery_Platforms PoshGallery_Downloads codeSize

Contributors Forks Stargazers Issues

GitHub_License



About The Project

The Celerium.ITGlue PowerShell wrapper offers the ability to read, create, and update much of the data within IT Glue's documentation platform. That includes organizations, contacts, configuration items, and more. This module serves to abstract away the details of interacting with IT Glue's API endpoints in such a way that is consistent with PowerShell nomenclature. This gives system administrators and PowerShell developers a convenient and familiar way of using IT Glue's API to create documentation scripts, automation, and integrations.

  • 📖 Celerium.ITGlue project documentation can be found on Github Pages
  • 📖 ITGlue's REST API documentation can be found here

ITGlue features a REST API that makes use of common HTTP request methods. In order to maintain PowerShell best practices, only approved verbs are used.

  • DELETE -> Remove-
  • GET -> Get-
  • PATCH -> Set-
  • POST -> New-

Additionally, PowerShell's verb-noun nomenclature is respected. Each noun is prefixed with ITGlue in an attempt to prevent naming problems.

For example, one might access the /users/ API endpoint by running the following PowerShell command with the appropriate parameters:

Get-ITGlueUser
or
Get-ITGlueUser -ID 8675309

(back to top)

Install

This module can be installed directly from the PowerShell Gallery with the following command:

Install-Module -Name Celerium.ITGlue
  • ℹ️ This module supports PowerShell 5.0+ and should work in PowerShell Core.
  • ℹ️ If you are running an older version of PowerShell, or if PowerShellGet is unavailable, you can manually download the main branch and place the latest version of Celerium.ITGlue from the build folder into the (default) C:\Program Files\WindowsPowerShell\Modules folder.

Celerium.ITGlue project documentation can be found on Github Pages

  • A full list of functions can be retrieved by running Get-Command -Module Celerium.ITGlue.
  • Help info and a list of parameters can be found by running Get-Help <command name>, such as:
Get-Help Get-ITGlueUser
Get-Help Get-ITGlueUser -Full

(back to top)

Initial Setup

After installing this module, you will need to configure both the base URI & API access token that are used to talk with the ITGlue API.

  1. Run Add-ITGlueBaseURI

    • By default, ITGlue's https://api.itglue.com URI is used.
    • If you have your own API gateway or proxy, you may put in your own custom URI by specifying the -BaseUri parameter:
      • Add-ITGlueBaseURI -BaseUri http://myapi.gateway.celerium.org

  2. Run Add-ITGlueAPIKey -ApiKey 8675309

    • It will prompt you to enter your API access token if you do not specify it.
    • ITGlue API access token are generated via the ITGlue portal at Admin > Settings > API Keys

  3. [optional] Run Export-ITGlueModuleSetting

    • This will create a config file at %UserProfile%\Celerium.ITGlue that holds the base uri & API access token information.
    • Next time you run Import-Module -Name Celerium.ITGlue, this configuration file will automatically be loaded.
    • ⚠️ Exporting module settings encrypts your API access token in a format that can only be unencrypted by the user principal that encrypted the secret. It makes use of .NET DPAPI, which for Windows uses reversible encrypted tied to your user principal. This means that you cannot copy your configuration file to another computer or user account and expect it to work.
    • ⚠️ However in Linux\Unix operating systems the secret keys are more obfuscated than encrypted so it is recommend to use a more secure & cross-platform storage method.

(back to top)

Usage

Calling an API resource is as simple as running Get-ITGlue<resourceName>

  • The following is a table of supported functions and their corresponding API resources:
  • Table entries with [ - ] indicate that the functionality is NOT supported by the ITGlue API at this time.
  • Example scripts can be found in the examples folder of this repository.
API Resource Create Read Update Delete
Attachments New-ITGlueAttachment - Set-ITGlueAttachment Remove-ITGlueAttachment
Configuration Interfaces New-ITGlueConfigurationInterface Get-ITGlueConfigurationInterface Set-ITGlueConfigurationInterface -
Configuration Statuses New-ITGlueConfigurationStatus Get-ITGlueConfigurationStatus Set-ITGlueConfigurationStatus -
Configuration Types New-ITGlueConfigurationType Get-ITGlueConfigurationType Set-ITGlueConfigurationType -
Configurations New-ITGlueConfiguration Get-ITGlueConfiguration Set-ITGlueConfiguration Remove-ITGlueConfiguration
Contact Types New-ITGlueContactType Get-ITGlueContactType Set-ITGlueContactType -
Contacts New-ITGlueContact Get-ITGlueContact Set-ITGlueContact Remove-ITGlueContact
Countries - Get-ITGlueCountries - -
Documents - - Set-ITGlueDocument -
Domains - Get-ITGlueDomains - -
Expirations - Get-ITGlueExpiration - -
Exports New-ITGlueExport Get-ITGlueExport - Remove-ITGlueExport
Flexible Asset Fields New-ITGlueFlexibleAssetField Get-ITGlueFlexibleAssetField Set-ITGlueFlexibleAssetField Remove-ITGlueFlexibleAssetField
Flexible Asset Types New-ITGlueFlexibleAssetType Get-ITGlueFlexibleAssetType Set-ITGlueFlexibleAssetType -
Flexible Assets New-ITGlueFlexibleAsset Get-ITGlueFlexibleAsset Set-ITGlueFlexibleAsset Remove-ITGlueFlexibleAsset
Groups - Get-ITGlueGroup - -
Locations New-ITGlueLocation Get-ITGlueLocation Set-ITGlueLocation Remove-ITGlueLocation
Logs - Get-ITGlueLog - -
Manufacturers New-ITGlueManufacturer Get-ITGlueManufacturer Set-ITGlueManufacturer -
Models New-ITGlueModel Get-ITGlueModel Set-ITGlueModel -
Operating Systems - Get-ITGlueOperatingSystem - -
Organization Statuses New-ITGlueOrganizationStatus Get-ITGlueOrganizationStatus Set-ITGlueOrganizationStatus -
Organization Types New-ITGlueOrganizationType Get-ITGlueOrganizationType Set-ITGlueOrganizationType -
Organizations New-ITGlueOrganization Get-ITGlueOrganization Set-ITGlueOrganization Remove-ITGlueOrganization
Password Categories New-ITGluePasswordCategory Get-ITGluePasswordCategory Set-ITGluePasswordCategory -
Passwords New-ITGluePassword Get-ITGluePassword Set-ITGluePassword Remove-ITGluePassword
Platforms - Get-ITGluePlatform - -
Regions - Get-ITGlueRegion - -
Related Items New-ITGlueRelatedItem - Set-ITGlueRelatedItem Remove-ITGlueRelatedItem
User Metrics - Get-ITGlueUserMetric - -
Users - Get-ITGlueUser Set-ITGlueUser -

Each Get-ITGlue* function will respond with the raw data that ITGlue's API provides.

  • ⚠️ Returned data is mostly structured the same but can vary between commands.
    • data - The actual information requested (this is what most people care about)
    • links - Links to specific aspects of the data
    • meta - Information about the number of pages of results are available and other metadata.

(back to top)


Contributing

Contributions are what makes the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

See the CONTRIBUTING guide for more information about contributing.

(back to top)

License

Distributed under the Apache-2.0 license. See LICENSE for more information.

GitHub_License

(back to top)