예제 #1
0
        print(capella_api_response.json()["message"])


if __name__ == '__main__':
    # Process command line args
    # Create the parser
    my_parser = MyParser(
        description=
        'Deletes a cluster running in your cloud from Couchbase Capella')
    my_parser.ExampleCmdline = """-cid 1478c0f4-07b2-4818-a5e8-d15703ef79b0 """

    # Add the arguments
    my_parser.add_argument('-cid',
                           '--clusterID',
                           dest="clusterID",
                           metavar="",
                           action='store',
                           required=True,
                           type=check_if_valid_uuid,
                           help='The ID of the cluster')

    my_parser.add_argument("-d",
                           "--debug",
                           default=False,
                           action="store_true",
                           help="Turn on logging at debug level")

    args = my_parser.parse_args()

    main(args)
예제 #2
0
        print(capella_api_response.json()["message"])


if __name__ == '__main__':
    # Process command line args
    # Create the parser
    my_parser = MyParser(description='Creates a 3 node cluster using Couchbase managed cloud in Couchbase Capella\n '
                                     'with data, index, search, and query services and 50Gb of storage\n in aws '
                                     'us-east-2')
    my_parser.ExampleCmdline = "-cn aNewCluster -pid 1478c0f4-07b2-4818-a5e8-d15703ef79b0 "

    # Add the arguments

    my_parser.add_argument('-cn', '--clusterName',
                           action='store',
                           required=True,
                           type=str,
                           help='The name to use for the cluster')

    my_parser.add_argument('-pid', '--projectID',
                           action='store',
                           required=True,
                           type=check_if_valid_uuid,
                           help='ID of the project to use for the cluster')

    my_parser.add_argument("-d", "--debug",
                           default=False,
                           action="store_true",
                           help="Turn on logging at debug level")

    args = my_parser.parse_args()
            # Display the table, which uses pretty table to make things easier
            print('Capella Clusters ')
            print(pretty_table(cluster_table_heading, clusters_table_rows))

    else:
        print("Failed to get list of clusters ")
        print("Capella API returned " + str(capella_api_response.status_code))
        print("Full error message")
        print(capella_api_response.json()["message"])


if __name__ == '__main__':
    # Process command line args
    # Create the parser

    my_parser = MyParser(
        description='List clusters managed by Couchbase Capella')
    my_parser.ExampleCmdline = """With debug on -d \nWith debug off """

    # Add the arguments
    my_parser.add_argument("-d",
                           "--debug",
                           default=False,
                           action="store_true",
                           help="Turn on logging at debug level")

    args = my_parser.parse_args()

    main(args)
예제 #4
0

if __name__ == '__main__':
    # Process command line args
    # Create the parser
    my_parser = MyParser(
        description=
        'Updates the memory quota bucket for a cluster running in your cloud')
    my_parser.ExampleCmdline = """-cid "d157a069-9451-4188-a4b1-8be2920db094" -m 250 -n "my-new-bucket" """

    # Add the arguments

    my_parser.add_argument('-cid',
                           '--ClusterID',
                           dest="ClusterID",
                           metavar="",
                           action='store',
                           required=True,
                           type=check_if_valid_uuid,
                           help='The ID of the cluster')

    my_parser.add_argument('-n',
                           '--bucketName',
                           dest="bucketName",
                           metavar="",
                           action='store',
                           required=True,
                           type=str,
                           help='The name of the bucket')

    my_parser.add_argument('-m',
                           '--MemoryQuota',