Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Feature/updating api docs #121

Merged
merged 5 commits into from
Sep 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/vng/openApiInspector/api_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ def __init__(self, detail, field, status_code):


class OpenApiInspectionAPIView(views.APIView):
"""
OpenAPI inspector

Checks whether a URL to an API specification conforms to OAS 2.0 or higher
"""

@swagger_auto_schema(request_body=OpenApiInspectionSerializer, responses={200: OpenApiInspectionResponseSerializer})
def post(self, request):
Expand Down
26 changes: 26 additions & 0 deletions src/vng/servervalidation/api_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ def update(self, request, pk):


class ResultServerViewShield(views.APIView):
"""
Provider run badge detail

Return the badge information of a specific provider run
"""

@swagger_auto_schema(responses={200: ServerRunResultShield})
def get(self, request, uuid=None):
Expand Down Expand Up @@ -168,6 +173,27 @@ def get(self, request, pk, *args, **kwargs):
class PostmanTestViewset(mixins.ListModelMixin,
mixins.RetrieveModelMixin,
viewsets.GenericViewSet):
"""
list:
Postman test list

Return a list of all the existing Postman tests

get_specific_version:
Retrieve a specific version of a Postman test

Return the Postman test collection that has the given name and version

get_all_versions:
Retrieve all versions of a Postman test

Return all the possible versions of a Postman test

retrieve:
Postman test detail

Return a specific Postman test
"""
serializer_class = PostmanTestSerializer
queryset = PostmanTest.objects.all()

Expand Down
199 changes: 199 additions & 0 deletions src/vng/servervalidation/migrations/0076_auto_20190905_1519.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
# Generated by Django 2.2.4 on 2019-09-05 13:19

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import filer.fields.file
import tinymce.models
import uuid


class Migration(migrations.Migration):

dependencies = [
('servervalidation', '0075_auto_20190902_1521'),
]

operations = [
migrations.AlterField(
model_name='endpoint',
name='server_run',
field=models.ForeignKey(help_text='The provider run to which this endpoint belongs', on_delete=django.db.models.deletion.CASCADE, to='servervalidation.ServerRun'),
),
migrations.AlterField(
model_name='endpoint',
name='test_scenario_url',
field=models.ForeignKey(help_text='The test scenario variable to which this endpoint belongs', on_delete=django.db.models.deletion.CASCADE, to='servervalidation.TestScenarioUrl'),
),
migrations.AlterField(
model_name='endpoint',
name='url',
field=models.TextField(help_text='The value of the variable'),
),
migrations.AlterField(
model_name='postmantest',
name='name',
field=models.CharField(help_text='The name of the Postman test suite', max_length=150),
),
migrations.AlterField(
model_name='postmantest',
name='published_url',
field=models.URLField(blank=True, help_text='The URL pointing to the published collection on the Postman website', null=True),
),
migrations.AlterField(
model_name='postmantest',
name='test_scenario',
field=models.ForeignKey(help_text='The name of the test scenario to which this Postman test is linked', on_delete=django.db.models.deletion.PROTECT, to='servervalidation.TestScenario'),
),
migrations.AlterField(
model_name='postmantest',
name='validation_file',
field=filer.fields.file.FilerFileField(blank=True, default=None, help_text='The actual file containing the Postman collection', null=True, on_delete=django.db.models.deletion.SET_NULL, to='filer.File'),
),
migrations.AlterField(
model_name='postmantest',
name='version',
field=models.CharField(default='1.0.0', help_text='Indicates the version of the Postman test suite, allowing for different\n versions under the same name\n ', max_length=20),
),
migrations.AlterField(
model_name='postmantestresult',
name='log',
field=models.FileField(blank=True, default=None, help_text='The HTML log generated by Newman', null=True, upload_to='', verbose_name='/files/log'),
),
migrations.AlterField(
model_name='postmantestresult',
name='log_json',
field=models.FileField(blank=True, default=None, help_text='The JSON log generated by Newman', null=True, upload_to='', verbose_name='/files/log'),
),
migrations.AlterField(
model_name='postmantestresult',
name='postman_test',
field=models.ForeignKey(help_text='The Postman test which this result belongs to', on_delete=django.db.models.deletion.CASCADE, to='servervalidation.PostmanTest'),
),
migrations.AlterField(
model_name='postmantestresult',
name='server_run',
field=models.ForeignKey(help_text='The provider run which this result belongs to', on_delete=django.db.models.deletion.CASCADE, to='servervalidation.ServerRun'),
),
migrations.AlterField(
model_name='postmantestresult',
name='status',
field=models.CharField(choices=[('Success', 'success'), ('Failed', 'failed')], default=None, help_text='Indicates whether all test passed or not', max_length=10, null=True),
),
migrations.AlterField(
model_name='serverheader',
name='header_key',
field=models.TextField(help_text='The name of the HTTP header'),
),
migrations.AlterField(
model_name='serverheader',
name='header_value',
field=models.TextField(help_text='The value of the HTTP header'),
),
migrations.AlterField(
model_name='serverheader',
name='server_run',
field=models.ForeignKey(help_text='The provider run for which this header was used', on_delete=django.db.models.deletion.CASCADE, to='servervalidation.ServerRun'),
),
migrations.AlterField(
model_name='serverrun',
name='client_id',
field=models.TextField(blank=True, default=None, help_text='If the test scenario requires JWT authentication, this field will be used to construct a JWT', null=True),
),
migrations.AlterField(
model_name='serverrun',
name='last_exec',
field=models.DateTimeField(blank=True, default=None, help_text='The time at which the last provider run for the test scenario was executed', null=True, verbose_name='Last run'),
),
migrations.AlterField(
model_name='serverrun',
name='percentage_exec',
field=models.IntegerField(blank=True, default=None, help_text='Indicates what percentage of the provider run has been executed', null=True),
),
migrations.AlterField(
model_name='serverrun',
name='scheduled',
field=models.BooleanField(default=False, help_text='If enabled, this provider run will be executed every day at midnight'),
),
migrations.AlterField(
model_name='serverrun',
name='secret',
field=models.TextField(blank=True, default=None, help_text='If the test scenario requires JWT authentication, this field will be used to construct a JWT', null=True),
),
migrations.AlterField(
model_name='serverrun',
name='software_product',
field=models.CharField(blank=True, help_text='Name of the software tested by this provider test', max_length=100, null=True),
),
migrations.AlterField(
model_name='serverrun',
name='started',
field=models.DateTimeField(default=django.utils.timezone.now, help_text='The time at which the provider run was started', verbose_name='Started at'),
),
migrations.AlterField(
model_name='serverrun',
name='status',
field=models.CharField(choices=[('starting', 'starting'), ('running', 'running'), ('shutting down', 'shutting down'), ('stopped', 'stopped'), ('Error deployment', 'error deploy'), ('Scheduled', 'scheduled')], default='starting', help_text='Indicates the status of this provider run', max_length=20),
),
migrations.AlterField(
model_name='serverrun',
name='status_exec',
field=models.TextField(blank=True, default=None, help_text='Indicates the status of execution of the provider run', null=True),
),
migrations.AlterField(
model_name='serverrun',
name='stopped',
field=models.DateTimeField(blank=True, default=None, help_text='The time at which the provider run was stopped', null=True, verbose_name='Stopped at'),
),
migrations.AlterField(
model_name='serverrun',
name='supplier_name',
field=models.CharField(blank=True, help_text='Name of the supplier of the software product', max_length=100, null=True),
),
migrations.AlterField(
model_name='serverrun',
name='test_scenario',
field=models.ForeignKey(help_text='The test scenario for which this provider run was executed', on_delete=django.db.models.deletion.PROTECT, to='servervalidation.TestScenario'),
),
migrations.AlterField(
model_name='serverrun',
name='user',
field=models.ForeignKey(help_text='The user that started this provider run', null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='serverrun',
name='uuid',
field=models.UUIDField(default=uuid.uuid4, editable=False, help_text='The universally unique identifier of this provider run, needed to retrieve the badge'),
),
migrations.AlterField(
model_name='testscenario',
name='active',
field=models.BooleanField(blank=True, default=True, help_text='Indicates whether this test scenario can be used via the web interface and the API'),
),
migrations.AlterField(
model_name='testscenario',
name='description',
field=tinymce.models.HTMLField(help_text='The description of this test scenario'),
),
migrations.AlterField(
model_name='testscenario',
name='name',
field=models.CharField(help_text='The name of the test scenario', max_length=200, unique=True, verbose_name='name'),
),
migrations.AlterField(
model_name='testscenariourl',
name='name',
field=models.CharField(help_text='The name of the variable', max_length=200, verbose_name='name'),
),
migrations.AlterField(
model_name='testscenariourl',
name='placeholder',
field=models.TextField(blank=True, default='https://www.example.com', help_text='The default value that will be used for this variable'),
),
migrations.AlterField(
model_name='testscenariourl',
name='test_scenario',
field=models.ForeignKey(help_text='The test scenario to which this variable is linked', on_delete=django.db.models.deletion.PROTECT, to='servervalidation.TestScenario'),
),
]
Loading