Project

General

Profile

Actions

Feature #4931

closed

add a simple python example

Added by lynxis about 3 years ago. Updated about 3 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
-
Start date:
01/01/2021
Due date:
% Done:

100%

Spec Reference:

Description

to start using the cbc it would be great to have simple examples for the rest api.
it would be great to have multiple python function for different examples.

as starting point we could use:

import requests
import json

def start_ewts():
    pass

url = "http://127.0.0.1:12345/api/ecbe/v1/message" 
obj = {
    'serial_nr': {
        'serial_nr_decoded': {
            'geo_scope': "cell_wide",
            'msg_code': 1,
            'update_nr': 2
            } },
    'message_id': 12,
    'payload': {
        'payload_etws': {
            'warning_type': {
                'warning_type_decoded': 'test',
                }
            }
        }
    }

requests.post(url, json=obj)

Actions #1

Updated by laforge about 3 years ago

  • Tracker changed from Bug to Feature
Actions #2

Updated by laforge about 3 years ago

  • Assignee set to laforge
Actions #3

Updated by laforge about 3 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

The cbc-apitool.py has been generalized a bit; it's part of the osmo-cbc source code and in the osmo-cbc-utils rpm/dpkg package.

Documentation is part of the osmo-cbc user manual.

Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)