Skip to content
Open
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![User Guide](https://img.shields.io/badge/User%20Guide-Netlify-success)](https://isctl.netlify.app/) [![Build status](https://dev.azure.com/cgascoig/isctl/_apis/build/status/Full%20test?branchName=devel)](https://dev.azure.com/cgascoig/isctl/_build/latest?definitionId=2) [![Go Report](https://goreportcard.com/badge/github.com/cgascoig/isctl)](https://goreportcard.com/report/github.com/cgascoig/isctl)
# isctl - CLI for Cisco Intersight
`isctl` is a `kubectl`-insipired CLI for the Cisco Intersight service.
`isctl` is a `kubectl`-inspired CLI for the Cisco Intersight service.

## Features

Expand All @@ -20,7 +20,7 @@ If you use [Homebrew](https://brew.sh), the easiest way to install `isctl` is:
brew install cgascoig/isctl/isctl
```

If you don't use Homebew:
If you don't use Homebrew:

* Download the latest release from the [Releases](https://github.com/cgascoig/isctl/releases/latest) page.
* Unzip and move the `isctl` binary somewhere that is on your path (e.g. `/usr/local/bin`).
Expand Down
4 changes: 2 additions & 2 deletions cmd/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,12 +395,12 @@ func buildIdentityFilter(client *util.IsctlClient, mo rawMO, meta *oapi.Meta) (s

orgMoRef, err := gen.GetMoMoRef(client, cMoRef)
if err != nil {
return "", fmt.Errorf("error finding organisation: %v", err)
return "", fmt.Errorf("error finding organization: %v", err)
}

orgMoid, err := dyno.GetString(orgMoRef, "Moid")
if err != nil {
return "", fmt.Errorf("error finding organisation: %v", err)
return "", fmt.Errorf("error finding organization: %v", err)
}
return fmt.Sprintf("Name eq '%s' and Organization/Moid eq '%s'", name, orgMoid), nil
}
Expand Down
2 changes: 1 addition & 1 deletion docs/1-basic-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ isctl get ntp policy --filter "startsWith(Name, 'cg-')"

## Output customisation

By default, `isctl` will try to produce human readable output. Typically, this will be a table format with boilerplate attributes (e.g. `ClassId`, `Organization`, etc.) hidden for brevity. If the output table would have too many columns, `isctl` will fall back to a "vertical" output (essentially YAML). If you want to disable this behaviour and force the table format (even though it will be very wide), use `--output table`.
By default, `isctl` will try to produce human readable output. Typically, this will be a table format with boilerplate attributes (e.g. `ClassId`, `Organization`, etc.) hidden for brevity. If the output table would have too many columns, `isctl` will fall back to a "vertical" output (essentially YAML). If you want to disable this behavior and force the table format (even though it will be very wide), use `--output table`.

There are a number of other options to customise the output described below.

Expand Down
2 changes: 1 addition & 1 deletion docs/2-advanced-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Organization:
DomainGroupMoid: 5b25418d7a7662743465cf72
ModTime: "2019-12-09T23:25:48.256Z"
Moid: 5deed7fc6972652d33bc48d0
Name: Example Organisation
Name: Example Organization
ObjectType: organization.Organization
Owners:
- 123456789012345678901234
Expand Down
4 changes: 2 additions & 2 deletions examples/complete_imm/1_domain_profile/README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Make sure you have [isctl](https://github.com/cgascoig/isctl) installed and conf
## Steps
1. Claim FI Targets, this is a manual UI process for now.

2. Edit all the yamls file to match your environment
2. Edit all the yaml files to match your environment

3. Apply all the config
```
Expand Down Expand Up @@ -32,7 +32,7 @@ isctl update fabric switchprofile name IMM-Domain-01-B --Action Unassign
```

2. remove the config
To clean up just rust the `isctl apply` commands but add a `-d` at the end.
To clean up just run the `isctl apply` commands but add a `-d` at the end.
```
isctl apply -f . -d
```
4 changes: 2 additions & 2 deletions examples/complete_imm/2_chassis_profile/README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Make sure you have [isctl](https://github.com/cgascoig/isctl) installed and configured.

## Steps
1. Update the yaml files to match your environmnet
1. Update the yaml files to match your environment

2. Apply all the config
```
Expand All @@ -23,7 +23,7 @@ isctl update chassis profile name IMM-Domain-01-Chassis-01 --Action Unassign
```

2. remove the config
To clean up just rust the `isctl apply` commands but add a `-d` at the end.
To clean up just run the `isctl apply` commands but add a `-d` at the end.
```
isctl apply -f . -d
```
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ isctl delete server profile name IMM-RHEL-08
```

2. remove the config
To clean up just rust the `isctl apply` commands but add a `-d` at the end.
To clean up just run the `isctl apply` commands but add a `-d` at the end.
```
isctl apply -f . -d
```
10 changes: 5 additions & 5 deletions examples/complete_imm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ There are 3 directories in this repository

### 1_domain_profile
This holds all the domain required policies and the Domain profile.
There is a seperate README in this directory with more information
There is a separate README in this directory with more information

### 2_chassis_profile
This holds all the chassis required policies and the Chassis profile.
There is a seperate README in this directory with more information
There is a separate README in this directory with more information

### 3_server_profiles
This holds all the server profile required policies, the Server Profile Template and it will derivef 8 Server Profiles that will be assigned through a Server Resource Pool.
There is a seperate README in this directory with more information
This holds all the server profile required policies, the Server Profile Template and it will derive 8 Server Profiles that will be assigned through a Server Resource Pool.
There is a separate README in this directory with more information

All configuration is stored in yaml files and need to be updated to match your environment.

Expand Down Expand Up @@ -59,4 +59,4 @@ isctl apply -f 3_server_profiles/FI-Attached/.

## Clean up

there are more details cleanup steps writting in each directory, please clean up in the right order.
there are more details cleanup steps written in each directory, please clean up in the right order.
6 changes: 3 additions & 3 deletions pkg/gen/genutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ func GetMoMoRef(client *util.IsctlClient, moref *oapi.MoRef) (map[string]any, er
orgMoRef := oapi.CanonicaliseMoRef(moref.Organization, "organization.Organization.Relationship")
resolvedOrgMoRef, err := GetMoMoRef(client, orgMoRef)
if err != nil {
return nil, fmt.Errorf("error finding organisation: %v", err)
return nil, fmt.Errorf("error finding organization: %v", err)
}

orgMoid, err := dyno.GetString(resolvedOrgMoRef, "Moid")
if err != nil {
return nil, fmt.Errorf("error finding organisation: %v", err)
return nil, fmt.Errorf("error finding organization: %v", err)
}

filter = fmt.Sprintf("%s and Organization/Moid eq '%s'", filter, orgMoid)
Expand All @@ -57,7 +57,7 @@ func GetMoMoRef(client *util.IsctlClient, moref *oapi.MoRef) (map[string]any, er

classId, ok := getClassId(res)
if !ok {
return nil, fmt.Errorf("GetMoMoRef: ubable to get classID")
return nil, fmt.Errorf("GetMoMoRef: unable to get classID")
}

log.Debugf("Got Moid and ClassId: %s, %s", moid, classId)
Expand Down
2 changes: 1 addition & 1 deletion pkg/oapi/operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ func getTokenListForOperation(op *Operation) ([]string, []string) {
methodVerb := methodVerbs[strings.ToLower(op.HTTPMethod)]

helpList := []string{
methodVerb + " resouce(s)",
methodVerb + " resource(s)",
fmt.Sprintf("%s %s resource(s)", methodVerb, op.BaseName),
op.Summary,
}
Expand Down
2 changes: 1 addition & 1 deletion tests/apply.bats
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ TEST_SECTION="Apply"
[ "${NTPSERVERS}" == "[\"1.1.1.1\"]" ]
}

@test "${TEST_SECTION}: apply directoy of YAML files" {
@test "${TEST_SECTION}: apply directory of YAML files" {
./build/isctl ${ISCTL_OPTIONS} apply -f tests/data/apply-yaml
}

Expand Down
2 changes: 1 addition & 1 deletion tests/ntp_policy.bats
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ TEST_SECTION="NTP Policy CRUD"
assert_line --index 3 --regexp "^ +${TEST_NTP_POLICY_NAME} +[0-9a-f]{24} +true *$"
}

@test "${TEST_SECTION}: expand organisation name" {
@test "${TEST_SECTION}: expand organization name" {
ORG=$(./build/isctl ${ISCTL_OPTIONS} get ntp policy --name "${TEST_NTP_POLICY_NAME}" -o json --expand 'Organization($select=Name)' | jq -r .Organization.Name)
assert_equal "${ORG}" "default"
}
Expand Down
4 changes: 2 additions & 2 deletions tests/orginization.bats → tests/organization.bats
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ TEST_SECTION="Organization"
--EndPointUserPolicy "MoRef[${TEST_NAME}\\${TEST_NAME}]" \
--Password hahahahaha

echo "Deleteing test IAM endpointuserrole in test org"
echo "Deleting test IAM endpointuserrole in test org"
ORG_MOID=$(./build/isctl ${ISCTL_OPTIONS} get organization organization --name "${TEST_NAME}" -o jsonpath='$.Moid'|| echo "")

# Don't need to delete endpointuserrole - it is automatically deleted when the policy is deleted
# ./build/isctl ${ISCTL_OPTIONS} delete iam endpointuserrole moid $(./build/isctl ${ISCTL_OPTIONS} get iam endpointuserrole --filter "Name eq '${TEST_NAME}' and Organization/Moid eq '${ORG_MOID}'" -o 'jsonpath=$[*].Moid'|| echo "")

echo "Deleteing test IAM endpointuserpolicy in test org"
echo "Deleting test IAM endpointuserpolicy in test org"
./build/isctl ${ISCTL_OPTIONS} delete iam endpointuserpolicy moid $(./build/isctl ${ISCTL_OPTIONS} get iam endpointuserpolicy --filter "Name eq '${TEST_NAME}' and Organization/Moid eq '${ORG_MOID}'" -o 'jsonpath=$[*].Moid'|| echo "")
}

Expand Down