Skip to content

Commit

Permalink
🔖 Merge branch 'release/v1.1.0' into main
Browse files Browse the repository at this point in the history
Release v1.1.0
  • Loading branch information
teramako committed Aug 24, 2024
2 parents bf5b843 + 98f89c3 commit cf56bd8
Show file tree
Hide file tree
Showing 184 changed files with 4,608 additions and 673 deletions.
126 changes: 7 additions & 119 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,128 +3,16 @@ PowerShell module to operate AWX/AnsibleTower using Rest API.

![demo1](docs/img/AWX.psm-demo-1.gif)

## Build
## 🚀 Build

See [Build](./docs/build.md) document.
See [Build](./docs/en-US/build.md) document.

## Settings
## ⚙️ Settings

See [Settings](./docs/settings.md) document.
See [Settings](./docs/en-US/settings.md) document.

## Available Commands
## 🛠️ Commands

See [Cmdlet documents directory(en-US)](./docs/en-US/cmdlets/) for more details

| Name | Description
|:-------------------------------------|:---------------------------------------------------------------------------|
| `New-ApiConfig` | Create a configuration file, which should be the first step in using this module.
| `Get-ApiConfig` | Get loaded config data currently.
| `Switch-ApiConfig` | Switch to anothor config.
| `Invoke-API` | Execute Ansible's (low-level) Rest API.
| `Get-ApiHelp` | Get and show Ansible's API Help.
| `Find-UnifiedJob` | Retrieve Jobs for Job, ProjectUpdate, InventoryUpdate, SystemJob, AdHocCommand and WorkflowJob.
| `Find-UnifiedJobTemplate` | Retrieve Templates for JobTemplate, Project, InventorySource, SystemJobTemplate and WorkflowJobTemplate.
| `Get-JobLog` | Retrieve a Job Log for Job, ProjectUpdate, InventoryUpdate, SystemJob, AdHocCommand and WorkflowJob.
| `Find-JobEvent` | Retrieve Events for Job, ProjectUpdate, InventoryUpdate, SystemJob and AdHocCommand.
| `Wait-UnifiedJob` | Wait until jobs are finished.
| `Stop-UnifiedJob` | Stop (cancel) a running job.
| `Get-Job` | Retrieve a job detail for JobTemplate.
| `Find-Job` | Retrieve jobs for JobTemplate.
| `Get-JobTemplate` | Retreive a JobTemplate.
| `Find-JobTemplate` | Retrieve JobTemplates.
| `Invoke-JobTemplate` | Invoke (launch) a JobTemplate and wait unti the job is finished.
| `Start-JobTemplate` | Invoke (launch) a JobTemplate.
| `Get-ProjectUpdateJob` | Retrieve a job detail for ProjectUpdate.
| `Find-ProjectUpdateJob` | Retrieve jobs for ProjectUpdate.
| `Get-Project` | Retrieve a Project.
| `Find-Project` | Retrieve Projects.
| `Invoke-ProjectUpdate` | Invoke (update) a Project and wait until the job is finished.
| `Start-ProjectUpdate` | Invoke (update) a Project.
| `Get-InventoryUpdateJob` | Retrieve a job detail for InventoryUpdate.
| `Find-InventoryUpdateJob` | Retrieve jobs for InventoryUpdate.
| `Get-InventorySource` | Retrieve an InventorySource.
| `Find-InventorySource` | Retrieve InventorySources.
| `Invoke-InventoryUpdate` | Invoke (update) an InventorySource and wait until the job is finished.
| `Start-InventoryUpdate` | Invoke (update) an InventorySource.
| `Get-WorkflowJob` | Retrieve a job detail for WorkflowJobTemplate.
| `Find-WorkflowJob` | Retrieve jobs for WorkflowJobTemplate.
| `Get-WorkflowJobNode` | Retrieve a node for WorkflowJob.
| `Find-WorkflowJobNode` | Retrieve nodes for WorkflowJob.
| `Find-WorkflowJobNodeFor` | Retrieve WorkflowJobNodes linked to the target WorkflowJobNode.
| `Get-WorkflowJobTemplate` | Retrieve a WorkflowJobTemplate.
| `Find-WorkflowJobTemplate` | Retrieve WorkflowJobTemplates.
| `Get-WorkflowJobTemplateNode` | Retrieve a WorkflowJobTemplateNode.
| `Find-WorkflowJobTemplateNode` | Retrieve WorkflowJobTemplateNodes.
| `Find-WorkflowJobTemplateNodeFor` | Retrieve WorkflowJobTemplateNodes linked to the target WorkflowJobTemplateNode.
| `Invoke-WorkflowJobTemplate` | Invoke (update) a WorkflowJobTemplate and wait until the job is finished.
| `Start-WorkflowJobTemplate` | Invoke (update) a WorkflowJobTemplate.
| `Get-WorkflowApprovalRequest` | Retrieve a request job for WorkflowApproval.
| `Find-WorkflowApprovalRequest` | Retrieve request jobs for WorkflowApproval.
| `Get-WorkflowApprovalTemplate` | Retrieve a WorkflowApprovalTemplate.
| `Approve-WorkflowApprovalRequest` | Approve a request for WorkflowApproval.
| `Deny-WorkflowApprovalRequest` | Deny a request for WorkflowApproval.
| `Get-SystemJob` | Retrieve a job for SystemJobTemplate.
| `Find-SystemJob` | Retrieve jobs for SystemJobTemplate.
| `Get-SystemJobTemplate` | Retrieve a SystemJobTemplate.
| `Find-SystemJobTemplate` | Retrieve SystemJobTemplates.
| `Invoke-SystemJobTemplate` | Invoke (launch) a SystemJobTemplate and wait until the job is finished.
| `Start-SystemJobTemplate` | Invoke (launch) a SystemJobTemplate.
| `Get-AdHocCommandJob` | Retrieve a job for AdHocCommand.
| `Find-AdHocCommandJob` | Retrieve jobs for AdHocCommand.
| `Invoke-AdHocCommand` | Invoke (launch) an AdHocCommand and wait until the job is finished.
| `Start-AdHocCommand` | Invoke (launch) an AdHocCommand.
| `Get-Application` | Retrieve an (OAuth2) Application.
| `Find-Application` | Retrieve (OAuth2) Applications.
| `Get-Token` | Retrieve an (OAuth2) AccessToken.
| `Find-Token` | Retrieve (OAuth2) AccessTokens.
| `Get-Instance` | Retrieve an Instance.
| `Find-Instance` | Retrieve Instances.
| `Get-InstanceGroup` | Retrieve an InstanceGroup.
| `Find-InstanceGroup` | Retrieve InstanceGroups.
| `Get-Config` | Retrieve various sitewide configuration settings.
| `Get-Ping` | Retrieve some basic information about the instance.
| `Get-Setting` | Retrieve settings.
| `Get-Organization` | Retrieve an Organization.
| `Find-Organization` | Retrieve Organizations.
| `Get-Me` | Retrieve the current user.
| `Get-User` | Retrieve a User.
| `Find-User` | Retrieve Users.
| `Get-Team` | Retrieve a Team.
| `Find-Team` | Retrieve Teams.
| `Get-Credential` | Retrieve a Credential.
| `Find-Credential` | Retrieve Credentials.
| `Get-CredentialType` | Retrieve a CredentialType.
| `Find-CredentialType` | Retrieve CredentialTypes.
| `Get-CredentialInputSource` | Retrieve a CredentialInputSource.
| `Find-CredentialInputSource` | Retrieve CredentialsInputSources.
| `Get-Inventory` | Retrieve an Inventory.
| `Find-Inventory` | Retrieve Inventories.
| `Get-Group` | Retrieve a Group.
| `Find-Group` | Retrieve Groups.
| `Get-Host` | Retrieve a Host.
| `Find-Host` | Retrieve Hosts.
| `Get-JobHostSummary` | Retrieve a JobHostSummary.
| `Find-JobHostSummary` | Retrieve JobHostSummaries for Job, Host or Group.
| `Get-Schedule` | Retrieve a Schedule.
| `Find-Schedule` | Retrieve Schedules.
| `Get-Role` | Retrieve a Role.
| `Find-Role` | Retrieve Roles all or granted to the target resource.
| `Find-ObjectRole` | Retrieve Roles for the target resource.
| `Get-NotificationTemplate` | Retrieve a NotificationTemplate.
| `Find-NotificationTemplate` | Retrieve NotificationTemplates.
| `Find-NotificationTemplateForApproval` | Retrieve Approval NotificationTemplates.
| `Find-NotificationTemplateForStarted` | Retrieve Started NotificationTemplates.
| `Find-NotificationTemplateForSuccess` | Retrieve Success NotificationTemplates.
| `Find-NotificationTemplateForError` | Retrieve Error NotificationTemplates.
| `Get-Notification` | Retrieve a Notification.
| `Find-Notification` | Retrieve Notifications.
| `Get-Label` | Retrieve a Label.
| `Find-Label` | Retrieve Labels.
| `Get-ActivityStream` | Retrieve an ActivityStream.
| `Find-ActivityStream` | Retrieve ActivityStreams.
| `Get-ExecutionEnvironment` | Retrieve an ExecutionEnvironment.
| `Find-ExecutionEnvironment` | Retrieve ExecutionEnvironments.
| `Get-HostMetric` | Retrieve a HostMetric.
| `Find-HostMetric` | Retrieve HostMerics.
| `Get-Metric` | Retrieve Metrics.
Many commands (over 100) are available.

