Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems running freshly built pd utility #39

Closed
cmluciano opened this issue Sep 28, 2016 · 6 comments · Fixed by #40
Closed

Problems running freshly built pd utility #39

cmluciano opened this issue Sep 28, 2016 · 6 comments · Fixed by #40
Labels

Comments

@cmluciano
Copy link

cmluciano commented Sep 28, 2016

I am trying to run the utility but i can't get anything to output aside from the help menu. When running the utility and inspecting the return code, I am getting a 1. This makes me think that I might be hitting this line https://github.com/PagerDuty/go-pagerduty/blob/master/command/main.go#L123 but I don't get any other errors even if I swap stderr with stdout.

My initial impression is that it keeps hitting this help menu because something was wrong with my api key that I tried to pass with -authtoken="MYKEY" and with the alternative ~/.pd.yml. I tested out the escalation policy example was able to get results with the key, so it should be a valid key.

I'll keep digging into the code, but I thought it would be worth creating an issue to track this as well.

@ranjib
Copy link
Contributor

ranjib commented Sep 28, 2016

@cmluciano can you share the CLI usage you are trying?

@cmluciano
Copy link
Author

I have tried

bin/pd -v
bin/pd --version
bin/pd service list -authtoken="APIKEY"

But all just return the help menu.

@ranjib
Copy link
Contributor

ranjib commented Sep 28, 2016

@cmluciano can you test with the master, if it persist?

@cmluciano
Copy link
Author

I can get the version to print no problem, but I still has an exit code of 1.

bin/pd service list -authtoken="APIKEY"; echo $?
usage: pd [--version] [--help] <command> [<args>]

Available commands are:
    ability list                     List all abilities of the account
    ability test                     Test if an account has given ability
    addon delete                     Delete details of an addon
    addon install                    Install a new addon
    addon list                       List all addons
    addon show                       Show details of an addon
    addon update                     Update details of an addon
    escalation-policy create         Creates a new escalation policy
    escalation-policy delete         Deletes an existing escalation policy and rules
    escalation-policy list           List all of the existing escalation policies
    escalation-policy show           Show information about an existing escalation policy and its rules
    escalation-policy update         Updates an existing escalation policy and rules
    incident list                    List existing incidents
    incident manage                  Acknowledge, resolve, escalate or reassign one or more incidents
    incident note create             Create a new note for the specified incident
    incident note list               List existing notes for the specified incident
    incident show                    Show detailed information about an incident
    incident snooze                  Snooze an incident
    log-entry list                   List all of the incident log entries across the entire account
    log-entry show                   Get details for a specific incident log entry
    maintenance-window create        Create a new maintenance window for the specified services
    maintenance-window delete        Delete an existing maintenance window if it's in the future, or end it if it's currently on-going
    maintenance-window list          List existing maintenance windows
    maintenance-window show          Show an existing maintenance window
    maintenance-window update        Update an existing maintenance window
    notification list                List notifications for a given time range
    oncall list                      List the on-call entries during a given time range
    schedule create                  Create a new on-call schedule
    schedule delete                  Delete an on-call schedule
    schedule list                    List the on-call schedules
    schedule oncall list             List incidents
    schedule override create         Create an override for a specific user
    schedule override delete         Remove an override
    schedule override list           List overrides for a given time range
    schedule preview                 Preview what an on-call schedule would look like without saving it
    schedule show                    Show detailed information about a schedule
    schedule update                  Update an existing on-call schedule
    service create                   Create a new service
    service delete                   Delete an existing service
    service integration create       Create a new integration belonging to a service
    service integration show         Get details about an integration belonging to a service
    service integration update       Update an integration belonging to a service
    service list                     List existing services
    service show                     Get details about an existing service
    service update                   Update an existing service
    team add escalation-policy       Add an escalation policy to a team
    team add user                    Add a user to a team
    team create                      Get details about an existing team
    team delete                      Remove an existing team
    team list                        List teams of your PagerDuty account, optionally filtered by a search query
    team remove escalation-policy    Remove an escalation policy from a team
    team show                        Get details about an existing team
    team update                      Update an existing team
    user contact-method create       Create a new contact method
    user contact-method delete       Remove a user's contact method
    user contact-method list         List contact methods of your PagerDuty user
    user contact-method show         Get details about a user's contact method
    user contact-method update       Update a user's contact method
    user create                      Create a new user
    user delete                      Remove an existing user
    user list                        List users of your PagerDuty account, optionally filtered by a search query
    user notification-rule create    Create a new notification rule
    user notification-rule delete    Remove a user's notification rule
    user notification-rule list      List notification rules of your PagerDuty user
    user notification-rule show      Get details about a user's notification rule
    user notification-rule update    Update a user's notification rule
    user show                        Get details about an existing user
    user update                      Update an existing user

1

@ranjib ranjib reopened this Sep 28, 2016
@cmluciano
Copy link
Author

OK I figured it out. This was a mixture of stale dependencies local with the cli library. A "super fresh" build fixed everything.

@ranjib
Copy link
Contributor

ranjib commented Sep 28, 2016

😎 thanks again for reporting the issue. let me know if you hit any other bugs. this library is under development, likely to have bugs /missing features till we hit a stable milestone. I'll cut a release (binary will be available on the github release page), as and when we reach there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants