All URIs are relative to https://rocc.org/api/v1
Method | HTTP request | Description |
---|---|---|
create_challenge | POST /challenges | Add a challenge |
delete_challenge | DELETE /challenges/{challengeId} | Delete a challenge |
get_challenge | GET /challenges/{challengeId} | Get a challenge |
list_challenges | GET /challenges | List all the challenges |
ChallengeCreateResponse create_challenge(challenge_create_request)
Add a challenge
Adds a challenge
from __future__ import print_function
import time
import roccclient
from roccclient.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://rocc.org/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = roccclient.Configuration(
host = "https://rocc.org/api/v1"
)
# Enter a context with an instance of the API client
with roccclient.ApiClient() as api_client:
# Create an instance of the API class
api_instance = roccclient.ChallengeApi(api_client)
challenge_create_request = roccclient.ChallengeCreateRequest() # ChallengeCreateRequest |
try:
# Add a challenge
api_response = api_instance.create_challenge(challenge_create_request)
pprint(api_response)
except ApiException as e:
print("Exception when calling ChallengeApi->create_challenge: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
challenge_create_request | ChallengeCreateRequest |
No authorization required
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
201 | Success | - |
400 | Invalid request | - |
409 | The request conflicts with current state of the target resource | - |
500 | The request cannot be fulfilled due to an unexpected server error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
object delete_challenge(challenge_id)
Delete a challenge
Deletes the challenge specified
from __future__ import print_function
import time
import roccclient
from roccclient.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://rocc.org/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = roccclient.Configuration(
host = "https://rocc.org/api/v1"
)
# Enter a context with an instance of the API client
with roccclient.ApiClient() as api_client:
# Create an instance of the API class
api_instance = roccclient.ChallengeApi(api_client)
challenge_id = 'challenge_id_example' # str | The ID of the challenge
try:
# Delete a challenge
api_response = api_instance.delete_challenge(challenge_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling ChallengeApi->delete_challenge: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
challenge_id | str | The ID of the challenge |
object
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Success | - |
404 | The specified resource was not found | - |
500 | The request cannot be fulfilled due to an unexpected server error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Challenge get_challenge(challenge_id)
Get a challenge
Returns the challenge specified
from __future__ import print_function
import time
import roccclient
from roccclient.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://rocc.org/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = roccclient.Configuration(
host = "https://rocc.org/api/v1"
)
# Enter a context with an instance of the API client
with roccclient.ApiClient() as api_client:
# Create an instance of the API class
api_instance = roccclient.ChallengeApi(api_client)
challenge_id = 'challenge_id_example' # str | The ID of the challenge
try:
# Get a challenge
api_response = api_instance.get_challenge(challenge_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling ChallengeApi->get_challenge: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
challenge_id | str | The ID of the challenge |
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Success | - |
404 | The specified resource was not found | - |
500 | The request cannot be fulfilled due to an unexpected server error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PageOfChallenges list_challenges(limit=limit, offset=offset, filter=filter)
List all the challenges
Returns all the challenges
from __future__ import print_function
import time
import roccclient
from roccclient.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://rocc.org/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = roccclient.Configuration(
host = "https://rocc.org/api/v1"
)
# Enter a context with an instance of the API client
with roccclient.ApiClient() as api_client:
# Create an instance of the API class
api_instance = roccclient.ChallengeApi(api_client)
limit = 10 # int | Maximum number of results returned (optional) (default to 10)
offset = 0 # int | Index of the first result that must be returned (optional) (default to 0)
filter = roccclient.ChallengeFilter() # ChallengeFilter | Object that describes how to filter the results (optional)
try:
# List all the challenges
api_response = api_instance.list_challenges(limit=limit, offset=offset, filter=filter)
pprint(api_response)
except ApiException as e:
print("Exception when calling ChallengeApi->list_challenges: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
limit | int | Maximum number of results returned | [optional] [default to 10] |
offset | int | Index of the first result that must be returned | [optional] [default to 0] |
filter | ChallengeFilter | Object that describes how to filter the results | [optional] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Success | - |
400 | Invalid request | - |
500 | The request cannot be fulfilled due to an unexpected server error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]