Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Display SPF and DKIM records status and potential errors, including the found records to make debugging easier.

USAGE:
scw tem domain get-last-status <domain-id ...> [arg=value ...]

ARGS:
domain-id ID of the domain to delete
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)

FLAGS:
-h, --help help for get-last-status

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
11 changes: 6 additions & 5 deletions cmd/scw/testdata/test-all-usage-tem-domain-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ USAGE:
scw tem domain <command>

AVAILABLE COMMANDS:
check Domain DNS check
create Register a domain in a project
get Get information about a domain
list List domains
revoke Delete a domain
check Domain DNS check
create Register a domain in a project
get Get information about a domain
get-last-status Display SPF and DKIM records status and potential errors
list List domains
revoke Delete a domain

FLAGS:
-h, --help help for domain
Expand Down
21 changes: 21 additions & 0 deletions docs/commands/tem.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Transactional Email API.
- [Domain DNS check](#domain-dns-check)
- [Register a domain in a project](#register-a-domain-in-a-project)
- [Get information about a domain](#get-information-about-a-domain)
- [Display SPF and DKIM records status and potential errors](#display-spf-and-dkim-records-status-and-potential-errors)
- [List domains](#list-domains)
- [Delete a domain](#delete-a-domain)
- [Email management commands](#email-management-commands)
Expand Down Expand Up @@ -83,6 +84,26 @@ scw tem domain get <domain-id ...> [arg=value ...]



### Display SPF and DKIM records status and potential errors

Display SPF and DKIM records status and potential errors, including the found records to make debugging easier.

**Usage:**

```
scw tem domain get-last-status <domain-id ...> [arg=value ...]
```


**Args:**

| Name | | Description |
|------|---|-------------|
| domain-id | Required | ID of the domain to delete |
| region | Default: `fr-par`<br />One of: `fr-par` | Region to target. If none is passed will use default region from the config |



### List domains

Retrieve domains in a specific project or in a specific Organization using the `region` parameter.
Expand Down
31 changes: 31 additions & 0 deletions internal/namespaces/tem/v1alpha1/tem_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ func GetGeneratedCommands() *core.Commands {
temDomainList(),
temDomainRevoke(),
temDomainCheck(),
temDomainGetLastStatus(),
)
}
func temRoot() *core.Command {
Expand Down Expand Up @@ -609,3 +610,33 @@ func temDomainCheck() *core.Command {
},
}
}

func temDomainGetLastStatus() *core.Command {
return &core.Command{
Short: `Display SPF and DKIM records status and potential errors`,
Long: `Display SPF and DKIM records status and potential errors, including the found records to make debugging easier.`,
Namespace: "tem",
Resource: "domain",
Verb: "get-last-status",
// Deprecated: false,
ArgsType: reflect.TypeOf(tem.GetDomainLastStatusRequest{}),
ArgSpecs: core.ArgSpecs{
{
Name: "domain-id",
Short: `ID of the domain to delete`,
Required: true,
Deprecated: false,
Positional: true,
},
core.RegionArgSpec(scw.RegionFrPar),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
request := args.(*tem.GetDomainLastStatusRequest)

client := core.ExtractClient(ctx)
api := tem.NewAPI(client)
return api.GetDomainLastStatus(request)

},
}
}