Skip to content

Commit

Permalink
Merge pull request #4 from connorcarnes/dev
Browse files Browse the repository at this point in the history
Dev [0.2.0]
  • Loading branch information
connorcarnes authored Dec 21, 2023
2 parents 0e646cf + 0869b7e commit 983d98f
Show file tree
Hide file tree
Showing 40 changed files with 1,594 additions and 98 deletions.
25 changes: 0 additions & 25 deletions .readthedocs.yaml

This file was deleted.

17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,20 @@ PowerShell module for interacting with the Cloudflare API.

| Function | ApiOperation |
| ------------------- | -------------------------------------------------------------------------------------------------------------- |
| Get-CFZone | [List Zones](https://developers.cloudflare.com/api/operations/zones-get) |
| Get-CFZoneRecord | [List DNS Records](https://developers.cloudflare.com/api/operations/dns-records-for-a-zone-list-dns-records) |
| New-CFZoneRecord | [Create DNS Record](https://developers.cloudflare.com/api/operations/dns-records-for-a-zone-create-dns-record) |
| Remove-CFZoneRecord | [Delete DNS Record](https://developers.cloudflare.com/api/operations/dns-records-for-a-zone-delete-dns-record) |
| Set-CFZoneRecord | [Patch DNS Record](https://developers.cloudflare.com/api/operations/dns-records-for-a-zone-patch-dns-record) |
| [Get-CFAccount](docs/Get-CFAccount.md) | [Account Details](https://developers.cloudflare.com/api/operations/accounts-account-details) |
| [Get-CFD1Database](docs/Get-CFD1Database.md) | [Get D1 Database](https://developers.cloudflare.com/api/operations/cloudflare-d1-get-database) |
| [Get-CFZone](docs/Get-CFZone.md) | [List Zones](https://developers.cloudflare.com/api/operations/zones-get) |
| [Get-CFZoneRecord](docs/Get-CFZoneRecord.md) | [List DNS Records](https://developers.cloudflare.com/api/operations/dns-records-for-a-zone-list-dns-records) |
| [Invoke-CFD1Query](docs/Invoke-CFD1Query.md) | [Query D1 Database](https://developers.cloudflare.com/api/operations/cloudflare-d1-query-database) |
| [New-CFD1Database](docs/New-CFD1Database.md) | [Create D1 Database](https://developers.cloudflare.com/api/operations/cloudflare-d1-create-database) |
| [New-CFZoneRecord](docs/New-CFZoneRecord.md) | [Create DNS Record](https://developers.cloudflare.com/api/operations/dns-records-for-a-zone-create-dns-record) |
| [Remove-CFD1Database](docs/New-CFD1Database.md) | [Delete D1 Database](https://developers.cloudflare.com/api/operations/cloudflare-d1-delete-database) |
| [Remove-CFZoneRecord](docs/Remove-CFZoneRecord.md) | [Delete DNS Record](https://developers.cloudflare.com/api/operations/dns-records-for-a-zone-delete-dns-record) |
| [Set-CFZoneRecord](docs/Set-CFZoneRecord.md) | [Patch DNS Record](https://developers.cloudflare.com/api/operations/dns-records-for-a-zone-patch-dns-record) |

## Why

The existing Cloudflare modules in the PSGallery are limited in scope. This project aims to support as many [Cloudflare products](https://developers.cloudflare.com/products/) as possible including R2, D1, Pages, Workers, Workers KV, Workers AI, Images, Stream, Access, Tunnel, Durable Objects, Queues, etc.
The existing Cloudflare modules in the PSGallery are limited in scope. This project aims to support a broad range of [Cloudflare products](https://developers.cloudflare.com/products/) including R2, D1, Pages, Workers, Workers KV, Workers AI, Images, Stream, Access, Tunnel, Durable Objects, Queues, etc.

## Getting Started

Expand Down
6 changes: 6 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add tests for Remove-CFZoneRecord, Set-CFZoneRecord, Set-CloudflareSession, Test-CloudflareSession
- Update priority parameter in Set-CFZoneRecord
- Remove Update-TypeData from psm1

## [0.2.0]

- Add D1 functions, types and tests
- Add Get-CFAccount function, types and tests
- Updates to arguement completers
92 changes: 92 additions & 0 deletions docs/Get-CFAccount.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
external help file: pwshCloudflare-help.xml
Module Name: pwshCloudflare
online version: https://developers.cloudflare.com/api/operations/accounts-list-accounts
schema: 2.0.0
---

# Get-CFAccount

## SYNOPSIS
Get Cloudflare account information.

## SYNTAX

### AccountId (Default)
```
Get-CFAccount [-AccountId <String>] [<CommonParameters>]
```

### AccountName
```
Get-CFAccount [-AccountName <String>] [<CommonParameters>]
```

## DESCRIPTION
Get Cloudflare account information.

## EXAMPLES

### EXAMPLE 1
```
Get-CFAccount -AccountId '12345'
Gets account with ID 12345.
```

### EXAMPLE 2
```
Get-CFAccount
Lists accounts available to current user.
```

## PARAMETERS

### -AccountId
ID of account to retrieve.
If not specified, all accounts will be returned.

```yaml
Type: String
Parameter Sets: AccountId
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -AccountName
Name of account to retrieve.
If not specified, all accounts will be returned.
```yaml
Type: String
Parameter Sets: AccountName
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
### Cloudflare.Account
## NOTES
## RELATED LINKS
[https://developers.cloudflare.com/api/operations/accounts-list-accounts](https://developers.cloudflare.com/api/operations/accounts-list-accounts)
[https://developers.cloudflare.com/api/operations/accounts-account-details](https://developers.cloudflare.com/api/operations/accounts-account-details)
138 changes: 138 additions & 0 deletions docs/Get-CFD1Database.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
---
external help file: pwshCloudflare-help.xml
Module Name: pwshCloudflare
online version: https://developers.cloudflare.com/api/operations/cloudflare-d1-list-databases
schema: 2.0.0
---

# Get-CFD1Database

## SYNOPSIS
Gets Cloudflare D1 database(s).

## SYNTAX

### AccountId
```
Get-CFD1Database [-Name <String>] [-Id <String>] -AccountId <String> [<CommonParameters>]
```

### AccountName
```
Get-CFD1Database [-Name <String>] [-Id <String>] -AccountName <String> [<CommonParameters>]
```

## DESCRIPTION
Gets Cloudflare D1 database(s).
Must provide exactly one of AccountId or AccountName.
If Name or Id is not specified, all databases will be returned.

## EXAMPLES

### EXAMPLE 1
```
Get-CFD1Database -AccountId '12345'
Gets all databases for account with ID 12345.
```

### EXAMPLE 2
```
Get-CFD1Database -AccountName 'My Account' -Name 'myDb'
Gets databsse 'myDb' for account 'My Account'.
```

### EXAMPLE 3
```
Get-CFD1Database -AccountName 'My Account' -Id '12345'
Gets database with ID 12345 for account 'My Account'.
```

## PARAMETERS

### -Name
Name of database to retrieve.
If not specified, all databases will be returned.

```yaml
Type: String
Parameter Sets: (All)
Aliases: DatabaseName

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Id
ID of database to retrieve.
If not specified, all databases will be returned.
```yaml
Type: String
Parameter Sets: (All)
Aliases: DatabaseId

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -AccountId
ID of account to retrieve.
If not specified, all accounts will be returned.
```yaml
Type: String
Parameter Sets: AccountId
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -AccountName
Name of account to retrieve.
If not specified, all accounts will be returned.
```yaml
Type: String
Parameter Sets: AccountName
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
### Cloudflare.D1Database
## NOTES
The cloudflare-d1-list-databases API endpoint returns the properties uuid, name, version and created_at.
The cloudflare-d1-get-database API endpoint returns the same properties as well as num_tables, file_size and running_in region.
When listing all databases or getting a database by name this function makes multiple API calls.
The first call is to get the database ID(s).
The subsequent call(s) use the ID(s) to get the database details.
This is done so that the same output is returned regardless of parameters used.
## RELATED LINKS
[https://developers.cloudflare.com/api/operations/cloudflare-d1-list-databases](https://developers.cloudflare.com/api/operations/cloudflare-d1-list-databases)
[https://developers.cloudflare.com/api/operations/cloudflare-d1-get-database](https://developers.cloudflare.com/api/operations/cloudflare-d1-get-database)
1 change: 1 addition & 0 deletions docs/Get-CFZoneRecord.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ For more information, see about_CommonParameters (http://go.microsoft.com/fwlink
### None.
## OUTPUTS
### Cloudflare.ZoneRecord
## NOTES
## RELATED LINKS
Expand Down
Loading

0 comments on commit 983d98f

Please sign in to comment.