Coder Social home page Coder Social logo

acs-cli's Introduction

Splunk OCSF Extension

The Splunk schema extension repository

acs-cli's People

Contributors

ibaniya-splunk avatar rahul8590 avatar rsatalkar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

acs-cli's Issues

open api python gen can't produce valid python client api based on https://admin.splunk.com/service/info/specs/v2/openapi.json

I'm not a developer but it seems kinda weird. splunk admin openapi spec hosted at https://admin.splunk.com/service/info/specs/v2/openapi.json has issues (however small?). It's a pity that such a big company doesn't even bother testing it against popular client-gen tools.

As an example, the following code doesn't run with various problems.

import splunkacs
from splunkacs.apis.tags import indexes_api
from splunkacs.model.error import Error
from splunkacs.model.index_response import IndexResponse
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = splunkacs.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (JWT): bearerAuth
configuration = splunkacs.Configuration(
    access_token = 'YOUR_BEARER_TOKEN'  # syntax error here. 
)
# Enter a context with an instance of the API client
with splunkacs.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = indexes_api.IndexesApi(api_client)

    # example passing only required values which don't have defaults set
    path_params = {
        'stack': "stack_example",
    }
    query_params = {
    }
    try:
        api_response = api_instance.list_indexes(
            path_params=path_params,
            query_params=query_params,
        )
        pprint(api_response)
    except splunkacs.ApiException as e:
        print("Exception when calling IndexesApi->list_indexes: %s\n" % e)

    # example passing only optional values
    path_params = {
        'stack': "stack_example",
    }
    query_params = {
        'count': 30,
        'offset': 0,
    }
    try:
        api_response = api_instance.list_indexes(
            path_params=path_params,
            query_params=query_params,
        )
        pprint(api_response)
    except splunkacs.ApiException as e:  # exception thrown here. 
        print("Exception when calling IndexesApi->list_indexes: %s\n" % e)

Errors include:

TypeError: Configuration.__init__() got an unexpected keyword argument 'access_token'
splunkacs.exceptions.ApiValueError: Invalid content_type returned. Content_type='application/json; charset=UTF-8' was returned when only {'application/json'} are defined for status_code=401

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.