1
0
mirror of https://github.com/peeringdb/peeringdb.git synced 2024-05-11 05:55:09 +00:00
Files
peeringdb-peeringdb/docs/dev/modules/api_schema.py.md
Stefan Pratter a0f1970fec Support 202211 (#1304)
* Carrier object implementation #909

* API keys: disabling of user account by a PeeringDB admin does not disable access via a User API key. Also no disable mech, only revoke. #1140

* Ops: django needs lightweight healthcheck route that confirms database connectivity #1284

* Ops: various indexes are needed #1285

* API requests with invalid Authentication headers should notify users in some way. #1220

* Allow user to change account username #1130

* UX to remove carriers from facilities more inline the other similar UX

* more UX fixes for removing carriers from facilities

* Cache hints are needed for optimal CDN use #970

* fixes Commandline tool "Run command" button gone #1278

* RIR status gets deleted when changes are made to the network #1279

* Improve MTU field #658

* CSRF cookie not set error from email confirmation view #1296

* expose CSP_CONNECT_SRC

* fix confirm email path checking in session middleware

* Ops: Emails to OPERATIONS_EMAIL need to be rate-limited #1282

* add website field to carrier ux

* website field on carrier optional with org fallback

* linting

* add *.google-analytics.com to CSP_CONNECT_SRC

* poetry relock

* fix issues with confirm-email reverse during session creation validation

* fix tests

* fix tests

* pin django-peeringdb to support_202211

* linting

* django ratelimit to <4

* regen docs

* fix automated net stats to only include networks with status `ok` #1283

* linting

* poetry lock

Co-authored-by: Matt Griswold <grizz@20c.com>
2023-01-18 10:32:46 -06:00

2.7 KiB

Generated from api_schema.py on 2023-01-17 22:33:48.360745

peeringdb_server.api_schema

Augment REST API schema to use for open-api schema generation.

open-api schema generation leans heavily on automatic generation implemented through the django-rest-framework.

Specify custom fields to be added to the generated open-api schema.

Classes


BaseSchema

BaseSchema(rest_framework.schemas.openapi.AutoSchema)

Augments the openapi schema generation for the peeringdb API docs.

Methods

augment_create_ix

def augment_create_ix(self, serializer, model, op_dict)

Augment openapi schema for create ix operation.


augment_create_operation

def augment_create_operation(self, op_dict, op_args)

Augment openapi schema for object creation.


augment_delete_operation

def augment_delete_operation(self, op_dict, op_args)

Augment openapi schema for delete operation.


augment_list_filters

def augment_list_filters(self, model, serializer, parameters)

Further augment openapi schema for object listing by filling the query parameter list with all the possible query filters for the object.


augment_list_operation

def augment_list_operation(self, op_dict, op_args)

Augment openapi schema for object listings.


augment_retrieve_operation

def augment_retrieve_operation(self, op_dict, op_args)

Augment openapi schema for single object retrieval.


augment_update_fac

def augment_update_fac(self, serializer, model, op_dict)

Augment openapi schema for update fac operation.


augment_update_ix

def augment_update_ix(self, serializer, model, op_dict)

Augment openapi schema for update ix operation.


augment_update_net

def augment_update_net(self, serializer, model, op_dict)

Augment openapi schema for update net operation.


augment_update_operation

def augment_update_operation(self, op_dict, op_args)

Augment openapi schema for update operation.


get_classes

def get_classes(self, *op_args)

Try to relate a serializer and model class to the openapi operation.

Returns:

  • tuple(serializers.Serializer, models.Model)

get_operation

def get_operation(self, *args, **kwargs)

Override this so we can augment the operation dict for an openapi schema operation.


get_operation_id

def get_operation_id(self, path, method)

Override this so operation ids become "{op} {reftag}"


get_operation_type

def get_operation_type(self, *args)

Determine if this is a list retrieval operation.


request_body_schema

def request_body_schema(self, op_dict, content=application/json)

Helper function that return the request body schema for the specified content type.