Skip to content

Commit

Permalink
docs: update for usages
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Aug 15, 2023
1 parent 5121021 commit 468da40
Showing 1 changed file with 64 additions and 11 deletions.
75 changes: 64 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,78 @@ features:
- design for new service.
- share for code copy.

## APIs

### TEXT EMBEDDING
## Development

GET http://127.0.0.1:8765/api/text-embedding?q="create arch system"
1. install Qdrant by Docker:
```bash
docker pull qdrant/qdrant
docker run -p 6333:6333 qdrant/qdrant
```
2. Run CoUnit-Server

### Query API
## APIs

GET http://127.0.0.1:8765/api/query?q="create arch system"&repo_ref=archguard&query_type=HttpApi
### 1. Upload Data by ArchGuard

1. Download ArchGuard CLI (scanner_cli-2.x.x-all.jar) from: [https://github.com/archguard/archguard/releases]
2. Run ArchGuard CLI to upload data to Co-Unit:

```bash
Usage: runner [OPTIONS]

scanner cli

Options:
--type [SOURCE_CODE|GIT|DIFF_CHANGES|SCA|RULE|ARCHITECTURE|ESTIMATE|OPENAPI]
--system-id TEXT system id
--server-url TEXT the base url of the archguard api server
--workspace TEXT the workspace directory
--path TEXT the path of target project
--output TEXT http, csv, json, console
--output-dir TEXT output directory
--analyser-spec TEXT Override the analysers via json.
--slot-spec TEXT Override the slot via json.
--language TEXT language: Java, Kotlin, TypeScript, CSharp,
Python, Golang.
--rules TEXT rules: webapi, test, sql
--features TEXT features: apicalls, datamap.
--repo-id TEXT repository id used for git analysing
--branch TEXT repository branch
--started-at INT TIMESTAMP, the start date of the scanned
commit
--since TEXT COMMIT ID, the specific revision of the
baseline
--until TEXT COMMIT ID, the specific revision of the
target
--depth INT INTEGER, the max loop depth
--with-function-code BOOLEAN, whether to include the function
code
-h, --help Show this message and exit
```

For example:

```bash
java -jar scanner_cli-2.0.4-all.jar --language=Kotlin --path=your_path_to_code --server-url=http://localhost:8765 --repo-id="archguard" --with-function-code --output=http --features=apicalls
```

ArchGuard APIs:

- POST http://127.0.0.1:8765/scanner/:systemId/reporting/class-items
- POST http://127.0.0.1:8765/scanner/:systemId/reporting/openapi
- POST http://127.0.0.1:8765/scanner/:systemId/reporting/container-services
- POST http://127.0.0.1:8765/scanner/:systemId/reporting/datamap-relations

### 2. Get Data by Co-Unit

### Upload Data by ArchGuard
### Query API

POST http://127.0.0.1:8765/scanner/:systemId/reporting/class-items
GET http://127.0.0.1:8765/api/query?q=create%20arch%20system&repo_ref=archguard&query_type=HttpApi

POST http://127.0.0.1:8765/scanner/:systemId/reporting/openapi

POST http://127.0.0.1:8765/scanner/:systemId/reporting/container-services
### 3. TEXT EMBEDDING

POST http://127.0.0.1:8765/scanner/:systemId/reporting/datamap-relations
GET http://127.0.0.1:8765/api/text-embedding?q=create%20arch%20system


## License
Expand Down

0 comments on commit 468da40

Please sign in to comment.