8000 GitHub - TheFreeman193/mita-dummyapi: Dummy API for Modern IT Automation with PowerShell
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

TheFreeman193/mita-dummyapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dummy API for Modern IT Automation with PowerShell

This repository comprises a static dummy API for use with the Data Store demo functions from the Mocking chapter of Modern IT Automation with PowerShell, 1st edition.

There are eight subdirectories, 001–008, each representing a bucket of data that serves as the remote $Source for Update-DataStore.

Each bucket has an updates manifest in the root. This file contains information about the dummy data in the data subdirectory of the bucket. Each file in data is an 'update' to the bucket and Update-DataStore should select and synchronize the latest of these.

The files contain randomly generated dummy data from New-DummyAPIData.ps1.

Using the Dummy API

Pass the GitHub raw URL for the numbered subdirectory to the -Source parameter of Update-DataStore:

New-DataStore -Name Test01
Set-DataStoreDate -Name Test01 -Update '2000-01-01'

$Uri = 'https://raw.githubusercontent.com/TheFreeman193/mita-dummyapi/main/001'

Update-DataStore -Name Test01 -Source $Uri

How it Works

The Update-DataStore function appends updates to the $Source path to retrieve the update manifest, and data/<timestamp> to retrieve a bucket update. Where for a real API this might represent queries, the dummy API provides raw files at fixed paths.

Data Store Functions

You can find the data store demo functions, along with Pester test files used in the chapter, in the Modern IT Automation with PowerShell Extras repository.

They are duplicated here in the DataStoreDemo subdirectory.

License

The content of this repository is released under the MIT License. Please also attribute DevOps Collective, Inc., the publisher of the book.

About

Dummy API for Modern IT Automation with PowerShell

Resources

License

Stars

Watchers

Forks

0