See [Cmdlet documents(en-US)](./docs/en-US/cmdlets/AWX.psm.md) for all command list.
96 changes: 55 additions & 41 deletions docs/Make-Doc.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ $OutputFolder = if ($Locale) {
}

## See: https://github.com/Powershell/platyPS/issues/595
function Remove-CommonParameterFromMarkdown {
function Update-CommonParameterFromMarkdown {
<#
.SYNOPSIS
Remove a PlatyPS generated parameter block.
Expand Down Expand Up @@ -56,40 +56,8 @@ function Remove-CommonParameterFromMarkdown {
# Remove the parameter from the syntax block
$pattern = " \[$param\s?.*?]"
$newContent = $newContent -replace $pattern, ''
if ($null -ne (Compare-Object -ReferenceObject $content -DifferenceObject $newContent)) {
Write-Verbose "Added $param to $p"
# Update file content
$content = $newContent
$updateFile = $true
}
}
# Save file if content has changed
if ($updateFile) {
$newContent | Out-File -Encoding utf8 -FilePath $p
Write-Verbose "Updated file: $p"
}
}
return
}

function Add-MissingCommonParameterToMarkdown {
param(
[Parameter(Mandatory)]
[string[]]
$Path,

[Parameter(Mandatory = $false)]
[string[]]
$ParameterName = @('ProgressAction')
)
$ErrorActionPreference = 'Stop'
foreach ($p in $Path) {
$content = (Get-Content -Path $p -Raw).TrimEnd()
$updateFile = $false
foreach ($NewParameter in $ParameterName) {
if (-not ($NewParameter.StartsWith('-'))) {
$NewParameter = "-$($NewParameter)"
}
# Add Missing CommonParameter
$pattern = '(?m)^This cmdlet supports the common parameters:(.+?)\.'
$replacement = {
$Params = $_.Groups[1].Captures[0].ToString() -split ' '
Expand All @@ -106,18 +74,19 @@ function Add-MissingCommonParameterToMarkdown {
$CommonParameters += $CleanParam
}
}
if ($NewParameter -notin $CommonParameters) {
$CommonParameters += $NewParameter
if ($param -notin $CommonParameters) {
$CommonParameters += $param
}
$CommonParameters = ($CommonParameters | Sort-Object)
$CommonParameters[-1] = "and $($CommonParameters[-1])."
return "This cmdlet supports the common parameters: " + (($CommonParameters) -join ', ')
}
$newContent = $content -replace $pattern, $replacement
$newContent = $newContent -replace $pattern, $replacement
if ($null -ne (Compare-Object -ReferenceObject $content -DifferenceObject $newContent)) {
Write-Verbose "Added $NewParameter to $p"
$updateFile = $true
Write-Verbose "Added $param to $p"
# Update file content
$content = $newContent
$updateFile = $true
}
}
# Save file if content has changed
Expand All @@ -144,11 +113,53 @@ function Repair-PlatyPSMarkdown {
Path = $Path
ParameterName = $ParameterName
}
$null = Remove-CommonParameterFromMarkdown @Parameters
$null = Add-MissingCommonParameterToMarkdown @Parameters
$null = Update-CommonParameterFromMarkdown @Parameters
return
}

function New-AboutHelp {
<#
.SYNOPSIS
create about_help.txt from Markdown
#>
param(
[Parameter(Mandatory, ValueFromPipeline)]
[System.IO.FileInfo] $Path,
[Parameter(Mandatory)]
[string] $OutDir
)
begin {
$ErrorActionPreference = 'Stop'
}
process {
$file = Get-Item -Path $Path
$outputFile = $file.Name -replace ".md", ".help.txt"
$outputPath = "$OutDir\$outputFile"
$content = Get-Content -Path $file

"TOPIC",
(" {0}" -F ($content[0] -replace "^#+\s*", "")),
"",
"SHORT DESCRIPTION",
(" {0}" -F $content[1]),
"",
"LONG DESCRIPTION",
($content[2..$content.Length] | ForEach-Object -Begin {
$level = 0;
} -Process {
switch -Wildcard ($_) {
'' { '' }
'#*' {
$level = 1;
"{0}{1}" -f (" "*$level), $_;
}
default { "{0}{1}" -f (" "*($level+1)), $_; }
}
}) | Out-File -FilePath $outputPath -Encoding utf8NoBOM
Get-Item -Path $outputPath
}
}

if (-not (Test-Path -Path $OutputFolder -PathType Container)) {
New-Item -Path $OutputFolder -ItemType Directory
$New = $true
Expand Down Expand Up @@ -195,3 +206,6 @@ $externalHelpParams = @{
Force = $true;
}
New-ExternalHelp @externalHelpParams

Get-Item -Path $OutputFolder\about_*.md -Exclude "about_$ModuleName.md" |
New-AboutHelp -OutDir $externalHelpDir
File renamed without changes.
19 changes: 17 additions & 2 deletions docs/en-US/cmdlets/AWX.psm.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
Module Name: AWX.psm
Module Guid: a60acf94-7e42-4b77-bf97-1cdaf17b822b
Download Help Link: {{ Update Download Link }}
Help Version: {{ Update Help Version }}
Download Help Link: null
Help Version: 1.1.0
Locale: en-US
---

Expand All @@ -17,6 +17,9 @@ Approve requests for WorkflowApproval.
### [Deny-WorkflowApprovalRequest](Deny-WorkflowApprovalRequest.md)
Deny requests for WorkflowApproval.

### [Find-AccessList](Find-AccessList.md)
Retrieve Users accessible to a resource.

### [Find-ActivityStream](Find-ActivityStream.md)
Retrieve ActivityStreams.

Expand Down Expand Up @@ -182,6 +185,9 @@ Retrieve CredentialInputSources by the ID(s).
### [Get-CredentialType](Get-CredentialType.md)
Retrieve CredentialTypes by the ID(s).

### [Get-Dashboard](Get-Dashboard.md)
Retrieve Dashboard.

### [Get-ExecutionEnvironment](Get-ExecutionEnvironment.md)
Retrieve ExecutionEnvironments by the ID(s).

Expand All @@ -203,6 +209,9 @@ Retrieve InstanceGroups by the ID(s).
### [Get-Inventory](Get-Inventory.md)
Retrieve Inventories by the ID(s).

### [Get-InventoryFile](Get-InventoryFile.md)
Retrieve inventory files.

### [Get-InventorySource](Get-InventorySource.md)
Retrieve InventorySources by the ID(s).

Expand All @@ -218,6 +227,9 @@ Retrieve JobHostSummaries by ID(s).
### [Get-JobLog](Get-JobLog.md)
Retrieve job logs.

### [Get-JobStatistics](Get-JobStatistics.md)
Retrieve statistics for job runs.

### [Get-JobTemplate](Get-JobTemplate.md)
Retrieve JobTemplates by the ID(s).

Expand All @@ -242,6 +254,9 @@ Retrieve Organizations by the ID(s).
### [Get-Ping](Get-Ping.md)
Retrieve some basic information about the instance.

### [Get-Playbook](Get-Playbook.md)
Retrieve playbooks.

### [Get-Project](Get-Project.md)
Retrieve Projects by the ID(s).

Expand Down
Loading

0 comments on commit cf56bd8

Please sign in to comment.